PDA

View Full Version : Creating shortcuts for downloaded files


ti84p
8th September 2009, 00:43
I am working on an installer that downloads a zip, extracts it, then creates shortcuts for every exe in the zip. I have successfully downloaded and extracted the zip, but can't get it to create the shortcuts. Below is my code so far.



${Locate} "$INSTDIR" "/L=F /M=*.exe" "CreateShortcuts"



Function "CreateShortcuts"
CreateShortCut "$StartMenu\$StartMenuGroup\$R7.lnk" "$R9"
Push ""
FunctionEnd

Anders
8th September 2009, 01:00
The folder "$StartMenu\$StartMenuGroup" has to exist before calling CreateShortCut

ti84p
9th September 2009, 23:12
Originally posted by Anders
The folder "$StartMenu\$StartMenuGroup" has to exist before calling CreateShortCut


Thank you. That was it.


Now I just have to get my scheduled task to create...

demiller9
9th September 2009, 23:33
Why not just use the CreateDirectory command?Function "CreateShortcuts"
CreateDirectory "$StartMenu\$StartMenuGroup"
CreateShortCut "$StartMenu\$StartMenuGroup\$R7.lnk" "$R9"
Push ""
FunctionEnd

SetOutPath will also create a directory for you.

MSG
10th September 2009, 11:08
Note that SetOutPath also sets the working directory (aka starting directory) for the shortcut you're creating. You probably want to SetOutPath $INSTDIR (or whatever starting directory you want) before you call CreateShortcut.