name: nsis-installer-generator description: 为Windows生成具有自定义界面和功能的NSIS安装程序脚本 allowed-tools: Read, Write, Edit, Bash, Glob, Grep tags: [windows, nsis, installer, distribution, packaging]
nsis-installer-generator
为Windows应用程序生成NSIS(Nullsoft可脚本化安装系统)安装程序脚本。
功能
- 生成NSIS脚本
- 配置安装程序界面
- 设置组件选择
- 配置文件关联
- 添加注册表项
- 创建快捷方式
- 配置卸载程序
输入模式
{
"type": "object",
"properties": {
"projectPath": { "type": "string" },
"appName": { "type": "string" },
"version": { "type": "string" },
"components": { "type": "array" },
"createShortcuts": { "type": "boolean" }
},
"required": ["projectPath", "appName", "version"]
}
NSIS脚本示例
!include "MUI2.nsh"
Name "我的应用程序"
OutFile "MyApp-Setup.exe"
InstallDir "$PROGRAMFILES\MyApp"
RequestExecutionLevel admin
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Section "安装"
SetOutPath $INSTDIR
File /r "dist\*.*"
WriteUninstaller "$INSTDIR\Uninstall.exe"
CreateShortcut "$DESKTOP\MyApp.lnk" "$INSTDIR\MyApp.exe"
SectionEnd
Section "卸载"
Delete "$DESKTOP\MyApp.lnk"
RMDir /r "$INSTDIR"
SectionEnd
相关技能
wix-toolset-configwindows-authenticode-signer