Python files to an MSI Windows installer

风流意气都作罢 提交于 2020-05-29 04:07:29

问题


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).


回答1:


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.




回答2:


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.

  • Inno website: https://www.jrsoftware.org/isinfo.php

  • A tutorial on how to use it on youtube: https://www.youtube.com/watch?v=DTQ-atboQiI



来源:https://stackoverflow.com/questions/50879667/python-files-to-an-msi-windows-installer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!