有没有人成功创建了单页autorun.inf文件?*.inf文件的文档建议您
[autorun]
open="MyApp.exe"
icon=MyApp.exe,0
label=%AppLabel%
action=%AppAction%
[Strings]
AppLabel = "My test app"
AppAction = "Start my test app"
[Strings.0407] ; 0407 is the language ID for German
AppLabel = "German my test app"
AppAction = "German start my test app"应该行得通。我发现标签(出现在自动运行对话框中)显示的是'%AppLabel%‘,而不是预期的’我的测试应用‘。
发布于 2011-07-25 00:44:00
卡萨布兰卡在评论中链接的docs告诉我们必须如何做到这一点,不过是以一种间接的方式。
答案就在"indirect strings"中。必须将多个字符串资源添加到EXE或DLL文件中,这些资源都具有相同的ID,但语言不同(由LANGUAGE语句指定)。然后,您可以通过间接字符串语法@filename,-id在autorun.inf文件中引用这些字符串
间接字符串的语法是@符号,后跟包含所引用的字符串资源的文件名,然后是逗号、减号,最后是所引用的字符串ID。
示例:
[autorun]
open="MyApp.exe"
icon=MyApp.exe,0
label=@MyApp.exe,-100
action=@MyApp.exe,-101这要求您的EXE中有一个包含所有本地化字符串的字符串表资源。在RC文件格式中,它可能如下所示:
#include <winresrc.h>
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
STRINGTABLE
BEGIN
100 "English MyApp
101 "English MyApp description text"
END
LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
STRINGTABLE
BEGIN
100 "German MyApp
101 "German MyApp description text"
END如果用户安装了德语版本的Windows,或者选择了德语作为其MUI语言,则Windows应使用德语字符串。任何其他语言版本都应该选择英文字符串。
https://stackoverflow.com/questions/3765320
复制相似问题