cbono
Posts: 42
Joined: Thu Aug 14, 2008 10:11 pm

Retrieve value of Custom Property from previous install

Hello,

I am wondering if there is a simple way of retrieving the value of a custom property during an upgrade installation. Let me describe the scenario:
  1. During first-time installation, we have a custom dialog that gives the user 3 choices; the values are simply 1, 2 and 3. We store the chosen value in a custom property called "APPMODE."
  2. We have a .NET Installer Action that uses the chosen APPMODE value to set a value in the application's config file.
  3. During application upgrades, we would like to determine what APPMODE value was previously chosen and default to it, rather than asking the user to pick APPMODE again.
We're not otherwise storing the value of APPMODE anywhere (registry, etc). The only "artifact" from the user's APPMODE choice is stored in the application's .CONFIG file. We could certainly START setting a registry value or something similar, but it wouldn't benefit the users who are currently using the product.

I know that the installer can determine a certain amount of information about the previous version (install directory, installed features, etc). So I wondered if my custom property APPMODE would already be available, and I just need to direct the installer to grab it and use it.

Any thoughts, recommendations, etc. are most welcome.

Thanks,
Chris
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Retrieve value of Custom Property from previous install

Hi Chris,

Unfortunately the installer properties are available only for the current install process (they will not be available during an upgrade).

A solution would be to write the APPMODE property in the registry and retrieve it in the upgrade installation. However, like you said, this cannot be applied to the versions already distributed.
Another approach would be to use a custom action which parses the .config file and sets the APPMODE property accordingly.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”