Python Forum
In place of py2exe (for GNU/Linux systems) and MultiOS executables (Yes)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
In place of py2exe (for GNU/Linux systems) and MultiOS executables (Yes)
#1
Windows have py2exe, but no other OSes. Recently, I discovered how to create hybrid Windows 10/Linux scripts. In fact, It's cmd/bash scripts. Way to achieve this is quite simple - create an file with .bat extension and with #!/bin/bash string as first line, but I must dive deeper to make it detects OS and makes many other things. I research this solution to allow run Java programs on Windows (without need to install Java) and to make possibility to install programs on Linux and Windows by single program.

Read:
https://www.phoronix.com/forums/forum/ph...md-scripts
https://forum.freegamedev.net/viewtopic....46&t=11231

After my research I created small hybrid script builder, written in Bash, which archive platform-independent files, windows related files, GNU/Linux related files. Each of this archive is encoded in base64, so we have only text at output.

Script generated by my tool can extract three part of it:
- GNU/Linux program
- Windows program
- Common files (.py files in this case)

How to use this:
1. We need GNU/Linux Python installer to be bundled. This installer will check if Python is installed (in most cases probably yes) and install if it's not. In next step, it will ran our Python program (but firstly it must been extracted)
2. We need Windows installer to be bundled. It will check Python is installed and install it if it's not. In next step, it will ran our Python program (but firstly it must been extracted)
3. Python program (it will been extracted in first step)

In future I will create web repository containing bash script to install Python on many GNU/Linux distributiohs.
Reply
#2
There is also cx_Freeze, which works on any platform which python itself runs on: https://cx-freeze.readthedocs.io/en/latest/
Reply
#3
(Jan-18-2019, 04:29 PM)nilamo Wrote: There is also cx_Freeze, which works on any platform which python itself runs on: https://cx-freeze.readthedocs.io/en/latest/

As I see, cx_Freeze probably generates platform-dependent executable. My solution creates platform-independent executable (in fact, shell script, which could been executed booth by cmd and bash).
Reply
#4
(Jan-18-2019, 03:46 PM)Lachu Wrote: Windows have py2exe
Has stopped develop at Python 3.4,so i would not use it because i use a lot of new Python tools that come after 3.4.

Pyinstaller is probably the best developed tool over the last years,work Python 3.7.
With pyinstaller can build stand alone solution's for Windows and Linux/Mac.
It's not a cross-compiler so need to be build on OS used.
Then can detect OS an use bat/bash as you explain ,or look into installers i have used Inno Setup before for Windows.
This so is it look more professional that just distribute a .exe file.
Or look into cross platform installer creation tool like InstallBuilder 18.
Can also mention Pynsist that us a Windows installers NSIS
Reply
#5
(Jan-18-2019, 06:55 PM)snippsat Wrote:
(Jan-18-2019, 03:46 PM)Lachu Wrote: Windows have py2exe
Has stopped develop at Python 3.4,so i would not use it because i use a lot of new Python tools that come after 3.4.

Pyinstaller is probably the best developed tool over the last years,work Python 3.7.
With pyinstaller can build stand alone solution's for Windows and Linux/Mac.
It's not a cross-compiler so need to be build on OS used.
Then can detect OS an use bat/bash as you explain ,or look into installers i have used Inno Setup before for Windows.
This so is it look more professional that just distribute a .exe file.
Or look into cross platform installer creation tool like InstallBuilder 18.
Can also mention Pynsist that us a Windows installers NSIS

I must say, my English isn't perfect :-( . Do you suggest to suggest work with PyInstaller/InnoSetup/InstallBuilder/Pynsist (my script will detect OS and start one of these programs?) or these programs have similar options/functionality to my solution? I check some of these web pages and didn't found similar options - sorry for asking that, my English isn't perfect. If first option will be true, then I will compare these Installers on Monday and send e-mails with suggestion of work together.
Reply
#6
(Jan-18-2019, 07:07 PM)Lachu Wrote: Do you suggest to suggest work with PyInstaller/InnoSetup/InstallBuilder/Pynsist (my script will detect OS and start one of these programs?)
First i would get stuff to work with pyinstaller,with build on Window and Linux.
Then can look into if detect OS solution work,and eg if detect Window use Inno setup to install.

It's also common to split it up,so have one installer Windows and one for Linux.
This can make it easier.
Like eg VLC you see that they do not try to detect OS platform,but use installer link for give Platform.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  source for py2exe not working after 3.4 metulburr 2 2,471 Feb-28-2019, 01:42 PM
Last Post: metulburr
  is there a better place to talk about pypy here? ezdev 1 2,657 Dec-20-2017, 12:22 PM
Last Post: metulburr
  [Py2Exe] How can i convert py files to exe ? JamieVanCadsand 10 8,336 Sep-29-2017, 06:10 AM
Last Post: Skaperen
  Time complexity different between operating systems. Why? Mekire 2 4,259 Jan-18-2017, 09:29 PM
Last Post: casevh

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020