Skip to content

Commit

Permalink
Patched minor glitch in kill mechanism, regarding Windows return code…
Browse files Browse the repository at this point in the history
…s. Patched glitch in uninstaller - eliminated faulty attempts to "double uninstall".
  • Loading branch information
BuvinJ committed Jul 2, 2020
1 parent 2632470 commit 3e38987
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
16 changes: 13 additions & 3 deletions distbuilder/qt_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,9 @@ class _QtIfwScript:

__FILE_EXITS_TMPL = "installer.fileExists( %s )"

# Note, there is in fact an installer.killProcess(string absoluteFilePath)
# this custom kill takes a process name, with no specific path
# It also runs in parrellel with "install operation" kills
__KILLALL_PROG_TMPL = "killAll( %s );\n"
_KILLALL_PATH = "taskkill" if IS_WINDOWS else "killall"
_KILLALL_ARGS = ["/F","/IM"] if IS_WINDOWS else ["-9"] #TODO: CROSS SH? some might want -s9 ?
Expand Down Expand Up @@ -1576,8 +1579,9 @@ def __genReadyForInstallationPageCallbackBody( self ):
_QtIfwScript.ifCmdLineSwitch( _QtIfwScript.AUTO_PILOT_CMD_ARG ) +
QtIfwControlScript.clickButton(
QtIfwControlScript.NEXT_BUTTON ) +
' else {\n' +
' managePriorInstallation();\n' +
' else {\n' +
' ' + _QtIfwScript.ifInstalling() +
' managePriorInstallation();\n' +
' }\n'
)

Expand Down Expand Up @@ -2052,7 +2056,7 @@ def __addKillOperations( self ):
if not self.killFirstExes and not self.killLastExes: return
killPath = _QtIfwScript._KILLALL_PATH
killArgs = _QtIfwScript._KILLALL_ARGS
retCodes = [0,-128]
retCodes = [0,128] # This is WINDOWS, cross platform?
def toExOp( killExe ):
if isinstance( killExe, six.string_types ):
installExe = uninstallExe = killExe
Expand Down Expand Up @@ -2920,6 +2924,12 @@ def __mergePackageObjects( srcPkg, destPkg, subDirName=None ):
if srcPkg.pkgScript.customOperations:
try: destScript.customOperations.extend( srcPkg.pkgScript.customOperations )
except: destScript.customOperations = srcPkg.pkgScript.customOperations
if srcPkg.pkgScript.killFirstExes:
try: destScript.killFirstExes.extend( srcPkg.pkgScript.killFirstExes )
except: destScript.killFirstExes = srcPkg.pkgScript.killFirstExes
if srcPkg.pkgScript.killLastExes:
try: destScript.killLastExes.extend( srcPkg.pkgScript.killLastExes )
except: destScript.killLastExes = srcPkg.pkgScript.killLastExes
print( "\nRegenerating installer package script: %s...\n"
% (destScript.path()) )
destScript._generate()
Expand Down
15 changes: 9 additions & 6 deletions docs/LowLevel.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,17 +545,20 @@ Merges the [QtIfwPackage](ConfigClasses.md#qtifwpackage)
objects within the *pkgs* argument with the ids supplied by
*srcId* and *destId*.

"Merging" entails a recursive *content* merge of the source into the target
via [mergeDirs](#mergedirs) as well as combining the lists of
"Merging" first of all entails a recursive *content* merge of the source
into the target via [mergeDirs](#mergedirs). In addition, a number of
other configuration details will be "merged" as well. Examples of such
include combining the lists of
[QtIfwShortcut](ConfigClasses.md#qtifwshortcut) objects,
[QtIfwExternalOp](ConfigClasses.md#qtifwexternalop) objects, and the
`customOperations` script snipets nested inside the
[QtIfwPackageScript](ConfigClasses.md#qtifwpackagescript)
objects, followed by script regeneration to reflect such. Note that all other
attributes of the source package are lost! Any complex customizations which need
to be made must be applied post merge.
objects, followed by script regeneration to reflect such.
Note that all attributes of the source package, which aren't explictly
handled by the library in this operation, are lost! Some further
customizations to the result may need to be made post merge for a given use case.

If the source package has a `subDirName` attribute, that detail will be preserved
If the source package has a `subDirName` attribute, that detail will be preserved
by this nesting. I.e. the merge will retain the sub directory encapsulation.

This function ultimately consolidates the package items in the list and returns
Expand Down

0 comments on commit 3e38987

Please sign in to comment.