Archive: Ask for Shortcut on Desktop


Ask for Shortcut on Desktop
Hello,
I am writing a script, I want that the user can choose if he want to make a shortcut on desktop.

This is my script:

!insertmacro MUI_STARTMENU_WRITE_BEGIN Application

;Create shortcuts
CreateDirectory "$SMPROGRAMS\Dir"
CreateShortCut "$SMPROGRAMS\TaxiDatabase.lnk" "$INSTDIR\myfile.exe"

!insertmacro MUI_STARTMENU_WRITE_END

SectionEnd


!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Create desktop shortcut"
!define MUI_FINISHPAGE_RUN_FUNCTION "shortcut"

Function shortcut
CreateShortCut "$DESKTOP\myfile.lnk" "$INSTDIR\myfile"
FunctionEnd


Does this script work?


Function shortcut
MessageBox MB_YESNO "Want a shortcut on your desktop?" IDNO +2
CreateShortCut "$DESKTOP\myfile.lnk" "$INSTDIR\myfile"
FunctionEnd