cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mumbles
Level 7

XPath and Installscript...

Hello All,

I've been struggling with this for two days now. This ability is barely documented and it's very difficult to get any feedback.

Essentially, i'm trying to replace some values in an XML file:


function string FileStringReplacement(hMSI, sDestPath, sDestFile, sMachineDeviceName)

OBJECT oDoc, Lot;
NUMBER nvFileHandle, nvResult;
STRING svString, szResult, szPath, szFile, szReplace, strTempString;


begin

set oDoc = CreateObject("Msxml2.DOMDocument.4.0");
oDoc.async = FALSE;
oDoc.setProperty("SelectionLanguage", "XPath");

oDoc.load(sDestPath + sDestFile);

set Lot = oDoc.selectNodes("/Device/@Name");

Lot.attributes.getNamedItem("Value").value = sMachineDeviceName;

oDoc.save(sDestPath + sDestFile);
set oDoc = NOTHING;

end;



The XML file:


false
false
5
Datascope.DatascopeDevice
Datascope




Nothing is happening. Any ideas? Please advise, i'm going insane over here... It's scheduled after the files are installed and it's running next to another custom action which is working. So i know it's not a scheduling problem. And i cannot use XMLFileChanges there is to much logic behind what i need to do....

TIA!
Labels (1)
0 Kudos
(13) Replies