Skip to content

Commit

Permalink
Patched attempt to code sign exe wrapper which is generated at instal…
Browse files Browse the repository at this point in the history
…l time (displaying warning in the log for these contexts). Patched internal package merge function, which had a bad code sign target attribute name.
  • Loading branch information
BuvinJ committed Feb 17, 2021
1 parent 38d2ed1 commit cfafac0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions distbuilder/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def qtIfwPackage( self, pyInstConfig=None, isTempSrc=False ):
pkg.isGui = self.isGui

pkg.exeWrapper = self.pkgExeWrapper
if( IS_WINDOWS and
if( IS_WINDOWS and # On the fly, installer generated exe is only currently supported on Windows!
isinstance( pkg.exeWrapper, QtIfwExeWrapper ) and
pkg.exeWrapper.isExe ):
w = pkg.exeWrapper
Expand Down Expand Up @@ -275,8 +275,11 @@ def qtIfwPackage( self, pyInstConfig=None, isTempSrc=False ):
if( isinstance( pkg.exeWrapper, QtIfwExeWrapper ) and
pkg.exeWrapper.isExe ):
exeName = pkg.exeWrapper.wrapperExeName
try: self.pkgCodeSignTargets.append( exeName )
except: self.pkgCodeSignTargets=[ exeName ]
printErr( "WARNING: %s will be generated at install time and "
"therefore cannot be code signed (as your private "
"key would be be required in the distribution)!" %
(exeName,),
isFatal=False)
pkg.codeSignTargets = self.pkgCodeSignTargets

pkg.qtCppConfig = self.qtCppConfig
Expand Down Expand Up @@ -613,7 +616,7 @@ def _body( self ):
for pkg in self.ifwPackages:
if pkg.codeSignTargets:
for relPath in pkg.codeSignTargets:
exePath = absPath( relPath, pkg.contentDirPath )
exePath = absPath( relPath, pkg.contentDirPath() )
signExe( exePath, self.configFactory.codeSignConfig )

self.setupPath = _buildInstaller(
Expand Down
8 changes: 4 additions & 4 deletions distbuilder/qt_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7412,10 +7412,10 @@ def __mergePackageObjects( srcPkg, destPkg, subDirName=None ):
srcShortcuts[i].exeDir = joinPathQtIfw(
QT_IFW_TARGET_DIR, subDirName )
except: srcShortcuts = []
if srcPkg.pkgCodeSignTargets:
try: destPkg.pkgCodeSignTargets.extend( srcPkg.pkgCodeSignTargets )
except: destPkg.pkgCodeSignTargets = srcPkg.pkgCodeSignTargets
destPkg.pkgCodeSignTargets = list(set( destPkg.pkgCodeSignTargets ))
if srcPkg.codeSignTargets:
try: destPkg.codeSignTargets.extend( srcPkg.codeSignTargets )
except: destPkg.codeSignTargets = srcPkg.codeSignTargets
destPkg.codeSignTargets = list(set( destPkg.codeSignTargets ))
if destPkg.pkgScript:
if srcShortcuts:
try: destPkg.pkgScript.shortcuts.extend( srcShortcuts )
Expand Down

0 comments on commit cfafac0

Please sign in to comment.