ti84p
8th September 2009 01:43 UTC
Creating shortcuts for downloaded files
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 02:00 UTC
The folder "$StartMenu\$StartMenuGroup" has to exist before calling CreateShortCut
ti84p
10th September 2009 00:12 UTC
Quote:
Thank you. That was it.
Now I just have to get my scheduled task to create...
Originally posted by Anders
The folder "$StartMenu\$StartMenuGroup" has to exist before calling CreateShortCut
|
demiller9
10th September 2009 00:33 UTC
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 12:08 UTC
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.