Search code examples
pythoncx-freeze

Adding start menu shortcuts with cx_Freeze installer for Python


Having made and tested my .msi installer using cx_freeze, it all works except for one vital part from the point of view of the end user: no start menu or desktop shortcut can be created by ticking a checkbox during the installer and neither of these actions seem to be happening by default.

However, having trawled mail archives and suchlike, I've found it should in fact create a start menu shortcut by default.

Does anyone know if there's something I can add to my setup.py or whatever to make this work? I'm not sure if this is happening just on my PC, so it would help if you could test if the installer makes a shortcut for you. You can test the installer here.


Solution

  • In your setup script, add "shortcutDir" keyword with required parameter. The parameter could be DesktopFolder or StartupFolder. "shortcutName" keyword could also be used to provide the name to the shortcut.

    The following links could also be used as references to further help you to resolve your problem: Use cx-freeze to create an msi that adds a shortcut to the desktop

    https://github.com/anthony-tuininga/cx_Freeze/issues/48