How to add programs to the Startup folder

Got a problem you cannot solve? Try here.
MortSkil
Posts: 59
Joined: Mon Oct 30, 2006 3:27 am
Location: Trondheim, Norway

How to add programs to the Startup folder

Postby MortSkil » Fri Aug 31, 2007 2:13 am

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?

Alex_Ronquillo
Site Admin
Posts: 364
Joined: Mon Jul 30, 2007 11:51 am
Location: USA
Contact:

Postby Alex_Ronquillo » Fri Aug 31, 2007 10:40 am

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
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

MortSkil
Posts: 59
Joined: Mon Oct 30, 2006 3:27 am
Location: Trondheim, Norway

Postby MortSkil » Wed Sep 05, 2007 6:48 am

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.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 130 guests