"Upgrade" installer deleting existing entry under Windows

Comments

5 comments

  • Avatar
    BitRock support

    Hi Bob,

    Please accept my apologies for the late reply.

    Upgrade installers do not create a new entry on the Programs and Features settings. Instead, it will update the "version" field for the existing entry of the application. Did you add a is_upgrade_mode condition to the <actionGroup> that deletes old Start Menu entries?

    Regards,

    Michiel

     

     

    0
    Comment actions Permalink
  • Avatar
    Bob Hood

    Hi, Michiel.  Thanks for the reply.

    Yes, I have the removal of old Start Menu entries predicated on 'is_upgrade_mode'.

    ...
    <readyToInstallActionList>
    <actionGroup>
    <actionList>
    <!-- Delete old Start Menu entries if needed -->
    <deleteFile path="${windows_folder_common_startmenu}/${previousStartMenuName}"/>
    <deleteFile path="${windows_folder_startmenu}/${previousStartMenuName}"/>
    <!-- Remove the old ARP Entry -->
    <!-- Get the old version -->
    <registryGet>
    <key>HKEY_LOCAL_MACHINE\Software\${project.windowsSoftwareRegistryPrefix}</key>
    <name>Version</name>
    <variable>oldVersion</variable>
    </registryGet>
    <!-- Delete the old ARP registry keys -->
    <registryDelete>
    <key>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${project.fullName} ${oldVersion}</key>
    </registryDelete>
    <registryDelete>
    <key>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Management\ARPCache\${project.fullName} ${oldVersion}</key>
    </registryDelete>
    <!-- Add the files installed by the previous installation to the uninstaller -->
    <addDirectoriesToUninstaller>
    <addContents>1</addContents>
    <matchHiddenFiles>1</matchHiddenFiles>
    <files>${installdir}/ReadMe.txt;${installdir}/bin;${installdir}/icons</files>
    <ruleList>
    <isTrue value="${is_upgrade_mode}"/>
    </ruleList>
    </addDirectoriesToUninstaller>
    </actionList>
    <ruleEvaluationLogic>and</ruleEvaluationLogic>
    <ruleList>
    <platformTest type="windows"/>
    <isTrue value="${is_upgrade_mode}"/>
    </ruleList>
    </actionGroup>
    </readyToInstallActionList>
    ...

     

    0
    Comment actions Permalink
  • Avatar
    michiel

    Hi Bob,

    Are you testing this on a new Windows 7 installation? Also, could you double check the ${project.installationType} is indeed upgrade? (For example using <showInfo>)

    Best regards,

    Michiel

    0
    Comment actions Permalink
  • Avatar
    Bob Hood

    Hey, Michiel.

    I always test on a "pristine" Windows 7 install (via a VMware VM).  It has nothing else installed except the Visual Studio 2008 runtime at the time I do the initial installation of the product.  I then change the version in the Installer script, and run it again to do an "upgrade" install.

    Where should I place the test for ${project.installationType} within the Installer steps?  <readyToInstallActionList>?

    0
    Comment actions Permalink
  • Avatar
    michiel

    Hi Bob,

    You could set _project.installationType_ to _upgrade_ in the _<postShowPage>_ actionList if the installdir exist as shown in the following section of our manual:

    https://installbuilder.bitrock.com/docs/installbuilder-userguide.html#_setting_the_installer_to_upgrade_installation_mode

    You can then add the following rule to each action that requires it:

    <ruleList>
           <compareText text="${project.installationType}" logic="equals" value="upgrade"/>

    Regards,

    Michiel

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.