Will the patch or upgrader automatically find the previous installation or I have to code it to find the previous installation through Registry?

Do I have to use the exact same project to create the patch installer or can use the totally different project as long as I set "installationType" to "upgrade"? If it is the later, will the files installed by the patch get automatically removed during uninstall?

asked 21 May '12, 21:54

gt8967884's gravatar image

accept rate: 12%

The "upgrade" installation type will look for an uninstaller in the installation directory and update it with the new installed files. It is also independent of the existing installation.

Regarding how this installation directory is detected, you will need to read the information from the registry. You can find a detailed example at the beginning of this section


answered 22 May '12, 05:37

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

For the "upgrade" to be able to look for an uninstaller in the installation directory, should I use the exact same project to create the "upgrade"? If not, how does the "upgrade" find the uninstaller if the uninstall is in a custom location, such as <installdir>xyzuninstall?

(22 May '12, 14:54) gt8967884

In theory, the feature is intended to make upgrades using revisions of the same project. The installer will then look for the same uninstaller it has configured (same location and uninstaller name). However, you could also use a different project with even a different default uninstaller name and directory. You would just need to redefine it at runtime. For example, if you know the uninstaller is named foo and created under the ${installdir}/uninstaller-dir directory, if you read installdir from the registry, you could use:

<setInstallerVariable name="project.uninstallerName" value="foo"/>
<setInstallerVariable name="project.uninstallerDirectory" value="${installdir}/uninstaller-dir"/>

answered 22 May '12, 15:09

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: 21 May '12, 21:54

Seen: 1,258 times

Last updated: 22 May '12, 15:09