PDA

View Full Version : Problem setting a property from an edit box


Keiths123
10-20-2008, 09:06 AM
Hi,

I'm trying to get a string value from a dialog box and then set a value in an xml file to this string value, however the xml value is just being set to the default value of the property and the entered value is being ignored.

I'm using v2.1.1005.0 of MSI Factory and the steps I have used are:
1. Create a property using Project, Settings, Properties, given it an ID, a default value of "Value" and all the check boxes are clear.

2. Created a blank dialog box with an edit box on it. Set the property name to be the property I created in step 1 (without any square brackets around it) and so far tried it with indirect cleared and checked. Neither worked.

3. Created an Install XML value with an action of "set value" and put in the correct values.

It all works but it sets the value in the xml file to the default value of the property set in Step 1. I have an almost identical step in the process that sets a value in the same xml file to the installation directory and that works perfectly.


Can anyone help me on this? It appears that it is having a problem setting the property to it's entered value rather than retaining it's default.


Regards,


Keith

Keiths123
10-20-2008, 03:10 PM
Me again.

After some swearing at the computer I have deduced that putting the project property against the edit box simply puts the value of that property into the edit box and nothing else.

Can someone please tell me how to put the value of the edit box into the property?


Regards,

Keith

venky
10-20-2008, 10:27 PM
Hi Keith,
The quick answer is: You need to enclose the property name in square brackets when you define the property as the value in the Install XML action.

Assigning your custom property to the controls property name should bind that property to the control in your case an edit box so that when you type in something in the edit box the typed text will be stored in the property.

Having said that, now if you want to use the property for instance to set a value in an xml file, you need to define in the value field on the install XML page, the property name enclosed in square brackets. That should work.

Keiths123
10-21-2008, 01:54 AM
Hmmm....If I put the property name in square brackets in the edit box property window the msi fails with:

"Error 5002: Validation Failed - 'SetupnFlow5.msi' was generated successfully but ICE validation errors occurred.
Deleting temporary files

Build FAILED! Error: 5002 - The setup (.msi) file was created but it did not pass ICE validation. See the individual ICE validation messages above for details."


If I put the square brackets around the property name in the Install XML:setValue action it builds and runs fine, it just puts in the default value for the property rather than any values entered in the edit box.

Keiths123
10-21-2008, 05:43 AM
It appears that if you set the property up and then change it in any way then the msi builder retains the information about the old property.

The solution to this was:
1. Delete the property from project settings.
2. Delete the dialog box.
3. Delete the setXML action.
4. Save and rebuild the msi.
5. Start from scratch and do it all again...

venky
10-21-2008, 06:27 PM
Don't put square brackets in the edit box. Put square brackets only around the property name in the InstallXML.

I built a project and tested and it works fine. In my project, I created a property called MYPROPERTY and I added two custom dialogs. On the 1st custom dialog I have an edit box linked to MYPROPERTY. On the 2nd custom dialog (shown after a couple of dialogs later) I have an edit box linked to the same property i.e., MYPROPERTY. I also set up an InstallXML action to set an XML value in a XML file to MYPROPERTY. When I ran the installer, I changed the value in edit box on 1st custom dialog and then on the 2nd custom dialog the edit box has the new value of MYPROPERTY. After the installation completed I checked the XML file and the new value of MYPROPERTY was written to it.

Hope that helps.