我试图使一个NSIS安装程序与电子建设者。我需要显示不同的许可证文件所选择的语言为基础的用户。
- 包. json *
"devDependencies": {
"electron": "22.0.1",
"electron-builder": "^23.6.0"
},
"build": {
"directories": {
"output": "out"
},
"win": {
"target": "nsis",
"icon": "images/logo.ico"
},
"nsis": {
"oneClick": false,
"deleteAppDataOnUninstall": true,
"uninstallerIcon": "images/logo.ico",
"installerIcon": "images/logo.ico",
"displayLanguageSelector": true,
"installerLanguages": ["en_US", "bg_BG"],
"multiLanguageInstaller": true,
"perMachine": true,
"include": "build/preInstall.nsh"
}
}
}
- 预安装. nsh *
!include MUI2.nsh
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE $(translatedlicensefile)
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English
LicenseLangString translatedlicensefile ${LANG_ENGLISH} "build/license/license_en.txt"
!insertmacro MUI_LANGUAGE Bulgarian
LicenseLangString translatedlicensefile ${LANG_BULGARIAN} "build/license/license_bg.txt"
得到这个错误:
Error output:
LicenseLangString: open failed "build/license/license_en.txt"
Usage: LicenseLangString name lang_id|0 license_path
!include: error in script: "/Users/..../preInstall.nsh" on line 32
Error in script "<stdin>" on line 51 -- aborting creation process
第32行
LicenseLangString translatedlicensefile ${LANG_ENGLISH} "build/license/license_en.txt"
我尝试了许多例子,包括官方的一个,并认为使用电子建设者搞砸了NSIS脚本的流程,我不能包括在这一点上的任何修改。
先谢了。
1条答案
按热度按时间icnyk63a1#
我找到了将许可证文件直接加载到NSIS代码中的解决方法。这不是很好的做法,但仍在寻找更好的解决方案。