gpt4 book ai didi

windows - 如何本地化autorun.inf?

转载 作者:可可西里 更新时间:2023-11-01 10:29:41 26 4
gpt4 key购买 nike

有没有人成功创建过单页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%”而不是预期的“我的测试应用程序”。

最佳答案

docs卡萨布兰卡在评论中链接说明了必须如何完成此操作,但是是以迂回的方式。

答案在"indirect strings"中.您必须将多个字符串资源添加到一个 EXE 或 DLL 文件中,所有这些资源都具有相同的 ID 但指定的语言不同(通过 LANGUAGE 语句)。然后您可以在 autorun.inf 中引用这些字符串 文件通过间接字符串语法:@filename,-id

间接字符串的语法是一个@ 符号,后跟包含您正在引用的字符串资源的文件的名称,然后是一个逗号、一个减号,然后是您正在引用的字符串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 应该使用德语字符串。任何其他语言版本应选择英文字符串。

关于windows - 如何本地化autorun.inf?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3765320/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com