summaryrefslogtreecommitdiff
path: root/manual tests/4 standalone binaries/build_windows_package.py
diff options
context:
space:
mode:
Diffstat (limited to 'manual tests/4 standalone binaries/build_windows_package.py')
-rw-r--r--manual tests/4 standalone binaries/build_windows_package.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/manual tests/4 standalone binaries/build_windows_package.py b/manual tests/4 standalone binaries/build_windows_package.py
new file mode 100644
index 000000000..c676113f3
--- /dev/null
+++ b/manual tests/4 standalone binaries/build_windows_package.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+import os, urllib.request, shutil, subprocess
+from glob import glob
+
+sdl_url = 'http://libsdl.org/release/SDL2-devel-2.0.3-VC.zip'
+sdl_filename = 'SDL2-devel-2.0.3-VC.zip'
+sdl_dir = 'SDL2-2.0.3'
+
+shutil.rmtree('build', ignore_errors=True)
+os.mkdir('build')
+
+if not os.path.exists(sdl_filename):
+ response = urllib.request.urlopen(sdl_url)
+ data = response.read()
+ open(sdl_filename, 'wb').write(data)
+
+shutil.unpack_archive(sdl_filename, 'build')
+
+libs = glob(os.path.join('build', sdl_dir, 'lib/x86/*'))
+[shutil.copy(x, 'build') for x in libs]
+
+# Sorry for this hack but this needs to work during development
+# when Meson is not in path.
+subprocess.check_call(['python3', r'..\..\meson.py', 'build',
+ '--backend=ninja', '--buildtype=release'])
+subprocess.check_call(['ninja'], cwd='build')
+shutil.copy('myapp.iss', 'build')
+subprocess.check_call([r'\Program Files\Inno Setup 5\ISCC.exe', 'myapp.iss'],
+ cwd = 'build')
+shutil.copy('build/setup.exe', 'myapp 1.0.exe')
+shutil.rmtree('build')