Index: MANIFEST.in
===================================================================
--- MANIFEST.in	(revision 36)
+++ MANIFEST.in	(revision 916)
@@ -1,4 +1,5 @@
 include mlx.nsi
 include makeinst.bat
+include winemakeinst.bat
 include license.txt
 include runmlx.py
Index: docker/build-mlxwinebuild.sh
===================================================================
--- docker/build-mlxwinebuild.sh	(revision 916)
+++ docker/build-mlxwinebuild.sh	(revision 916)
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -e -u
+
+sdistfile="${1}"
+sdistdir=$(cd $(dirname "${sdistfile}") && pwd)
+
+docker run --rm -v "${sdistdir}:/root/dist" mlxwinebuild build $(basename "${sdistfile}") $(id -u) $(id -g)
+#docker run -it --rm -v "${sdistdir}:/root/dist" mlxwinebuild bash
Index: docker/context/Dockerfile
===================================================================
--- docker/context/Dockerfile	(revision 916)
+++ docker/context/Dockerfile	(revision 916)
@@ -0,0 +1,17 @@
+FROM ubuntu:cosmic
+
+RUN dpkg --add-architecture i386 && \
+    apt-get update -y && \
+    /usr/bin/env DEBIAN_FRONTEND=noninteractive apt-get install -y \
+        tzdata \
+        wget \
+        wine \
+        wine32 && \
+    echo "Europe/Budapest" > /etc/timezone && \
+    rm -f /etc/localtime && \
+    dpkg-reconfigure -f noninteractive tzdata
+
+ADD entrypoint.sh setup.sh build.sh /root/
+
+ENTRYPOINT ["/root/entrypoint.sh"]
+CMD ["bash"]
Index: docker/context/build.sh
===================================================================
--- docker/context/build.sh	(revision 916)
+++ docker/context/build.sh	(revision 916)
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+set -e -u
+
+scriptdir=$(cd $(dirname $0) && pwd)
+
+sdistname="${1}"
+uid="${2}"
+gid="${3}"
+
+mlxdirname=$(basename "${sdistname}" .tar.gz)
+version=$(echo "${mlxdirname}" | sed "s:mlx-::")
+
+cd "${scriptdir}"
+
+tar xf "dist/${sdistname}"
+
+cd "${mlxdirname}"
+
+echo "winemakeinst.bat" | wine cmd
+
+echo
+echo "Copying the 'dist' directory..."
+destdistdir="../dist/dist-${version}"
+
+rm -rf "${destdistdir}"
+cp -a dist "${destdistdir}"
+chown -R ${uid}:${gid} "${destdistdir}"
+
+echo
+echo "Copying the setup program..."
+
+cp "MAVA Logger X-${version}-Setup.exe" ../dist
+chown ${uid}:${gid} "../dist/MAVA Logger X-${version}-Setup.exe"
+
+echo
+echo "Done."
Index: docker/context/entrypoint.sh
===================================================================
--- docker/context/entrypoint.sh	(revision 916)
+++ docker/context/entrypoint.sh	(revision 916)
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+scriptdir=$(cd $(dirname $0) && pwd)
+
+if test "$1" = "initialize"; then
+    "${scriptdir}/setup.sh"
+elif test "$1" = "build"; then
+    shift
+    "${scriptdir}/build.sh" "$@"
+else
+    exec "$@"
+fi
Index: docker/context/setup.sh
===================================================================
--- docker/context/setup.sh	(revision 916)
+++ docker/context/setup.sh	(revision 916)
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+set -e -u
+
+cdrive="${HOME}/.wine/drive_c"
+ctmpdir="${cdrive}/tmp"
+cpythondir="${cdrive}/Python27"
+cwinsysdir="${cdrive}/windows/system32"
+
+if test -f "${cpythondir}/python.exe"; then
+    echo "Image already configured, not doing anything!"
+    exit 1
+fi
+
+echo "Preparing image to be able to build MAVA Logger X for Windows"
+echo
+
+echo "Downloading and extracting the extra packages..."
+
+wget -O - mlx.varadiistvan.hu/update/winepkgs.tar | tar xf -
+
+echo
+echo "Installing extra packages..."
+
+export WINEARCH=win32
+
+echo "exit" | wine cmd
+wine msiexec /i python-2.7.2.msi
+wine msiexec /i cefpython3-31.2.py2.7-win32.msi
+wine msiexec /i pygtk-all-in-one-2.24.1.win32-py2.7.msi
+wine msiexec /i pyuipc-0.4.win32-py2.7.msi
+wine msiexec /i xplra-0.2.win32.msi
+
+wine pywin32-217.win32-py2.7.exe
+wine py2exe-0.6.9.win32-py2.7.exe
+wine nsis-2.46-setup.exe
+
+mkdir "${ctmpdir}"
+cp chromedriver.exe "${ctmpdir}"
+
+tar xzf Python27.extra.tar.gz -C "${cpythondir}"
+
+touch -d "2015-02-22 14:50:07" "${cpythondir}/Lib/site-packages/win32/lib/win32con.py"
+touch -d "2015-02-22 14:50:07" "${cpythondir}/Lib/site-packages/win32/lib/winerror.py"
+
+cp python27.dll WINHTTP.dll "${cwinsysdir}"
+
+echo
+echo "Removing extra packages..."
+rm -f *.msi *.exe Python27.extra.tar.gz python27.dll WINHTTP.dll
+echo
+echo "Done."
Index: docker/initialize-mlxwinebuild.sh
===================================================================
--- docker/initialize-mlxwinebuild.sh	(revision 916)
+++ docker/initialize-mlxwinebuild.sh	(revision 916)
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -e -u
+
+scriptdir=`dirname $0`
+scriptdir=`cd "${scriptdir}" && pwd`
+
+docker build -t mlxwinebuild-base "${scriptdir}/context"
+
+if test -z "${XAUTHORITY:-}"; then
+    XAUTHORITY="${HOME}/.Xauthority"
+fi
+
+docker run -it --name mlxwinebuildinit -v /tmp/.X11-unix:/tmp/.X11-unix -v "${XAUTHORITY}":/root/.Xauthority -v /usr/lib/x86_64-linux-gnu/vdpau:/usr/lib/x86_64-linux-gnu/vdpau --device /dev/nvidiactl --device /dev/nvidia0 --security-opt=apparmor:unconfined  --env DISPLAY mlxwinebuild-base initialize
+
+echo "Committing new image..."
+
+docker commit --change='CMD ["bash"]' mlxwinebuildinit mlxwinebuild
+
+echo "Removing container..."
+docker rm mlxwinebuildinit
+
+echo "Done."
Index: setup.py
===================================================================
--- setup.py	(revision 875)
+++ setup.py	(revision 916)
@@ -63,4 +63,40 @@
                            glob(os.path.join(cefDir, "locales", "*"))))
 
