Skip to content

Commit

Permalink
Added isLimitedMaintenance attribute / implementation to QtIfwControl…
Browse files Browse the repository at this point in the history
…Script and ConfigFactory.
  • Loading branch information
BuvinJ committed Dec 1, 2020
1 parent 11159dd commit 68366b5
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 7 deletions.
2 changes: 1 addition & 1 deletion distbuilder/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.8.20"
__version__ = "0.7.8.21"
3 changes: 3 additions & 0 deletions distbuilder/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __init__( self, cfgId=None ) :
self.ifwDefDirPath = None
self.ifwPackages = None

self.isLimitedMaintenance = True
self.replaceTarget = False # TODO: Fix this, or drop it!

self.licensePath = None
Expand Down Expand Up @@ -188,6 +189,8 @@ def qtIfwControlScript( self ) :
script=self.ifwCntrlScriptText,
scriptPath=self.ifwCntrlScriptPath )

script.isLimitedMaintenance = self.isLimitedMaintenance

# TODO: Fix this, as it is no longer respected!
if self.replaceTarget:
script.virtualArgs={ _QtIfwScript.TARGET_EXISTS_OPT_CMD_ARG:
Expand Down
25 changes: 20 additions & 5 deletions distbuilder/qt_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2671,6 +2671,11 @@ class QtIfwControlScript( _QtIfwScript ):
CUSTOM_BUTTON_2 = "buttons.CustomButton2"
CUSTOM_BUTTON_3 = "buttons.CustomButton3"

# Don't seem to exist!?
#ADD_REMOVE_RADIO_BUTTON = "PackageManagerRadioButton"
#UPDATE_RADIO_BUTTON = "UpdaterRadioButton"
#UNINSTALL_RADIO_BUTTON = "UninstallerRadioButton"

TARGET_DIR_EDITBOX = "TargetDirectoryLineEdit"
START_MENU_DIR_EDITBOX = "StartMenuPathLineEdit"
ACCEPT_EULA_RADIO_BUTTON = "AcceptLicenseRadioButton"
Expand Down Expand Up @@ -2921,6 +2926,7 @@ def __init__( self,
script=None, scriptPath=None ) :
_QtIfwScript.__init__( self, fileName, script, scriptPath )

self.isLimitedMaintenance = True
self.virtualArgs = None

self.uiPages = []
Expand Down Expand Up @@ -3343,9 +3349,15 @@ def __genControllerConstructorBody( self ):
END = _QtIfwScript.END_LINE
TAB = _QtIfwScript.TAB
SBLK =_QtIfwScript.START_BLOCK
EBLK =_QtIfwScript.END_BLOCK

self.controllerConstructorBody = (
EBLK =_QtIfwScript.END_BLOCK
self.controllerConstructorBody=""
if self.isLimitedMaintenance:
self.controllerConstructorBody += (
_QtIfwScript.ifMaintenanceTool() +
_QtIfwScript.setValue( _QtIfwScript.MAINTAIN_MODE_CMD_ARG,
_QtIfwScript.MAINTAIN_MODE_OPT_REMOVE_ALL )
)
self.controllerConstructorBody += (
TAB + 'installer.setValue( ' +
('"%s"' % (_QT_IFW_SCRIPTS_DIR,)) + ', "" )' + END +
TAB + 'installer.setValue( ' +
Expand Down Expand Up @@ -3505,7 +3517,7 @@ def hidePage( pageName ):
TAB + EBLK +
EBLK )

def __genIntroductionPageCallbackBody( self ):
def __genIntroductionPageCallbackBody( self ):
self.introductionPageCallbackBody = (
_QtIfwScript.log("IntroductionPageCallback") +
_QtIfwScript.ifInstalling( isMultiLine=True ) +
Expand All @@ -3515,7 +3527,10 @@ def __genIntroductionPageCallbackBody( self ):
_QtIfwScript.END_BLOCK +
_QtIfwScript.ELSE + _QtIfwScript.START_BLOCK +
(self.introductionPageOnMaintain if
self.introductionPageOnMaintain else "") +
self.introductionPageOnMaintain else "") +
(QtIfwControlScript.clickButton(
QtIfwControlScript.NEXT_BUTTON )
if self.isLimitedMaintenance else "") +
_QtIfwScript.END_BLOCK +
_QtIfwScript.ifCmdLineSwitch( _QtIfwScript.AUTO_PILOT_CMD_ARG ) +
QtIfwControlScript.clickButton(
Expand Down
1 change: 1 addition & 0 deletions docs/ConfigClasses.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ Constructor:

Attributes & default values:

isLimitedMaintenance = True
virtualArgs = virtualArgs

uiPages = []
Expand Down
17 changes: 16 additions & 1 deletion docs/HighLevel.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Attributes & default values:
ifwDefDirPath = None
ifwPackages = None

isLimitedMaintenance = True
replaceTarget = False

licensePath = None
Expand Down Expand Up @@ -307,10 +308,24 @@ For more information refer to:
- [RobustInstallerProcess](#robustinstallerprocess)
- [QtIfwPackage list manipulation](LowLevel.md#qtifwpackage-list-manipulation)

#### isLimitedMaintenance

When producing a QtIFW installer, when this attribute is set to `True` (the
default) the "maintenance tool" included with the distribution will not display
an introduction page with the options to add, remove, or update components.
It will only allow for uninstallation. The extended options are only naturally
functional within QtIFW in the context of an **online** installer, which is
not the default product of this library, and thus the selection of these radio
buttons only produce errors. Further, having this limitation imposed
simplifies both the end user workflow and the developer's coding / testing tasks.

When building an online installer, you may wish to enable the extended
features, by disabling this switch.

#### replaceTarget

When producing a QtIFW installer, switch this attribute to `True` if you wish for the
installer to automatically replace a prior installation. On Windows, this will referrence
installer to automatically replace a prior installation. On Windows, this will reference
the applications registered in the OS, and run the uninstallation for the prior install
via that mechanism. On other platforms, this uses the QtIFW Maintenance Tool directly to
"silently" uninstall a prior install found at the target location.
Expand Down

0 comments on commit 68366b5

Please sign in to comment.