How to make an installer the way it creates an icon on desktop?

846 views Asked by At

I've got ready, already compiled python application for windows but there is a problem with making an installer, which creates desktop icon for it when you check a corresponding mark.

I made an installer using clean NSIS script, fbs and pynsist. Actually, there is no problem to create an installer which downloads your app to Program Files but however I haven't found the way to create an icon which will be shown on desktop.

Any help is appreciated.

1

There are 1 answers

5
Anders On BEST ANSWER

Pynsist does not seem to have a way to inject extra code for some reason but you can override the entire install script.

Make a copy of your pyapp.nsi file (or grab it from Github).

There are two places in the file where it does CreateShortCut "$SMPROGRAMS\..... Add another line under it with:

CreateShortcut "$DESKTOP\[[scname]].lnk" "[[sc['target'] ]]" '[[ sc['parameters'] ]]' "$INSTDIR\[[ sc['icon'] ]]"

And finally, in your installer.cfg file, add/set

[Build]
nsi_template=c:\my_custom_pyapp.nsi