Archive: Creating shortcuts for downloaded files


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

The folder "$StartMenu\$StartMenuGroup" has to exist before calling CreateShortCut


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

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.

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.