简体   繁体   中英

Qt Installer Framework - How to customise?

I've managed to successfully create an 'AdminProgram' which is used to build the installer for my main project. It creates required configs/packages in file system correctly, updates all .xml files and copies all required elements into the correct places before building the installer, which is pretty great.

However, I am now looking to customize my installer to do a little more so that it is able to install a few drivers into the windows registry and at a later date remove existing installs before proceeding with a new one. I have studied the 'instructions' ( http://doc-snapshot.qt-project.org/qtifw-1.4/scripting.html#predefined-variables ) for some time now and have been unable to quite grasp how exactly these Custom Operations are implemented (where the example code is supposed to be written, how the overridden operations are accessed etc.).

I find that the instruction are a little ambiguous for a programmer as inexperienced as myself and would very much appreciate some help from anyone who can give it?

In order to set entries in the registry you need to add GlobalConfig operations in your component script.

Overload the method Component.prototype.createOperations and add additional commands such as:

function Component() {
  'use strict';  
}

Component.prototype.createOperations = function () {
  'use strict';
  // call default implementation
  component.createOperations();

  component.addOperation("GlobalConfig",
            "HKEY_CURRENT_USER\\Software\\@Publisher@\\@ProductName@\\entry", 
            "key", 
            "value");
  }

The list of operations available are here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM