Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 3

Get Alreadyinstallerd version During upgrade

I need to Get Alrady installed version during minor upgrade.

  • i have created function  CheckInstalledVersion(hMSI) which is reading value from uninstall registry of already installed productCode displayversion during minor upgrade and setting that value into MSI by using MsiSetProperty(hMSI,"INSTALLEDVERSION",szInstalledVersion); Here it's returning correct version But 
  • Now i need to read this value into another funtion but there szInstalledVersion it's showing empty string ,it's not reading value    nResult = MsiGetProperty (hMSI,"INSTALLEDVERSION", szInstalledVersion, nvBuf);

I also tried Global variable approach but still it's showing blank string only.

i would really appreciate if get any help


Labels (1)
0 Kudos
(3) Replies
Level 2

It seems like you are attempting to set a custom property (INSTALLEDVERSION) during a minor upgrade using MsiSetProperty, and then you want to retrieve this property in another function using MsiGetProperty, but you are facing issues with the value not being read correctly.

Here are a few things to check and consider:

Sequencing of Actions:
Ensure that the CheckInstalledVersion function, where you set the INSTALLEDVERSION property, is sequenced before the action where you are trying to read the property. The sequence of actions in your MSI package is crucial.

Custom Action Type:
Verify that the custom action type for both actions (setting and getting INSTALLEDVERSION) is correct. It's common to use type 51 (Set Property) for setting properties and type 19 (Property) for getting properties.

Enable MSI logging to gather more information. You can do this by running the installer from the command line with the /l*vx option. For example:

msiexec /i YourInstaller.msi /l*vx install.log
Check the log file for any entries related to your custom actions and property values.

0 Kudos

Hi TerryGrey,


Thanks for your response.

in above mentioned check list.

Sequencing of Actions:  it's in correct sequence only.

Custom Action Type:
How to check CusomAction Type ?  type 51 (Set Property) for setting properties and type 19 (Property) for getting properties. 

Can you please explain more on it.

it's enabled.



0 Kudos
Revenera Moderator Revenera Moderator
Revenera Moderator

Hi @Rituchaudhary ,

 You can try suggestions provided in below KB article, this kb is to get already installed versions installdir, you can modify it for your requirement, Please try it and let us know it works or not.

0 Kudos