diff --git a/PyInstaller/building/api.py b/PyInstaller/building/api.py index aa1d1876978..6843f362332 100644 --- a/PyInstaller/building/api.py +++ b/PyInstaller/building/api.py @@ -628,6 +628,7 @@ def __init__(self, *args, **kws): from ..config import CONF Target.__init__(self) self.strip_binaries = kws.get('strip', False) + self.console = True if CONF['hasUPX']: self.upx_binaries = kws.get('upx', False) @@ -650,6 +651,7 @@ def __init__(self, *args, **kws): elif isinstance(arg, Target): self.toc.append((os.path.basename(arg.name), arg.name, arg.typ)) if isinstance(arg, EXE): + self.console = arg.console for tocnm, fnm, typ in arg.toc: if tocnm == os.path.basename(arg.name) + ".manifest": self.toc.append((tocnm, fnm, typ)) diff --git a/PyInstaller/building/osx.py b/PyInstaller/building/osx.py index 4dec9925426..e1614dc16a8 100644 --- a/PyInstaller/building/osx.py +++ b/PyInstaller/building/osx.py @@ -46,6 +46,7 @@ def __init__(self, *args, **kws): self.toc = TOC() self.strip = False self.upx = False + self.console = True # .app bundle identifier for Code Signing self.bundle_identifier = kws.get('bundle_identifier') @@ -61,6 +62,7 @@ def __init__(self, *args, **kws): self.toc.extend(arg.dependencies) self.strip = arg.strip self.upx = arg.upx + self.console = arg.console elif isinstance(arg, TOC): self.toc.extend(arg) # TOC doesn't have a strip or upx attribute, so there is no way for us to @@ -69,6 +71,7 @@ def __init__(self, *args, **kws): self.toc.extend(arg.toc) self.strip = arg.strip_binaries self.upx = arg.upx_binaries + self.console = arg.console else: logger.info("unsupported entry %s", arg.__class__.__name__) # Now, find values for app filepath (name), app name (appname), and name @@ -137,20 +140,16 @@ def assemble(self): "CFBundlePackageType": "APPL", "CFBundleShortVersionString": self.version, - # Setting this to 1 will cause Mac OS X *not* to show - # a dock icon for the PyInstaller process which - # decompresses the real executable's contents. As a - # side effect, the main application doesn't get one - # as well, but at startup time the loader will take - # care of transforming the process type. - "LSBackgroundOnly": False, - } # Merge info_plist settings from spec file if isinstance(self.info_plist, dict) and self.info_plist: info_plist_dict.update(self.info_plist) + # Setting EXE console=True implicitely sets LSBackgroundOnly to True + if self.console: + info_plist_dict['LSBackgroundOnly'] = True + plist_filename = os.path.join(self.name, "Contents", "Info.plist") try: # python >= 3.4