Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade built by InstallShield 2012 reports installed version in bad format

I am seeing the following messages during an upgrade using an installer built with InstallShield 2012 Spring:

  1. The InstallShield Wizard will update the installed version (9.01.005) of <our product> to version 9.2.0.53.
  2. The InstallShield Wizard is updating (9.01.005) of <our product> to version 9.2.0.53.

These are messages are based on string resources IDS_IFX_SDWELCOMMESSAGE_UPDATE_WELCOME and IDS_IFX_STATUSEX_STATICTEXT_UPDATEUI. I believe the un-altered string resources would look like this:

  • The InstallShield Wizard will update the installed version (%VI) of %P to version %VS. To continue, click Next.
  • The InstallShield Wizard is updating (%VI) of %P to version %VS.

although some resources indicate that the second string resource is "The InstallShield Wizard is updated %VI of %P to version %VS."

The problem is that the old (installed) version number is supposed to be a display string like "9.1.5.2" instead of a formatted version of the internal version number like "9.01.005". As I understand it SdSubstituteProductInfo uses IFX_INSTALLED_DISPLAY_VERSION to populate the %VI substitution in OnUpdateUIBefore's default InstallScript code. And IFX_INSTALLED_DISPLAY_VERSION defaults from IFX_INSTALLED_VERSION, which explains why the preferred display string is not appearing where we would want it to. And I assume SdWelcome (or any dialog or code similarly referencing IFX_INSTALLED_DISPLAY_VERSION), also displays the badly formatted version.

Despite all my searching on the web about the functions, strings, and string IDs mentioned above, I have not found the ideal solution to displaying the properly formatted old version number (DisplayVersion) in the correct format. Some articles suggest hard coding a format string that skips the old version number instead of using a string resource that includes %VI. Others suggest manually formatting the version number as desired and putting the result into IFX_INSTALLED_DISPLAY_VERSION. I know there's a better answer, and I want it to be easier to find next time I or anyone else looks for it.

like image 317
BlueMonkMN Avatar asked Oct 06 '22 06:10

BlueMonkMN


1 Answers

On the OnBegin InstallScript function, add the following line of InstallScript code as the first line after begin:

RegDBGetItem(REGDB_UNINSTALL_DISPLAY_VERSION, IFX_INSTALLED_DISPLAY_VERSION);

Performing this in OnBegin also ensures that another message not mentioned in the question uses the correct format:

The setup has detected that version %VI of %P is already installed.

This setup installs an earlier version of %P (%VS).

You will have to uninstall the previous version before installing this version.

like image 135
BlueMonkMN Avatar answered Oct 10 '22 04:10

BlueMonkMN