Click here to Skip to main content
15,889,810 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I build an installer with Basic MSI Project in InstallShield 2010.

My setup has custom dialogs with inputs like textBoxes. Each TextBox has associated a variable with a default value. The package kit contain also an .xml file wich is generated by installer and has in it the values setted in wizard in a specific path. That works very well.

The problem is I have a lot of this textBoxes and a lot of steps. I want to add the possibility for a user to browse an .xml file in one of the wizard's steps and then skip all the steps to insert data in textboxes.

I guess that inside my installer's project I have to set the default values for each variables with a value or with a path (I know exactly where the value I need is in xml) in condition that the user points to an xml.

I will ignore for now if the browsed xml has not the same template I need, let's say that I will find the paths.

The question is how I set the variables in my project in case that xml file is browsed?

Thanks for your time.
Posted
Updated 11-Nov-11 4:38am
v2

1 solution

After some days I read about that, I write next things:

my xml:

<settings>
    <sitenames>
        <setting property="prop1">value1</setting>
        <setting property="prop2">value2</setting>
    </sitenames>
</settings>

my .vbs:
Dim xmlPath  
    Dim xmlDoc
    xmlPath = Session.Property("IS_BROWSE_FILEBROWSED")
	set xmlDoc = CreateObject("Microsoft.XMLDOM")

	xmlDoc.async = "false"
	xmlDoc.load(xmlPath)    
	
	for each x in xmlDoc.getElementsByTagName("Setting")           
		Session.Property(x.getAttribute("property")) = x.text
    next 


and it works very well :D
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900