Skip to content

Commit

Permalink
Documentation updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
BuvinJ committed Apr 1, 2020
1 parent 52a40ab commit 6c2cd6c
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 34 deletions.
2 changes: 1 addition & 1 deletion distbuilder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
, QT_IFW_READY_PAGE \
, QT_IFW_INSTALL_PAGE \
, QT_IFW_FINISHED_PAGE \
, QT_IFW_REPLACEMENT_PAGE_PEFIX
, QT_IFW_REPLACE_PAGE_PREFIX

from distbuilder.pip_installer import \
PipConfig \
Expand Down
14 changes: 5 additions & 9 deletions distbuilder/qt_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
QT_IFW_INSTALL_PAGE = "PerformInstallation"
QT_IFW_FINISHED_PAGE = "Finished"

QT_IFW_REPLACEMENT_PAGE_PEFIX="Replace"
QT_IFW_REPLACE_PAGE_PREFIX="Replace"

_DEFAULT_PAGES = [
QT_IFW_INTRO_PAGE
Expand All @@ -86,7 +86,7 @@
, QT_IFW_FINISHED_PAGE
]

_CUSTOM_TARGET_PAGE_NAME = QT_IFW_REPLACEMENT_PAGE_PEFIX+QT_IFW_TARGET_DIR_PAGE
_CUSTOM_TARGET_PAGE_NAME = QT_IFW_REPLACE_PAGE_PREFIX+QT_IFW_TARGET_DIR_PAGE

# don't use back slash on Windows!
def joinPathQtIfw( head, tail ): return "%s/%s" % ( head, tail )
Expand Down Expand Up @@ -427,20 +427,16 @@ def dirPath( self ) :
% (INSTALLER_DIR_PATH, self.pkgName) ) )

# -----------------------------------------------------------------------------
# TODO: Add loading from file
class QtIfwUiPage():

__FILE_EXTENSION = "ui"

def __init__( self, name, pageOrder=None, content=None, callbackBody=None ) :
#Note: to replace a page, set the name in the format:
# QT_IFW_REPLACEMENT_PAGE_PEFIX + [DEFAULT PAGE CONSTANT]
self.name = name
#Note: If not a replacement, this page is added added BEFORE pageOrder.
self.pageOrder = pageOrder if pageOrder in _DEFAULT_PAGES else None
self.content = content
#Note: callbackBody is used to load the page
self.callbackBody = callbackBody
# support functions in the format: name:body
self.otherCallbacks = {}

