Page 1 of 1

How to add programs to the Startup folder

Posted: Fri Aug 31, 2007 2:13 am
by MortSkil
I want to add one or more of the applications installed with my installer to start automatically when the user logs on.
One alternative is to add to the startup folder, which was easily available in Wise for Windows Installer. I am not able to find that target in IA, though. Rumours say that the eyes are the first to suffer from blindness :?
There is also a possibility to add to the HKCU\\Software\\microsoft\\Windows\\CurrentVersion\\Run.
What is the recommended way to achieve this?

Posted: Fri Aug 31, 2007 10:40 am
by Alex_Ronquillo
Here is my recommendation:

In the MSI code, find the following lines of code:

Code: Select all

if Variable ALLUSERS Equals TRUE
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILESALL$\\$STARTMENU$
else
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILES$\\$STARTMENU$
end
change that code for the following code that contains two more lines:

Code: Select all

if Variable ALLUSERS Equals TRUE
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILESALL$\\$STARTMENU$
  Get Common Folder Location Start Menu->Startup Group into STARTUPDIR
else
  Set Variable SHORTCUTFOLDER to $SHORTCUTFILES$\\$STARTMENU$
  Get Folder Location Start Menu->Startup Group into STARTUPDIR
end
After that, use the "Create Shortcut" command with $STARTUPDIR$ as "Link Location"

I hope that was helpful

Posted: Wed Sep 05, 2007 6:48 am
by MortSkil
Thank you! It is helpful, provided that I want to use the Startup folder.

However, I do this writing an entry into registry for those applications I want to start automatically.

Controlled by Feature, I put values for each application into HKCU\\Software\\Microsoft\\CurrentVersion\\Run.

Value name: <title>
Value data: $TARGETDIR$\\app.exe

This also works fine.