Skip to content
⌘ NSIS Forum Archive

Launch Program after Install

5 posts

Guest#

Launch Program after Install

How do I make a tickbox option that asks the user to launch the main program after installtion?

Could someone show me where to look in the docs or the code I need? I'm a real newbie but I get the hang of it fast. Thanks.
l_d_allan#
Not sure I understand your question, but ...

There is the 'placeholder' function
.onInstSuccess
that is always called at the end of a successful installation. I've used something like:


Function .onInstSuccess
ExecWait '"$INSTDIR\MyApp parameters"'
# may prefer Exec instead of ExecWait
FunctionEnd
You could also have

Page Components
;;; more statements

Section /o "Run MyApp"
ExecWait '"$INSTDIR\MyApp parameters"'
# may prefer Exec instead of ExecWait
SectionEnd
if you want to have MyApp run 'midway' thru the application rather than at the end. (The first option above sounds closer to what you are asking. I suppose you could use StrCpy to set some kind of myAppRunFlag variable and then check that during .onInstSuccess so that it would run as the last thing)