def fileName( self ):
Expand Down Expand Up @@ -1823,8 +1819,8 @@ def __genComponentLoadedCallbackBody( self ):
replacePage = None
for p in self.uiPages:
# Replace default pages
if p.name.startswith( QT_IFW_REPLACEMENT_PAGE_PEFIX ):
replacePage = p.name[ len(QT_IFW_REPLACEMENT_PAGE_PEFIX): ]
if p.name.startswith( QT_IFW_REPLACE_PAGE_PREFIX ):
replacePage = p.name[ len(QT_IFW_REPLACE_PAGE_PREFIX): ]
if replacePage in _DEFAULT_PAGES :
self.componentLoadedCallbackBody += ( NEW +
TAB + (ADD_CUSTOM_PAGE_TMPLT % ( p.name, replacePage )) + END +
Expand Down
105 changes: 86 additions & 19 deletions docs/ConfigClasses.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,14 @@ those resources act as a *base*, from which you may continue to add on to.

A QtIfw control script is "driven" by the builtin framework. When a given "event"
occurs a "handler" function is invoked (if it has been defined).

A QtIfwControlScript object has a pair of attributes related to each such
event in the framework. One is a boolean, dictating whether to auto generate this
QtIfwControlScript object has a set of attributes related to each page and such
event/handler pair in the framework. One is a boolean, controlling the "visibility"
of the page. Setting that to `False` skips over that wizard page entirely.
Another boolean is provided, dictating whether to auto generate the
event handler using a set of fixed, built-in logic provided by distbuilder to add a
fair amount of additional features to your installers "for free". The other attribute
in each pair is the body of the function (which is normally auto generated).
notable amount of additional features to your installers "for free". The final attribute
in this pattern is the body of the event handler (normally auto generated), which allows
for an atomic replacement of that code.

When the `write()` function is invoked, the actual script file to be embedded
in the installer is generated from the attributes. Prior to calling that, you
Expand All @@ -329,10 +331,12 @@ select auto generates, and then directly add on to, or manipulate the event hand
function bodies.

A large number of abstract, static "helper" functions have been provided which you may
use to build your logic. Otherwise, you may certainly just add QScript snippets
directly in the raw.
use to build your logic. Otherwise, you may certainly just add Qt Script snippets
directly in the raw. See [Installer Scripting](LowLeveel.md#installer-scripting).

Along with being able to add your own custom functions to use as "helpers"
The `virtualArgs` attribute is a dictionary, containing key/values which
allows for hard coding [Standard Installer Arguments](LowLeveel.md#standard-installer-arguments)
into the installer, which are typically passed at runtime via the command line.

Constructor:

Expand All @@ -349,28 +353,36 @@ Attributes & default values:

controllerConstructorBody = None
isAutoControllerConstructor = True


isIntroductionPageVisible = True
introductionPageCallbackBody = None
isAutoIntroductionPageCallback = True

isTargetDirectoryPageVisible = True
targetDirectoryPageCallbackBody = None
isAutoTargetDirectoryPageCallback = True

isComponentSelectionPageVisible = True
componentSelectionPageCallbackBody = None
isAutoComponentSelectionPageCallback = True

isLicenseAgreementPageVisible = True
licenseAgreementPageCallbackBody = None
isAutoLicenseAgreementPageCallback = True

isStartMenuDirectoryPageVisible = True
startMenuDirectoryPageCallbackBody = None
isAutoStartMenuDirectoryPageCallback = True

isReadyForInstallationPageVisible = True
readyForInstallationPageCallbackBody = None
isAutoReadyForInstallationPageCallback = True

isPerformInstallationPageVisible = True
performInstallationPageCallbackBody = None
isAutoPerformInstallationPageCallback = True
isFinishedPageCallbackBody = True
finishedPageCallbackBody = None
isAutoFinishedPageCallback = True

Expand Down Expand Up @@ -415,6 +427,7 @@ Attributes:
name = None
pkgXml = None
pkgScript = None
uiPages = []
<source content>
srcDirPath = None <package ENTIRE source directory>
Expand All @@ -435,6 +448,7 @@ Attributes:
Functions:

dirPath()
metaDirPath()
contentTopDirPath()
contentDirPath()

Expand Down Expand Up @@ -462,12 +476,13 @@ Attributes & default values:

pkgName = <required>
DisplayName = <required>
Description = <required>
Version = <required>
Script = None
Default = True
ReleaseDate = date.today()
DisplayName = <required>
Description = <required>
Version = <required>
Script = None
Default = True
ReleaseDate = date.today()
UserInterfaces = []

Functions:

Expand Down Expand Up @@ -511,6 +526,7 @@ Constructor:

QtIfwPackageScript( pkgName,
shortcuts=[],
uiPages=[],
fileName="installscript.qs",
script=None, scriptPath=None )
Expand All @@ -523,12 +539,17 @@ Attributes & default values:

shortcuts = []

uiPages=[]

packageGlobals = None
isAutoGlobals = True
componentConstructorBody = None
isAutoComponentConstructor = True

componentLoadedCallbackBody = None
isAutoComponentLoadedCallback = True
componentCreateOperationsBody = None
isAutoComponentCreateOperations = True

Expand All @@ -537,10 +558,8 @@ Attributes & default values:
## QtIfwShortcut

These shortcut objects are use by
[QtIfwPackageScript](#qtifwpackagescript) objects,
to create shortcuts on the installation target
environments.
These shortcut objects are use by [QtIfwPackageScript](#qtifwpackagescript) objects,
to create shortcuts on the installation target environments.

Constructor:

Expand Down Expand Up @@ -661,6 +680,54 @@ Functions:

refresh()

## QtIfwUiPage

This class is used to completely overwrite, or add, custom pages to an installer.
The content of the pages must be a Qt "form", i.e. `.ui` file (in xml) which
adheres to the [Qt UI file format](https://doc.qt.io/qt-5/designer-ui-file-format.html).
Such files are typically machine generated using [Qt Designer](https://doc.qt.io/qt-5/qtdesigner-manual.html).

If you wish to replace a page, set the `name` to `QT_IFW_REPLACE_PAGE_PREFIX`
directly concatenated with one of the following page name constants:

QT_IFW_INTRO_PAGE
QT_IFW_TARGET_DIR_PAGE
QT_IFW_COMPONENTS_PAGE
QT_IFW_LICENSE_PAGE
QT_IFW_START_MENU_PAGE
QT_IFW_READY_PAGE
QT_IFW_INSTALL_PAGE
QT_IFW_FINISHED_PAGE

Conversely, to add a new page, give it some other name and specify the `pageOrder`
using one the constants above.

Constructor:

QtIfwUiPage( name, pageOrder=None, content=None, callbackBody=None )
Attributes:

name = <required>
pageOrder = None
content = None
callbackBody = None
otherCallbacks = {}
Functions:

fileName()
write( dirPath )

Details:

**pageOrder**: If not a replacement, thd page will be added added BEFORE the
pageOrder specifiy.

**callbackBody**: Qt Script Invoked when loading the page.

**otherCallbacks**: Qt Script "support functions" dictionary in the format: name:body

## PipConfig

Objects of this type define the details for downloading
Expand Down
11 changes: 8 additions & 3 deletions docs/LowLevel.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ Static Functions:

log( msg, isAutoQuote=True )
debugPopup( msg, isAutoQuote=True )
errorPopup( msg, isAutoQuote=True )

setValue( key, value, isAutoQuote=True )
lookupValue( key, default="", isAutoQuote=True )
Expand Down Expand Up @@ -418,6 +419,8 @@ Static Functions:
ifYesNoPopup( msg, title="Question", resultVar="result",
isMultiLine=False )

Dir.toNativeSparator( path )

_autoQuote( value, isAutoQuote )

In addition, QtIfwControlScript provides:
Expand Down Expand Up @@ -461,13 +464,15 @@ following add-on **QT SCRIPT** functions:
clearErrorLog()
writeErrorLog( msg )

quit( msg )
abort( msg )
silentAbort( msg )

targetExists()
targetExists( isAutoPilotMode )
defaultTargetExists()
cmdLineTargetExists()

removeTarget()
removeTarget( isAutoPilotMode )

maintenanceToolExists( dir )
toMaintenanceToolPath( dir )
Expand Down
10 changes: 8 additions & 2 deletions docs/ToDo.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ manual intervention.
* are not enabled for install by default
* do not install shortcuts

* Revisit silent installers, using new page hiding features to further minimize
"quick flashes" of the ui.

* Test, and confirm / fix UNinstallation mechanism for silent installers,
notably in non GUI environments. (Can this already be done via the Maintenance Tool
and / or the original installer?)
Expand All @@ -28,7 +31,9 @@ and / or the original installer?)

* Add Qt IFW Package Licenses (EULAs)

* Test and develop "update installer" features as needed.
* Add "version control" for installers. Auto launch maintainencetool when trying to
install the same version. Have prompts questioning if the using wants to update
or revert to a prior version.

## v.0.9.2

Expand All @@ -39,7 +44,8 @@ and / or the original installer?)
* Windows Registry functions, analogous settings on other platforms
(e.g. plist on Mac)

* Provide *dynamically* assigned values for "QtIfwExeWrapper" via Installer.
* Provide *dynamically* assigned values for "QtIfwExeWrapper" via Installer
(for target) at runtime / during installation.

* Revisit "QtIfwExeWrapper" details. Non gui on Windows?

Expand Down

0 comments on commit 6c2cd6c

Please sign in to comment.