#!/usr/bin/python import os import os.path import shutil import sys import stat # Variables ---------------------------- # TODO consolidate version string for all builds. VERSION = "0.0.1" APP_NAME = "RiseupVPN" BUNDLE_IDENTIFIER = "se.leap.riseupvpn" ENTRYPOINT = "bitmask-systray" # Do not edit below -------------------- here = os.path.split(os.path.abspath(__file__))[0] APP_PATH = os.path.abspath(here + '/../dist/' + APP_NAME + ".app") STAGING = os.path.abspath(here + '/../staging/') os.makedirs(APP_PATH + "/Contents/MacOS", exist_ok=True) f = open(APP_PATH + "/Contents/Info.plist", "w") f.write(""" CFBundleDevelopmentRegion English CFBundleExecutable %s CFBundleGetInfoString %s CFBundleIconFile app.icns CFBundleIdentifier %s CFBundleInfoDictionaryVersion 6.0 CFBundleName %s CFBundlePackageType APPL CFBundleShortVersionString %s CFBundleSignature ???? CFBundleVersion %s NSAppleScriptEnabled YES NSMainNibFile MainMenu NSPrincipalClass NSApplication """ % ( ENTRYPOINT, APP_NAME + " " + VERSION, BUNDLE_IDENTIFIER, APP_NAME, APP_NAME + " " + VERSION, VERSION)) f.close() f = open(APP_PATH + "/Contents/PkgInfo", "w") f.write("APPL????") f.close() entrypoint_file = APP_PATH + "/Contents/MacOS/" + ENTRYPOINT shutil.copyfile(STAGING + '/' + ENTRYPOINT, entrypoint_file) oldmode = os.stat(entrypoint_file).st_mode os.chmod(entrypoint_file, oldmode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)