Search code examples
pythontkinterpyinstallerexewine

How to build exe file from python script for all Windows Version like: Xp,7,8,10


I build exe file using pyinstaller in windows 10 64bit os. but when i test on windows7 64bit os then is not working. that shows dll file error.

so, I understated when the os is change then need to rebuilt exe file with that same system. am I Right ?

pyinstaller --onefile -w --icon=pp-logo.ico WCS_Config_App.py --hiddenimport=pyserial --hiddenimport=numpy

this above way i create exe file.

So, I want to build exe file(standalone) execute for all windows system.

Thank you for your time.


Solution

  • You can surelly build an app for all windows versions but compiling can be really tricky especially with big apps.The main considerations to take is:

    1. Python version.Not all versions of windows are capable of running all versions of python so for example since you want an XP compatibility too you will need to build your app with python3 version <= 3.4.3.
    2. x32 or x64 must be taken as consideration , as if you build an app with x64 python will only run with x64 operating systems.
    3. DLL for windows is required(probably this is your current problem) and you will need to include the VC REDISTs required for each type of os(windows XP,7,10).You can accomplish this prety easy with an installer like inno-setup.