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}