from glob import glob import os import subprocess from string import Template from distutils.core import setup try: from py2exe.build_exe import py2exe except ImportError: from py2exe.distutils_buildexe import py2exe import syncplay from syncplay.messages import getMissingStrings missingStrings = getMissingStrings() if missingStrings is not None and missingStrings is not "": import warnings warnings.warn( "MISSING/UNUSED STRINGS DETECTED:\n{}".format(missingStrings)) def get_nsis_path(): bin_name = "makensis.exe" from winreg import HKEY_LOCAL_MACHINE as HKLM from winreg import KEY_READ, KEY_WOW64_32KEY, OpenKey, QueryValueEx try: nsisreg = OpenKey(HKLM, "Software\\NSIS", 0, KEY_READ | KEY_WOW64_32KEY) if QueryValueEx(nsisreg, "VersionMajor")[0] >= 3:
if (sys.version_info.major != 2) or (sys.version_info.minor < 7): raise Exception("You must build Syncplay with Python 2.7!") except AttributeError: import warnings warnings.warn("You must build Syncplay with Python 2.7!") from distutils.core import setup from py2exe.build_exe import py2exe from string import Template import syncplay import os import subprocess from syncplay.messages import getMissingStrings missingStrings = getMissingStrings() if missingStrings is not None and missingStrings is not "": import warnings warnings.warn("MISSING/UNUSED STRINGS DETECTED:\n{}".format(missingStrings)) p = "C:\\Program Files (x86)\\NSIS\\Unicode\\makensis.exe" #TODO: how to move that into proper place, huh NSIS_COMPILE = p if os.path.isfile(p) else "makensis.exe" OUT_DIR = "syncplay v{}".format(syncplay.version) SETUP_SCRIPT_PATH = "syncplay_setup.nsi" NSIS_SCRIPT_TEMPLATE = r""" !include LogicLib.nsh !include nsDialogs.nsh !include FileFunc.nsh LoadLanguageFile "$${NSISDIR}\Contrib\Language files\English.nlf" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Polish.nlf"