I wonder if it's possible to create support packs on top of an existing installation? I realize that one can create an upgrade installer. However, does this type of installation support uninstall feature including the restoration of the files when the upgrade is removed?

asked 21 Nov '11, 12:06

GigaG's gravatar image

GigaG
419911
accept rate: 0%


Upgrade installers are meant to be installed on top of existing installation and cause original uninstaller to remove both original and upgraded files. This can be used to install a fix that should not be removed separately.

Regular installers can be used to install changes on top of existing installation. Renaming uninstaller and enabling rollback will cause running the service pack uninstaller to revert files to previous version.

<project>
  <uninstallerName>uninstall servicepack</uninstallerName>
  <enableRollback>1</enableRollback>
  <rollbackBackupDirectory>${installdir}/servicepackRollbackDirectory</rollbackBackupDirectory>
  <!-- restore files on rollback -->
  <postUninstallationActionList>
    <restoreRollback/>
  </postUninstallationActionList>
  <!-- ... -->
</project>

The <restoreRollback/> action will restore files from rollback directory after uninstallation finishes. The <restoreRollback/> action is undocumented and unsupported for now.

The original application's uninstaller can run uninstaller for service pack in unattended mode before actual installation to properly clean up all files by doing:

<preUninstallationActionList>
  <showProgressDialog>
    <title>Uninstalling service pack</title>
    <actionList>
      <runProgram>
        <program>${installdir}/uninstall servicepack.exe</program>
        <programArguments>--mode unattended</programArguments>
      </runProgram>
      <!-- verify that service pack has been uninstalled - part of removal is done as separate process -->
      <while>
        <actionList>
          <wait ms="5000"/>
        </actionList>
        <conditionRuleList>
          <fileExists>
            <path>${installdir}/uninstall servicepack.exe</path>
          </fileExists>
        </conditionRuleList>
      </while>
    </actionList>
    <ruleList>
      <fileExists>
        <path>${installdir}/uninstall servicepack.exe</path>
      </fileExists>
    </ruleList>
  </showProgressDialog>
</preUninstallationActionList>

This will roll back files to the original version before main application's uninstaller removes all files. This will cause application and service pack to be properly removed.

link

answered 22 Nov '11, 07:42

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

How will the rollback work if I have more than one updates? Say I installed Patch 1, 2, and 3. If I try to rollback #2 without #3, will the installer detect that and stop me from doing it? (Rolling back #2 without #3 can be dangerous if #2 and #3 updates a common set of files.)If #2 and #3 updates totally different files, rollback #2 without #3 is safe, in this case will the installer let me do it?

(21 May '12, 20:17) gt8967884

It is possible by storing current patch level in a file - for example using iniFileGet/iniFileSet. The <postinstallationactionlist> can store current version and when running an uninstaller, it can check the latest version.

If patches have to be applied in specific order or if patching system is cumulative, this could also be used to check that Patch #2 is not installed after Patch #3.

(22 May '12, 03:55) wojciechka ♦♦
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:

×12
×8

Asked: 21 Nov '11, 12:06

Seen: 1,558 times

Last updated: 22 May '12, 03:55