Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Not so Permanent


9 replies to this topic

Quadiago

Quadiago
  • Full Members
  • 7 posts

Posted 25 June 2007 - 10:17

Hi there

My problem is sort-of vendor specific, but there isn't a section for Advanced Installer so I thought I'd post it here.

I have an application that uses semi-permanent files. By this I mean the file(s) should be persisted through upgrades, but must be removed when uninstalling. Getting this to work is giving me a headache.

I've tried:
* "Never Overwrite" flag - the file disappears after upgrade (I know this is due to InstallExecuteSequence. Where should RemoveExistingProducts be ideally?)

* Putting the files in a seperate feature that isn't removed during an upgrade.
This persists the file during upgrades but they don't get uninstalled.

... I'm still trying other options but I'm really frustrated and hoping for some guidance.

Thank you


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 25 June 2007 - 10:49

Try moving it right before InstallFinalize, or after InstallFinalize. See topic "RemoveExistingProducts Action" in the MSI SDK.

Quadiago

Quadiago
  • Full Members
  • 7 posts

Posted 25 June 2007 - 11:01

Thank you. I'll try that.

Is there any other way to do this? Advanced Installer doesn't allow you to change the sequences, so I'll have to change the MSI after each build...

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 25 June 2007 - 12:30

I assume you are using major upgrades. A major upgrade is an uninstall and a reinstall of the same product (different versions). The execution of this can happen in several different ways, from the MSI SDK:

The RemoveExistingProducts action must be scheduled in the action sequence in one of the following locations.
  • Between the InstallValidate action and the InstallInitialize action. In this case, the installer removes the old applications entirely before installing the new applications. This is an inefficient placement for the action because all reused files have to be recopied.
  • After the InstallInitialize action and before any actions that generate execution script.
  • Between the InstallExecute action, or the InstallExecuteAgain action, and the InstallFinalize action. Generally the last three actions are scheduled right after one another: InstallExecute, RemoveExistingProducts, and InstallFinalize. In this case the updated files are installed first and then the old files are removed. However, if the removal of the old application fails, then the installer rolls back both the removal of the old application and the install of the new application.
  • After the InstallFinalize action. This is the most efficient placement for the action. In this case, the installer updates files before removing the old applications. Only the files being updated get installed during the installation. If the removal of the old application fails, then the installer only rolls back the uninstallation of the old application.

All major MSI tools will have a way to control what option from the list above is used for major upgrades. Look in any "upgrade view" or similar. What you need is either one of the latter two options. This will ensure that shared files between versions don't get uninstalled.

On another note: minor upgrades are not uninstalls and reinstalls and as such might work better for you. Minor upgrades are much more fuzzy about what you are allowed to do however. Check the SDK for the list of restrictions (or Stefan's www.msifaq.com site).

Finally: If I were you I would install these files permanent and then write myself a custom action to do the cleanup on uninstall and condition it with (Not UPGRADINGPRODUCTCODE AND REMOVE~="ALL"). This will ensure that the action is only run during real uninstalls and not during major upgrade uninstalls (UPGRADINGPRODUCTCODE is set during major upgrades).
Regards
-Stein Åsmul

Quadiago

Quadiago
  • Full Members
  • 7 posts

Posted 27 June 2007 - 06:43

Thank you very much for the help.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 June 2007 - 14:59

In the Upgrade table for Major Upgrades you can also specify which features should be updates (default is (null) meaning all features). Maybe if you list all features there except those you want to keep?


Quadiago

Quadiago
  • Full Members
  • 7 posts

Posted 27 June 2007 - 15:11

That is one of the things I tried. It worked in persisting through upgrades, but for some reason didn't remove the file on uninstall. There might be a possibility that this was due to the keyfile(s) being screwed through various install/uninstall attempts with different settings, whilst retaining their GUIDs.

Futhermore, the default Advanced Installer behaviour towards "Automatically uninstall previous versions" doesn't allow you to choose the entries in the "remove" column in the upgrade table anyway...

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 June 2007 - 15:17

Sounds like you should submit a feature requiest to Advanced Installer smile.gif

Quadiago

Quadiago
  • Full Members
  • 7 posts

Posted 28 June 2007 - 06:22

I think so too... smile.gif

Ciprian

Ciprian
  • Full Members
  • 1 posts

Posted 28 June 2007 - 08:23

Hi,

Thank you for bringing this to our attention.

We have added this improvement on our TODO list and we are targeting our next release (5.1) to make it available.

Best regards,
Ciprian

Edited by Ciprian, 28 June 2007 - 08:26.

Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com