How to Add a Desktop Shortcut Option on Finish Page in NSIS installer?

takoloco picture takoloco · Oct 4, 2009 · Viewed 23.1k times · Source

I'm trying to create an installer using NSIS Modern User Interface for the first time. I would like to know how I can add an option (checkbox) for users to select to have a desktop shortcut created on the Finish Page (the last screen of the installer) in addition to the "Run XXXX" option that's already there.

Answer

Anders picture Anders · Oct 5, 2009

If you are not using readme checkbox on the finish page, you can use it to perform whatever action you want:

Function finishpageaction
CreateShortcut "$desktop\foo.lnk" "$instdir\foo.exe"
FunctionEnd

!define MUI_FINISHPAGE_SHOWREADME ""
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop Shortcut"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION finishpageaction