关于NSIS脚本打包程序

可在百度下载NSIS与nisedit,也可在我的资源下载->资源

使用nisedit2.0.3.exe向导生成.nsi文件脚本

可以在文件的结尾的SectionEnd再加上下面一段代码 这样可以实现安装完成后再安装程序所需要的运行环境

LangString str_install_vc ${LANG_SIMPCHINESE} "建议安装VC++2015软件运行环境!$\n如果已经安装,可以不必重复安装"
LangString str_install_vc ${LANG_ENGLISH} "Do you want to install the VC ++ 2015 runtime that is required for$\n the software to run? If it is already installed, you can not repeat the$\n installation."


; Optional section (can be disabled by the user)
Section "Install vc"
MessageBox MB_YESNO $(str_install_vc) IDNO done
Exec '"$INSTDIR\vcredist_x86.exe"'
done:
SectionEnd

值得提醒的是在nsis脚本中换行符号为  $\n  回车为 $\r  Tab为 $\t

关于MessageBox的设置:

MessageBox只显示一个确定按钮:MB_OK - Display with an OK button

MessageBox显示确定和取消两个按钮:MB_OKCANCEL - Display with an OK and a cancel button

MessageBox显示中止、重试和忽略三个按钮:MB_ABORTRETRYIGNORE - Display with abort, retry, ignore buttons

MessageBox显示重试和取消两个按钮:MB_RETRYCANCEL - Display with retry and cancel buttons

MessageBox显示是和否两个按钮:MB_YESNO - Display with yes and no buttons

MessageBox显示是、否和取消三个按钮:MB_YESNOCANCEL - Display with yes, no, cancel buttons











评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值