Create Shortcut behavior

Got a problem you cannot solve? Try here.
Post Reply
dawidp
Posts: 31
Joined: Wed Jan 14, 2009 5:45 pm

Create Shortcut behavior

Post by dawidp »

I'm trying to add my application's shortcut to the user's startup folder when the application is installed for all users.

I'm using Get Folder command: Start Menu -> Startup Group to retrieve the current user's startup folder. This is returned correctly, when checked via a MessageBox

Whenever I use Create Shortcut using that location, the shortcut is placed in the 'all users' startup folder. It seems that the installer overrides the specified location. Is this a bug?

Thanks
Dawid
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

I seem to recall that if you are doing an All Users installation, Windows Installer (not InstallAware) did forcibly override some paths. Log the installation to double-check.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
dawidp
Posts: 31
Joined: Wed Jan 14, 2009 5:45 pm

Post by dawidp »

Michael,
I'm not exactly sure where to look, but these two lines look odd:

Code: Select all

SHELL32::SHGetFolderPath returned: C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup
Executing op: ShortcutCreate(Name=MyApp~1|My Application,,,FileName=C:\\Program Files\\My Application\\My Application.exe,,,,IconIndex=0,HotKey=0,ShowCmd=1,,,,,)
According to this, the shortcut is created in the wrong place by WindowsInstaller.

Is there a workaround for this?
Dawid
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Afraid not, as you can see Windows Installer is forcibly overriding.

But if you set the $ALLUSERS$ variable appropriately, you can work around this issue.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply