4

I am using the latest Qt Installer version 2.0.3 I have created an installer for my app, but when I try to install it I get the following error message: "The folder you selected already exists and contains an installation. Chose different target for installation"

How can I indicate Qt Installer to overwrite the old version? is this officially supported?

Jero Lopez
  • 398
  • 1
  • 7
  • 18

3 Answers3

5

Use the MaintenanceTool. It's in the root folder of the Qt installation, which on Linux is

bash -c "$HOME/Qt/MaintenanceTool"

enter image description here

drarko
  • 51
  • 1
  • 4
1

You should use this code below. You will always have the same id for your application and you will be able to overwrite your application.

function Controller()
{
    installer.setValue("ProductUUID", "YourApplicationName");

    var previous = installer.value("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\YourApplicationName\\InstallLocation");
    if(previous !== "")
    {
        installer.setValue("TargetDir", previous);
        installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);
    }
}
Alexis
  • 11
  • 1
0

No, it is not officially supported for some reason. To get it to work, you have to do some hacking. I have listed the steps that work for me in the answer for my question.

rationalcoder
  • 1,587
  • 1
  • 15
  • 29