使用 Electron-builder 自定义 NSIS 安装程序

bor*_*ere 5 nsis electron electron-builder

我想自定义 NSIS 脚本 - 例如删除完成页面并在安装后立即运行应用程序(使用辅助安装程序)。

我使用修改脚本:include: build/installer.nsh.

安装后它会打开myApp ,但“完成”页面仍然存在。

!include MUI2.nsh

!macro customInstall
  ExecWait '"$INSTDIR\myapp.exe" /sw'
!macroend
Run Code Online (Sandbox Code Playgroud)

我的意思是我不想显示最后一页完成 myApp 设置,如 gif 所示。

安装过程

任何帮助表示赞赏。

bor*_*ere 7

最后我在build/installer.nsh中做到了:

!macro RunApp
  ${StdUtils.ExecShellAsUser} $0 "$launchLink" "open" ""
!macroend

!macro customInstall
    !insertmacro RunApp
    !insertmacro quitSuccess
!macroend
Run Code Online (Sandbox Code Playgroud)