安装后运行应用程序(静默安装程序)

use*_*111 4 nsis

我想在安装后立即运行我的应用程序,我了解执行此操作的代码如下:

!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
!insertmacro MUI_PAGE_FINISH

Section
CreateShortcut "$DESKTOP\HelloWorldShortcut.lnk" "$INSTDIR\Hello World.exe" "dev03 3" 
SectionEnd    

Function LaunchLink
ExecShell "" "$DESKTOP\HelloWorldShortcut.lnk"
FunctionEnd
Run Code Online (Sandbox Code Playgroud)

问题是我的安装程序是静默安装程序,但上面的代码向其中添加了一个页面。

有没有办法使用静默安装程序在安装后立即运行应用程序?

And*_*ers 5

静默安装程序可以仅运行应用程序作为最后一部分的最后一步。您应该考虑让静默安装程序启动应用程序是否是一个好主意,我个人会说不......

Section
SetOutPath $InstDir
File "MyApp.exe"
...

IfSilent "" +2 ; If the installer is always silent then you don't need this check
ExecShell "" "$InstDir\MyApp.exe"
SectionEnd
Run Code Online (Sandbox Code Playgroud)