Hi,

I'm installing into a fixed directory, one that doesn't include the version.

Each new version overwrites the old. But in Windows' control panel I have several versions, when I only want one, the latest.

Of course uninstalling "old versions" actually uninstalls the latest (and only one, there are no actual uninstallers for each version), which is going to confuse users.

So the question is as the title says, what do I put in my project to avoid Windows thinking I have several versions installed?

asked 30 Jul '13, 18:38

rberber's gravatar image

rberber
1112
accept rate: 0%


You could just simply set the below setting:

<project>
    ...
    <windowsARPRegistryPrefix>${project.fullName}</windowsARPRegistryPrefix>
    ...
</project>

That will force all the versions to write their keys to the same place.

You could also delete the previous keys using the below code:

<registryFind>
  <findAll>1</findAll>
  <keyPattern>${project.fullName}*</keyPattern>
  <namePattern>DisplayName</namePattern>
  <rootKey>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall<rootKey>
  <searchDepth>1</searchDepth>
  <variable>installedApplications</variable>
</registryFind>
<foreach>
  <values>${installedApplications}</values>
  <variables>key name value</variables>
  <actionList>
    <registryDelete>
      <key>${key}</key>
    </registryDelete>
  </actionList>
</foreach>
link

answered 31 Jul '13, 07:40

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Thanks for the reply.

The second part looks like overkill, its probably what "<installationtype>upgrade" would do... which I didn't know existed (its not visible in InstallBuilder's GUI), and it may be just what I wanted. I'll have to experiment a bit.

(31 Jul '13, 10:38) rberber

The upgrade mode will avoid creating new keys but sometimes it is not the best approach (it can be selected through the GUI under the project properties -> Installation -> Installation Type). The registry key deletion was more a solution to clean existing old installations that do not use the new approach. If you are always going to want a single version and you are happy without using the "upgrade" mode, I would use changing the windowsARPRegistryPrefix

(31 Jul '13, 11:01) juanjo ♦♦

Project Properties?

I don't have that (InstallBuilder for Qt 8.6.0)... hold on, you meant: Advanced -> project -> Edit main project properties... -> Installation.

Thanks.

(31 Jul '13, 12:21) rberber

Yes, I meant the menu opened by clicking on the "Edit main project properties"

(01 Aug '13, 18:06) juanjo ♦♦

You could just simply set the below setting:

<project>

...

<windowsARPRegistryPrefix>${project.fullName}</windowsARPRegistryPrefix>

...

</project>

That will force all the versions to write their keys to the same place.

That didn't work. Neither the search & destroy. I'm still stuck with crappy installers that leave non-existent older versions (i.e. no older files, or older uninstaller).

Does anyone knows what are the settings to create an installer that only leaves the latest version (in Windows' list of installed programs)?

(11 Oct '13, 17:07) rberber

Adding:

<allowAddRemoveComponents>1</allowAddRemoveComponents>

in addition to using a single registry key, and disabling rollback, seems to have fixed the issue. No more phantom installers left behind.

link

answered 22 Oct '13, 22:30

rberber's gravatar image

rberber
1112
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×83

Asked: 30 Jul '13, 18:38

Seen: 1,341 times

Last updated: 22 Oct '13, 22:30