PDA

View Full Version : Shortcut problem


hannes
13th October 2004, 23:10
Hi,

I have a wierd problem with creating shortcuts,
for some reason, when I run the installation using 'Run As' local administrator (which I have to do because it needs administrator permissions on certain parts), the shortcut I place on the desktop, the target gets screwed up.

The target should read: "R:\Hill Labs Cube Viewer\Cube Viewer.exe" and when it is run as the normal logged in user, this is what it is. (to test this i commented out the code that required admin permissions).
But when I run as administrator, the target is R:\Hill_Lab\Cube_Vie.exe

Why would running as do this?

Here is the part of the script that creates the shortcut:


DetailPrint "Creating Shortcut"
SetShellVarContext All
SetOutPath "R:\Hill Labs Cube Viewer"
CreateShortCut "$DESKTOP\Hill Labs Cube Viewer.lnk" '"R:\Hill Labs Cube Viewer\Cube Viewer.exe"' "" "" "" "" "" "Open to view hill labs cube files"
AccessControl::GrantOnFile "$DESKTOP\Hill Labs Cube Viewer.lnk" "Everyone" "FullAccess"


Any help on this would be much appreciated.

Hannes.

kichik
13th October 2004, 23:18
Remove the extra quotes.

hannes
13th October 2004, 23:22
Removing the single quotes makes no difference to the outcome.

kichik
13th October 2004, 23:42
Are you sure R: exists for the administrator? It's probably the same problem as this one (http://forums.winamp.com/showthread.php?s=&threadid=85878&highlight=createsh%2A).

hannes
13th October 2004, 23:50
Ok, that would be the problem, It doesn't exist for administrator. so nsis doesn't create the shortcut, windows does?
How can I workaround this problem? I don't want to map a drive, is that even possible when using 'Run As'?

Thanks for your fast replies

kichik
14th October 2004, 00:23
A simple workaround would be using \\server\share instead of the map.

hannes
14th October 2004, 00:51
Of course!

thanks for that, works perfect!

:)