NSIS脚本中文报错 Bad text encoding
将nsi文件的编码格式从utf8
改为gb2312
Name "WindowsFormsBroswer install Programe"
Caption "WindowsFormsBroswer install Describe"
OutFile "WindowsFormsBroswer_Setup.exe"
Unicode true
InstallDir "$PROGRAMFILES\WindowsFormsBroswer"
!include "MUI2.nsh"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
; 设置语言
!insertmacro MUI_LANGUAGE "SimpChinese"
; 检查.NET 4.8是否安装
Function CheckDotNet
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Release"
IntCmp $0 528040 dotnet_installed dotnet_not_installed dotnet_not_installed
dotnet_not_installed:
MessageBox MB_OK "需要安装.NET Framework 4.8才能运行此程序"
ExecWait '"$INSTDIR\dotNetFx40_Full_x86_x64.exe" /passive /norestart'
dotnet_installed:
FunctionEnd
Section "Main Program"
SetOutPath "$INSTDIR"
File "bin\Release\WindowsFormsBroswer.exe"
File "bin\Release\WindowsFormsBroswer.exe.config"
File "bin\Release\chromedriver.exe"
File "dotNetFx40_Full_x86_x64.exe"
; 创建开始菜单快捷方式
CreateDirectory "$SMPROGRAMS\WindowsFormsBroswer"
CreateShortCut "$SMPROGRAMS\WindowsFormsBroswer\WindowsFormsBroswer.lnk" "$INSTDIR\WindowsFormsBroswer.exe"
; 创建桌面快捷方式
CreateShortCut "$DESKTOP\WindowsFormsBroswer.lnk" "$INSTDIR\WindowsFormsBroswer.exe"
SectionEnd
Function .onInit
Call CheckDotNet
FunctionEnd
转载请注明:SuperIT » NSIS打包安装脚本