3

I'm considering to port an existing C++-based installer to Qt Installer Framework. There are a couple of things in the existing installer which I'd rather not change or reimplement at this time, e.g. parsing a license key. Instead, I'd like to reuse some of the existing code and build a smallish (GUI-less) utility out of it and then have the QtIFW installer call that as needed.

It appears that installer.execute could be used to call an external program - but is there a way to address a program which is not on the system yet but rather part of the installer? Maybe I could store the program to call as a resource and extract it to the temporary directory at runtime?

Frerich Raabe
  • 90,689
  • 19
  • 115
  • 207

1 Answers1

4

It turns out this can be achieved by shipping the utility to call as a resource. The resource can then be "extracted" at runtime by invoking the installer.performOperation function with Copy (see the list of operations), as in:

installer.performOperation("Copy", ["://myutility.exe", "/tmp"]);

This assumes that binarycreator was called with the -r argument which references an XML file like:

<RCC>
    <qresource prefix="/">
        <file>myutility.exe</file>
    </qresource>
</RCC>
Frerich Raabe
  • 90,689
  • 19
  • 115
  • 207