need to read an XML file and make an IF decision
in a deployment package, trying to figure out a way to check the contents of a specific .xml file on the hard drive of the target PC and IF a certain string matches then abort the install ELSE proceed to delete/re-install the application, something like this batch file, but not sure best way to read xml into memory to parse it and make a decision on it:
IF EXIST "c:\dassaultsystemes\C214"
somehow read "c:\dassaultsystemes\C214\sftmgt\install.xml" file into memory
(
IF install string matches "V6R2103xE.HF9"
Exit 2
write-output "C214 already installed successfully, exiting"
ELSE
ren "c:\dassaultsystemes\C214" "c:\dassaultsystemes\C214_OLD"
timeout /t 10 /nobreak
rmdir "c:\dassaultsystemes\C214_OLD"
Exit 0
write-output "bad C214 install removed, proceeding with new install"
)
ELSE
Exit 0
write-output "proceeding with initial install"
Please sign in to leave a comment.
Comments
2 comments