I have the following lines:
[Run]
Filename: "{app}\MyApp.exe"; Flags: postinstall nowait
I would like my app to get started without showing a checkbox (which would disallow the user to do so).
Can somebody show me how, please?
Thank you.
inno-setup
I have the following lines:
[Run]
Filename: "{app}\MyApp.exe"; Flags: postinstall nowait
I would like my app to get started without showing a checkbox (which would disallow the user to do so).
Can somebody show me how, please?
Thank you.
Best Answer
There are few options I can think of. The first one is to run your application from the
[Code]
section of your script, the second one is to disable that check box for your[Run]
section entry and the third one is to hide theRunList
.1. How to manually run an application when the wizard is finished ?
I would personally prefer this way, because it's more straightforward than adding a check box and hiding it later on. You will remove your current
[Run]
section entry and call one of the following functions from theNextButtonClick
event method when itsCurPageID
parameter equals towpFinished
, which indicates the Finish button click:Exec
- executes the specified executable or batch file, using the same credentials as Setup/Uninstall.ExecAsOriginalUser
- executes the specified executable or batch file, using the (normally non-elevated) credentials of the user that started Setup initiallyShellExec
- opens the specified file or performs another action specified by Verb, using the same credentials as Setup/Uninstall.ShellExecAsOriginalUser
- opens the specified file or performs another action specified by Verb, using the (normally non-elevated) credentials of the user that started Setup initially.Because you haven't used the
runascurrentuser
norshellexec
flags, the setup internally calls a function similar to this:One weakness of this solution is that the program would be executed even if the restart is requested by the setup. To workaround a missing possibility to determine this request we can check if the
YesRadio
is visible (it is the Yes, restart the computer now radio button) and selected, which means that the user was asked to restart the computer and confirmed it. Here is the version considering the restart request:2. How to disable the post install check box on the final page ?
Another option is to disable the check box. The user will see that the application is going to be executed, but won't be able to do anything against it (except killing the setup from Task Manager, of course). This time you will keep your
[Run]
section entry as it, but modify theRunList
from the[Code]
section:3. How to completely hide the RunList ?
This will, contrary to the second option, do what you asked for. It will keep the check box hidden, or to be more precise, it will hide the whole
RunList
, so if you were having more than one entry in the[Run]
section with thepostinstall
flag specified, it won't be seen as well: