NSIS 多语言安装界面
原创
©著作权归作者所有:来自51CTO博客作者春蕾夏荷的原创作品,请联系作者获取转载授权,否则将追究法律责任
NSIS默认的打包界面多语言不太好用,因为界面不能跟着切换语言上面的文字也随着切换,所以只能是考虑自定义的方法解决这个问题
本人采用duilib与NSIS结合的方法,效果如下所示:
;获取系统默认的语言
System::Call 'Kernel32::GetUserDefaultUILanguage() i.r0'
Pop $0
${if} $0 == '2052'
;cn
SkinEngine::SetControlAttribute "comboLanguageSelect" "selindex" "1"
SkinEngine::SetControlAttribute "btnLanageNext" "text" "${CN_LANGUAGEPAGENEXT}"
SkinEngine::SetControlAttribute "btnLanageCancel" "text" "${CN_LANGUAGEPAGECANCEL}"
SkinEngine::SetControlAttribute "startPage_lbllanguage" "text" "安装语言选择:"
StrCpy $selectlanguage "1"
${endif}
${if} $0 == '1033'
;en
SkinEngine::SetControlAttribute "comboLanguageSelect" "selindex" "0"
SkinEngine::SetControlAttribute "btnLanageNext" "text" "${EN_LANGUAGEPAGENEXT}"
SkinEngine::SetControlAttribute "btnLanageCancel" "text" "${EN_LANGUAGEPAGECANCEL}"
SkinEngine::SetControlAttribute "startPage_lbllanguage" "text" "install language select:"
StrCpy $selectlanguage "0"
${endif}