Important: Please read the Qt Code of Conduct -

Qt Installer Framework: How to block the user from changing TargetDir?

  • I am attempting to create an installer for my app with the Qt Installer Framework. I have set the TargetDir to where the app should be installed. Is there any way to make it so the user cannot change where the application will install to (ex. disable the Browse button)?

  • Lifetime Qt Champion


    Sorry I don't have the answer but I'm curious to why you would like to impose the target dir ?

  • My app is for a super locked down system. It also has to interact with third party software which is designed such that I have to tell it where I will install my app. I am looking into an unattended installer to bypass this issue.

  • Lifetime Qt Champion

    Ok, interesting use case. Windows target ?

  • You need a script to be executed when your installer is launched (see the tutorial example in Qt Installer Framework directory if you are new)
    By adding the following line to the Component constructor should be sufficient:
    installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);

Log in to reply