+    if os.getenv("WINE")=="yes":
+        winsysdir=os.getenv("WINSYSDIR")
+        data_files.append(("", [os.path.join(winsysdir, "python27.dll")]))
+        data_files.append(("library", [
+                            os.path.join(winsysdir, "pywintypes27.dll"),
+                            os.path.join(winsysdir, "WINHTTP.dll")]))
+
+        if gtkRuntimeDir:
+            gtkBinDir = os.path.join(gtkRuntimeDir, "bin")
+            data_files.append(("library", [
+                                os.path.join(gtkBinDir, "freetype6.dll"),
+                                os.path.join(gtkBinDir, "intl.dll"),
+                                os.path.join(gtkBinDir, "zlib1.dll"),
+                                os.path.join(gtkBinDir, "libglib-2.0-0.dll"),
+                                os.path.join(gtkBinDir, "libatk-1.0-0.dll"),
+                                os.path.join(gtkBinDir, "libcairo-2.dll"),
+                                os.path.join(gtkBinDir, "libexpat-1.dll"),
+                                os.path.join(gtkBinDir, "libpangowin32-1.0-0.dll"),
+                                os.path.join(gtkBinDir, "libgio-2.0-0.dll"),
+                                os.path.join(gtkBinDir, "libgdk-win32-2.0-0.dll"),
+                                os.path.join(gtkBinDir, "libpng14-14.dll"),
+                                os.path.join(gtkBinDir, "libgobject-2.0-0.dll"),
+                                os.path.join(gtkBinDir, "libgdk_pixbuf-2.0-0.dll"),
+                                os.path.join(gtkBinDir, "libfontconfig-1.dll"),
+                                os.path.join(gtkBinDir, "libpangoft2-1.0-0.dll"),
+                                os.path.join(gtkBinDir, "libgmodule-2.0-0.dll"),
+                                os.path.join(gtkBinDir, "libpango-1.0-0.dll"),
+                                os.path.join(gtkBinDir, "libpangocairo-1.0-0.dll"),
+                                os.path.join(gtkBinDir, "libgtk-win32-2.0-0.dll"),
+                                os.path.join(gtkBinDir, "libgthread-2.0-0.dll")
+                              ]))
+        if cefDir:
+            data_files.append(("library", [
+                                os.path.join(cefDir, "libcef.dll")
+                              ]))
+
     print data_files
 
Index: winemakeinst.bat
===================================================================
--- winemakeinst.bat	(revision 916)
+++ winemakeinst.bat	(revision 916)
@@ -0,0 +1,10 @@
+set MSVCRDIR=c:\windows\winsxs\x86_Microsoft.VC90.CRT*9.0.21022.8*
+set GTKRTDIR=c:\Python27\Lib\site-packages\gtk-2.0\runtime
+set CEFDIR=c:\Python27\Lib\site-packages\cefpython3
+set CHROMEDRIVER=c:\tmp\chromedriver.exe
+set NSISDIR=C:\Program Files\NSIS
+set WINE=yes
+
+C:\Python27\python.exe setup.py py2exe
+
+"%NSISDIR%\makensis" mlx.nsi
