In the Qt Installer Framework, all of the demos have TargetDir
specification that (for Windows) place the application in, e.g., C:\InstallationDirectory
. How can I have it default to Program Files?
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>Your application</Name>
<Version>1.2.3</Version>
<Title>Your application Installer</Title>
<Publisher>Your vendor</Publisher>
<StartMenuDir>Super App</StartMenuDir>
<TargetDir>@RootDir@InstallationDirectory</TargetDir>
</Installer>
There is no option for this, but you can create use the Component Scripting interface to set the installation directory, as described here.
First, in your
packages/com.myorg.myapp/meta/package.xml
file, include this reference to the script file.The
installscript.qs
file, which should be in the same directory aspackage.xml
, should be the following:Now the installer framework will suggest
C:\Program Files\MyPath
orC:\Program Files (x86)\MyPath
, as needed.Finally, if you want to allow installation paths with spaces (like
C:\Program Files\MyPath
), you need to enable that specifically inconfig/config.xml
by adding this line: