|
|
#1 | |
|
Junior Member
Join Date: Apr 2008
Posts: 6
|
CreateShortcut / Working Directory Problem
Hi there,
I've having problems trying to amend the Working Directory to be the $INSTDIR for the Start Menu Shortcuts I create. I'm using SetOutPath $INSTDIR successfully for the Desktop Shortcut I create ok, but for the Start Menu Short Cuts the Installer either: a) fails to create the Shortcut (if I remove the SetOutPath command from the CREATE_SMGROUP_SHORTCUT macro, or change it to $INSTDIR), or b) sets the working directory to be the Start Menu Group rather than the INSTDIR (if I leave the SetOutPath $SMPROGRAMS\$StartMenuGroup alone) Here are the relevant sections of my script: Quote:
I'd be grateful for suggestions. Thanks. |
|
|
|
|
|
|
#2 | ||
|
Junior Member
Join Date: Nov 2008
Posts: 2
|
I'm facing the same exact problem and would like to know what is the solution.
Here is my related section : Quote:
Quote:
Last edited by Kel Solaar; 1st November 2008 at 13:55. |
||
|
|
|
|
|
#3 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Why not do:
SetOutPath $SMPROGRAMS\$StartMenuGroup SetOutPath $INSTDIR CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\$(^Name).exe CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\Uninstall.exe Stu |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Nov 2008
Posts: 2
|
It's working like a charm !
Btw I don't really understand the code tbh and why it's working this alone : SetOutPath $INSTDIR don't work but this : SetOutPath $SMPROGRAMS\$StartMenuGroup SetOutPath $INSTDIR is working, why ? |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You need to create the directory before creating the shortcut in it. SetOutPath recursively creates the directories as well as sets the working directory to it.
Stu |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Apr 2008
Posts: 6
|
Afrow UK - brilliant - that 100% resolved the problem - thanks very much!
|
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
|
Instead of changing the OutPath two times, you could simply do:
code: My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc My source of inspiration: http://youtu.be/lCwY4_0W1YI |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|