How to avoid leaving old uninstallers?

Comments

2 comments

  • Avatar
    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.

    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>
    
  • Avatar
    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.

Please sign in to leave a comment.