Inno Setup launch program at user login

March 24, 2020

The official post1 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

Read also

The Free Alternative to Windows: Linux
Linux: The World's Largest Open-Source Project
InstantFileWebServer release v0.1
Linux Mint Xapp missing library package fix
Comments
References
1
Inno Setup Knowledge Base

https://jrsoftware.org/iskb.php?startup

cached copy
Tags