cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
keshriar
Level 2

Cannot retrieve a property value during minor upgrade

I have a package which does nothing but copies some files onto hard disk. I have created an Install Script custom action which displays a property value. In have set a value 1 for that property ins property tab. During fresh installation, installer is displaying the properly value but during minor upgrade the value is coming null.

I have written this code:
MsiGetProperty(hMSI,"TEST",test,pchValueBuff);
MessageBox("Test property: "+test, INFORMATION);
During fresh installation
Message box is diplaying this--> Test property: 1
During minor upgrade
Message box is diplaying this--> Test property:

Even if I try to get some already defined system property then also I am getting null.
MsiGetProperty(hMSI,"ARPPRODUCTICON",test,pchValueBuff);
MessageBox("ARPPRODUCTICON property: "+test, INFORMATION);
Message box is diplaying this--> ARPPRODUCTICON property:

Does anybody has some idea on this?
Labels (1)
0 Kudos
(1) Reply
AlexLampard
Level 4

Are you building a minor upgrade using the same project or by creating a new project.

If you are creating a new project for the minor upgrade then you have to ensure that you include the property into the new project as the database tables do not remain the same for a new project.

Check if the value set for the property is being read by using a if condition.

Sample code

Assuming the value of TEST is set to 1

MsiGetProperty(hMSI,"TEST",svtest,pchValueBuff);

svABC='0';

if(svABC !=svtest)

MessageBox("Test property: "+svtest, INFORMATION);

Ideally you should get a ARPPRODUCTICON.EXE value when the MessageBox("ARPPRODUCTICON property: "+test, INFORMATION); is executed.
0 Kudos