3

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
  • 378
  • 7
  • 17

3 Answers3

4

Use the MaintenanceTool. It's in the root folder of qt instalation

drarko
  • 41
  • 4
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,447
  • 1
  • 14
  • 27
0

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
  • 1