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

Help with MsiSetProperty

Hello,

I'm using IS2009 InstallScript MSI project. I have added the following code to the script:

Dlg_ITC:
bITC = FeatureIsItemSelected(MEDIA,"\Applications");
if (bITC) then
szTitle = "Interactive Teller Settings";
szMsg = "";
szAWVP = "";
szField1 = "Administration Web Virtual Path:";
nResult = SdShowDlgEdit1(szTitle, szMsg, szField1, szAWVP);
CtrlGetText(DLG_ITC, AdminWebPath, szAWVP);

MsiSetProperty(ISMSI_HANDLE, "AdminWebPath", szAWVP);
endif;
if (nResult = BACK) goto Dlg_SdFeatureTree;



This will first check to see if a feature called applications is selected. Then it will show the dialog sdShowDlgEdit1. After showing this dialog, I do a CtrlGetText to get the text from the textbox that the user enters. This all works perfectly.

Next I want to set this value in the property I have created called "AdminWebPath". After this, I run a custom action and look at the value of the property. This is always null.

This line doesn't seem to work:
MsiSetProperty(ISMSI_HANDLE, "AdminWebPath", szAWVP);

Help please
Labels (1)
0 Kudos
(1) Reply
RobertDickau
Flexera Alumni

How are you looking at the property? If you're calling MsiGetProperty, you'll want to make sure to set the buffer-size variable to a large value before calling MsiGetProperty; the InstallShield help topic "Getting and Setting Properties" has an example.

Depending on when you're setting and getting the property, you might want to use a public property: "ADMINWEBPATH" instead of "AdminWebPath".

If you create an MSI log file, is the property being set at all?
0 Kudos