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

Problem with MSISetProperty not keeping values

I am having a problem setting a property in an "Installscript MSI" type project. I have a custom dialog that allows the user to enter some values that overwrite default values for the properties. After the custom dialog is done, it sets the properties using the MSISetProperty function. However, when that property is later used, it is using the default value that was overwritten, and not the value that the user entered. Here is the code:

property = [WebServicesHttp] with default value of: 93

At the start of the custom dialog, I perform this:

MsiGetProperty(ISMSI_HANDLE, "WebServicesHttp", sDummy, nBuffer);
nWebServicesHttpPort = GetNumber(sDummy);

This retrieves the default value of 93 correctly.

After the user presses the "Next" button, the following code runs:

// user clicked Next
bSuccess = TRUE;
if (bSuccess) then

//all appears ok, so we update the property manager with the values for later use. These values are used in "XML File Changes"
MsiSetProperty(ISMSI_HANDLE, "WebServicesHttp", GetString(nWebServicesHttpPort));

Later, I use the [WebServicesHttp] for the tcp port number in the IIS properties of the website that is being installed.

Now, I have checked using both the debugger and a series of message boxes to ensure that the property is getting set....and it is. I can press back to get to my custom dialog again and have it throw up a messagebox with the user entered value. Dialog modified like this:
MsiGetProperty(ISMSI_HANDLE, "WebServicesHttp", sDummy, nBuffer);
nWebServicesHttpPort = GetNumber(sDummy);
MessageBox(GetString(nWebServicesHttpPort), INFORMATION);
This works and shows the previously entered user value.

HOWEVER....when the install actually runs, it does not keep the user entered value but instead uses the default that was originally set in the property manager. When I check the log at the end of the installation (where it dumps the properties) it shows the default value there too.

Property(S): ReportingServer = ReportingServer
Property(S): DatabaseServer = DatabaseServer
Property(S): WebServicesHttps = 493
Property(S): WebServicesHttp = 93 (this is the default value...not the user set value)
Property(S): WebServicesTcp = 893
Property(S): ServicesClientSame = 0
Property(S): useAppPoolCredentials = false
Property(S): SETUPEXENAME = setup.exe

I am absolutely certain that the value is getting set in the UI and that it is available later, but it doesn't persist (or make it to the underlying MSI maybe??). There are no custom dialogs or actions that run after my custom dialog (which is in "Before Move Data --> OnFirstUIBefore").

I am so frustrated I am pulling my hair out over this and looking at other install solutions. I need someone smarter than me to help me figure this out so I don't waste all the time I spent with Installshield by throwing it away and starting over.

Thank you in advance...
Labels (1)
0 Kudos
1 Reply

Re: Problem with MSISetProperty not keeping values

Properties that can be configured by a user should be public; that is, their name should not contain any lower case letters. Note that you may also want to list them in the SecureCustomProperties property.
0 Kudos