[clug] Tips for creating portable executables?

Carlo Hamalainen carlo at carlo-hamalainen.net
Wed Dec 18 01:48:05 MST 2013


On 18/12/13 04:48, steve jenkin wrote:
> I've got no idea how to proceed with Winders any-version and building an
> exe for it and testing...
> Can probably boot a Win-XP system with a little effort, though I'd
> prefer to run XP under VBox - a whole other story.

To build for Windows you are basically forced to run a 32bit XP machine
(inside VirtualBox is fine) so that library dependencies are as minimal
as possible.

> There must be multiple people on-list who've got direct experience in
> cross-platform compilation and even preparing binary packages.

Here's a cross platform project that I worked on earlier this year:

https://github.com/CVL-dev/cvl-fabric-launcher

This uses pyinstaller to package it up on Windows, Linux (Debian-like
and CentOS-like), and OSX.

We bundled up our own build of cygwin's OpenSSH binaries, see

https://github.com/CVL-dev/cvl-fabric-launcher/tree/master/openssh-cygwin-stdin-build

and here you can see the somewhat minimal set of DLLs that we had to
include:

https://github.com/CVL-dev/cvl-fabric-launcher/tree/master/openssh-cygwin-stdin-build/bin

Surprisingly this will run on Windows XP, Vista, Windows 7, and even
Windows 8, 32bit and 64bit.

You have to duplicate the bin, etc, tmp directory structure where ever
the package gets installed to, and there are some tricky issues with
file permissions too, because cygwin has its own way of emulating Unix
sockets since Windows doesn't do anything similar.

Also of interest may be the Windows build script, which uses Inno Setup
to build the final installer:

https://github.com/CVL-dev/cvl-fabric-launcher/blob/master/package_windows_version.py


I had the Linux builds for four versions [Debian, CentOS] x [32bit,
64bit] fully automated. I never got around to automating the build
process on Windows, and my colleague on OSX found the build process
somewhat nondeterministic so it wasn't scriptable.

Cross-platform development is hell :-)

-- 
Carlo Hamalainen
http://carlo-hamalainen.net



More information about the linux mailing list