Python files to an MSI Windows installer
Asked Answered
B

3

13

So I can use PyInstaller to make a one-file executable and to make a standard executable among other files in a folder.

But how do I turn Python files into an MSI installer so that it's fool-proof where it makes a shortcut on the desktop? (For distribution so that it isn't required for the user to have Python installed)

(When I say Python files to an MSI installer I mean the regular PyInstaller to folder output but with a way of getting a shortcut to the executable onto the desktop very easily for a regular user) (It doesn't have to be PyInstaller if there's an alternative).

Briscoe answered 15/6, 2018 at 16:38 Comment(2)
Isn't this a duplicate of #37219545Quahog
I'm trying to do it as an executable. So that it doesn't require Python to be installed. I'm not asking how to make a shortcut, I'm asking how to turn Python files into an installer that can be launched by anyone + It should create a shortcut on the desktop automatically.Briscoe
F
7

Pyinstaller does not intergrate such a tool.

You could get a third party installer (some suggested here How to create a robust, minimal installer for Windows?) and add your output exe to it and install that way, if you choose the right tool you will be able to add to desktop (plus a lot of other actions such as adding to path ect).

Or you could use cx_Freeze which has it built in. When running the setup script just add the bdist_msi flag.

It can add to shortcut desktop but is fairly limited in other ways (or you may need to perform some hack).

To add to desktop with cx_Freeze see Use cx-freeze to create an msi that adds a shortcut to the desktop.

Finery answered 15/6, 2018 at 17:41 Comment(2)
cx_freeze is just bad. I've been tinkering with it for a decade, lack of documentation and many unanswered questions here on StackOverflow. i suggest you do not plan anything serious like big project relay on itPepin
@AbdullahSaid I honestly have used it a ton. Whenever I need to convert Python I use CX_Freeze. Then again I know the Python file system extremely well, so I can tinker around with the setup script until it's working. My main reason for using it, is that it's maintained. Unlike most of the alternativesFinery
E
4

You can use Inno which creates a shortcut on the desktop and start menu. Also, it is located in the program directory of windows. it means that you can install/uninstall it like other programs or applications.

Edy answered 11/2, 2020 at 16:22 Comment(0)
L
0

I would recommend you to use Inno Setup. It's a simple and robust tool that can make your portable exe file into a Windows Installer setup file.

Very simple to use and has a lot of features, like the option to automatically create desktop shortcuts, paths, folders, etc.

Here is an example, on my GitHub with detailed documentation from Python script to EXE to Windows installer file.

-> My Github Example

Luminescence answered 25/3, 2024 at 22:20 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.