2

I have an Installer for an application, which I use some customactions in that. At the time of installation I have been using some Custom MSI properties like DBHOST etc. to determine the database host.

And the default value for this is localhost.

But I have been setting this DBHOST property with some other value (like 192.168.1.3) through the commandline at the time of installation. and the installation worked properly with the property set through the commandline.

But When I used the

    MsiGetProperty

function in a customation that has to be executed during the uninstallation time, I got the default value (localhost) instead of the value that i have set through commandline while installation (192.168.1.3)

Can Any one help me in this.? why this happened.? Is it needed to do anything else to get the same value for the MSI property at the time of uninstallation?

Thanks In Advance...

JijeshKV
  • 670
  • 2
  • 7
  • 26

2 Answers2

5

A property value is not persistent, this means that on uninstall it will not remember the last value it had during the install and it will use its default one. The best and easier solution is to write this value in a registry entry and retrieve it during the uninstall using a registry search.

Bogdan Mitrache
  • 10,536
  • 19
  • 34
  • But we get exact values of some properties like INSTALLDIR with the custom values we set at the installation time right? Is it done in the same way of registry search? – JijeshKV May 16 '12 at 11:52
  • Properties attached to installation folders are stored by Windows Installer because they are attached to a component from the package. For standalone properties, like DBHOST, Windows Installer does not provide a cache mechanism, the only way to use their install values during maintenance is to save it, the easiest location being a registry value, and retrieve it using a registry search when the package is launched again. – Bogdan Mitrache May 16 '12 at 14:14
  • Is there somewhere I can see exactly what MSI property are cached by the MSI engine so that I don't waste time doing my own logic for them? Would be great if a similar resource existed for InstallShield MSI properties too, as I can't figure out if IS_SQLSERVER is cached or not. – Didier A. Jan 10 '14 at 15:29
  • As I said in the previous comment, only properties that refer installation paths are stored by the OS, any other properties used during the installation are not cached by default. To figure out if a property is cached or not just install the package and set a value different from the default in the property, then start the package again on maintenance and check the property value (either in a log or set it to show on a dialog) – Bogdan Mitrache Jan 10 '14 at 18:12
0

Since you mention DBHOST, if you use InstallShield's native SQL Scripts capability, they have prewritten custom actions in their infrastructure to persist the properties needed by the SQL connection for subsequent use during repairs, minor upgrades and uninstalls.

The default property name is IS_SQLSERVER_SERVER.

BTW, DBHOST is pretty innocent, but realize some persisted data ( such as IS_SQLSERVER_USERNAME and IS_SQLSERVER_PASSWORD ) is sensitive and needs to be encrypted, decrypted. InstallShield does this automatically. Whether the security is strong enough for your needs is up to you to review.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Is there somewhere in their documentation where I can see what property installshield persists by itself, and which one don't? – Didier A. Jan 10 '14 at 15:42