Inno Setup launch program at user login
March 24, 2020
The official post
1 about this topic hasn't been updated in a long while. So here is a short wizard friendly refresh.For all users
Creating a startup shortcut to the common start menu Startup folder requires the installer to be run in administrative installation mode, if not done through the wizard add the following line to the Setup block.
[Setup]
PrivilegesRequired=admin
Assuming that that the following compiler directives are defined '#MyAppName' and '#MyAppExeName', normally done in the very last step of the script wizard, append the following line to the Icons segment.
[Icons]
Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
The 'commonstartup' points to
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
For user (installer) only
No administrative installation mode is required here. As before presuming you have the defined directives, in the Icons block.
[Icons]
Name: "{userstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
'userstartup' leads to
C:\Users\__Username__\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Comments
References
1
Tags