From 8fa1bba1e4aa7ed649459eae9d3bedb47da2129b Mon Sep 17 00:00:00 2001 From: cidoku Date: Fri, 20 Jun 2025 23:04:59 -0400 Subject: [PATCH] add py2exe setup and update readme with latest build --- README.md | 3 +++ setup.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 setup.py diff --git a/README.md b/README.md index 0f11911..379e91c 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,6 @@ Features added since the last commit of [Headshot's AO2XP](https://github.com/he - MIDI music support (needs a soundfount file named `gm.sf2` in the root AO2XP directory) - Module music support (MOD, XM, IT, S3M) - Unicode support everywhere + +## Download pre-built +You may find the most recent pre-compiled build of AO2XP for Windows [on my site](https://cidoku.net/files/software/AO2XP-Windows.zip). \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..b1b9cd5 --- /dev/null +++ b/setup.py @@ -0,0 +1,54 @@ +from distutils.core import setup +import py2exe +import sys +import os +import glob +import certifi + +sys.argv.append('py2exe') + +data_files = [ + ( '', ['bass.dll', 'bassflac.dll', 'bassmidi.dll', 'bassopus.dll', "mod_call.wav", "word_call.wav", "placeholder.png", "AO2XP.ico", "AO2XP_console.ico"]), + ('certifi', [certifi.where()]), + ('imageformats',[ + 'C:\\Python27/Lib/site-packages/PyQt4/plugins/imageformats/qgif4.dll', + 'C:\\Python27/Lib/site-packages/PyQt4/plugins/imageformats/qico4.dll' + ]) +] + +includes = [ + 'sip', + 'PyQt4.QtCore', 'PyQt4.QtGui', + 'requests', 'urllib3', + 'chardet', 'idna', 'certifi', + 'email', 'email.errors', 'email.message', 'email.utils', +] + +packages = [] +excludes = ['Tkinter', 'doctest', 'unittest', 'pdb', 'bz2'] + +setup( + windows=[{ + 'script': "AO2XP.py", + 'icon_resources': [(1, "AO2XP.ico")], + 'target_name': "AO2XP.exe" + }], + # console=[{ + # 'script': "AO2XP.py", + # 'icon_resources': [(1, "AO2XP_console.ico")], + # 'target_name': "AO2XP_console.exe" + # }], + options={ + 'py2exe': { + 'includes': includes, + 'excludes': excludes, + 'packages': packages, + 'compressed': True, + 'optimize': 2, + 'bundle_files': 3, + 'dll_excludes': ['MSVCP90.dll'], + } + }, + data_files=data_files, + zipfile=None, +) \ No newline at end of file