qtqt-installer

QT framework installer - how to force targetDir


I would like to force my targetDir directory installation usign QT Installer Framework v. 3.0.

Currently this is my config.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<Installer>
    <Name>QSSWeb2Board</Name>
    <Version>1.0.0</Version>
    <Title>QSSWeb2Board</Title>
    <Publisher>BQ Educacion</Publisher>
    <ProductURL>https://bitbloq.bq.com</ProductURL>
    <InstallerWindowIcon>bitbloq</InstallerWindowIcon>
    <InstallerApplicationIcon>bitbloq</InstallerApplicationIcon>
    <Logo>bitbloq.png</Logo>
    <StartMenuDir>Bitbloq</StartMenuDir>
    <TargetDir>C:/QSSWeb2Board</TargetDir>
</Installer>

It works well, but I can modify the target dir on the installer. I would like to set a fixed value that cannot be modified.


Solution

  • Try to use installer.setDefaultPageVisible(QInstaller.TargetDirectory, false) as in http://doc.qt.io/qtinstallerframework/qt-installer-framework-systeminfo-packages-root-meta-installscript-qs.html . Since the default page for the choice of the install directory will not be shown thus, the install directory path will not be modified.