Qt Installer Framework is a quite new framework which is currently still in development. The current version contains set of tools and utilities to create installers. The most significant feature is that the framework itself is multiplatform, it supports Windows, Mac OS X and Linux.

Great feature of QT Installer Framework is that it can download the required files from the server. That means it is not required to provide files with the installer. It works with the so called “repositories”. Thanks to this it is also able to update the files without having to download the installer again, because it creates maintenance tool which can update or uninstall the files. However the documentation is not perfect, it is missing a lot of details.

The framework is an open source project. It is built on top of the Qt (it requires static built of Qt).

The framework is really easy to use. For the basic features the user needs to know to work with XML, that is all. For advanced features the knowledge of javascript (QtScript) is required (C++ might be required for the most advanced features).

Usage

Whole installer creation process starts with creating the required folder structure.

Screen Shot 2015-01-28 at 09.16.11

There are two main folders. The config and the packages folder.

Configuration

The config folder contains the installer configuration file (config.xml) and images used in the installer. There are various things that can be configured – Supported Configuration Settings. This is the example what the configuration file could look like:

<?xml version="1.0" encoding="UTF-8"?>
<Installer>
 <Name>YSoft SafeQ Mac Client</Name>
 <Version>4.3.0</Version>
 <Title>YSoft SafeQ Mac Client Installer</Title>
 <Publisher>Y Soft</Publisher>
 <ProductUrl>http://www.ysoft.com</ProductUrl>
 <TargetDir>@HomeDir@/YSoft</TargetDir>
 <AllowSpaceInPath>true</AllowSpaceInPath>
 <InstallerApplicationIcon>ysoft_96</InstallerApplicationIcon>
 <InstallerWindowIcon>ysoft_96_32x32</InstallerWindowIcon>
 <Watermark>modern-wizard.bmp</Watermark>
 <WizardStyle>Aero</WizardStyle>
</Installer>

Packages

The second folder is the package folder. It contains all components that will be installed by the installer. Every component consists of two folders, the data and the meta folder.

The data folder contains all the files that will be installed on the target machine. Installer archives all data to the 7z format and extracts it on installation.

The meta folder contains configuration file(package.xml) for the component and the installation script that will be called when the component is loaded.

This is the example file of component configuration file

<?xml version="1.0" encoding="UTF-8"?>
<Package>
 <DisplayName>CUPS Backend</DisplayName>
 <Description>CUPS Backend</Description>
 <Version>4.3.0</Version>
 <ReleaseDate>2015-01-23</ReleaseDate>
 <Default>true</Default>
 <Script>installscript.js</Script>
 <ForcedInstallation>true</ForcedInstallation>
 <RequiresAdminRights>true</RequiresAdminRights>
</Package>

and here is the full list of possible configuration values – Summary of Package Information File Settings.

The next file is the installation script file (installscript.js). The script is called when the installer is executed and the component is loaded. The script can add new installer wizard pages, prompt user for custom path for the component etc. This is example of a script that extracts component to the /tmp folder and moves it to the Application. Then it adds new item (log out checkbox) to the final page of the installer (the page items or pages have to be designed in Qt designer).

function Component(){
	//Connect signals to functions
	component.loaded.connect(this, componentLoaded);
	installer.finishButtonClicked.connect(this, finishClicked);
}

Component.prototype.createOperationsForArchive = function(archive){
	//Extract and move .app file
	component.addOperation("Extract", archive, "/tmp");
	component.addElevatedOperation("Execute","mv", "/tmp/YSoft\ SafeQ\ Client.app", "/Applications", 
								   "UNDOEXECUTE", "rm", "-rf", "/Applications/YSoft\ SafeQ\ Client.app");
}

componentLoaded = function(){
	//If this is installer load checkbox from .ui file
	if(installer.isInstaller()){
		installer.addWizardPageItem(component, "LogOutCheckBoxForm", QInstaller.InstallationFinished);	
	}
}

finishClicked = function(){
	if(!component.installed)
		return;
	//If the installation was succesful, let the user log out
	if(installer.isInstaller() && installer.status == QInstaller.Success){
		var isLogOutChecked = component.userInterface("LogOutCheckBoxForm").LogOut.checked;
        if (isLogOutChecked) {
			//Todo - logout
		}
	}
}

Here is the documentation for the Component scripting.

The installer is created by executing the Qt Installer tool

binarycreator -c config/config.xml -p packages installer

where -p is path to the packages folder and -c is path to the config.xml file. The last part is the name of the installer. 

This is the look of the final installer on Mac OS X:

Screen Shot 2015-01-28 at 09.48.00

VirtualBox is able to host 64bit guest OS on Windows. That’s useful for testing various platforms.

The trouble begins when you turn on Hyper-V Windows Feature. It might happen by installing some software or update. When Hyper-V is enabled then it’s not possible to create new guests with 64bit OS and it’s not possible to boot anything with 64bit kernel created before this feature was turned on.

In order to make 64bit guests working again you’ll need to turn off Hyper-V feature.

Search for “windows feature” and open “Turn Windows features on or off
turn-off-windows-feature

Search for “Hyper-V” in Windows features and uncheck it.

hyper-v-disableClick OK and reboot the machine. 64bit OS guests start working again.

Shells like Bash or Zsh have one neat feature: repeat last command.

How to invoke it? Use double exclamation mark:

!!

This is very handy when you have typed the command as normal user, but it must be executed by sudo.

Example:

apt-get install safeq
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)

Execute the same command with elevated privileges:

sudo !!

Sometimes it is necessary to work only with text console.

Git provides rich command line interface, but browsing history is little bit cumbersome.

If you like command line tools and email client mutt then there is awesome tool for you: tig.

tig is text mode interface for git.

Just enter directory with cloned git repo and type:

tig

tig-example

Quick navigation:

  • Enter – show details
  • Tab – switch window pane
  • q – quit

You can find more information at http://jonas.nitro.dk/tig/manual.html.

This tool is available for Mac and Linux. Windows version is available in Cygwin.