hi,
i have an xpath that runs perfectly when i hardcode the computer name below. however if i substitute the value with a property it does not resolve.
can anyone specify the correct syntax to ensure i get the resolved property when installing:-


Working:-
/MachineInventory/Machines/Machine[@name="MyPCName"]/Attributes/Attribute[@name="City"]

Not working:-

/MachineInventory/Machines/Machine[@name="[COMPUTERNAME]"]/Attributes/Attribute[@name="City"]

what do i need to add to [COMPUTERNAME] to ensure it gets reolved?????
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Try changing COMPUTERNAME to ComputerName. Properties are case sensitive.

If that doesn't work look up the Formatted data type in msi.chm and that will show you how you can embed "[" characters. That may be the problem.

Hope this helps!
Owen
Answered 06/25/2007 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
thx Owen, but i am afraid no joy with formatting either.
I fear i may have to use a custom action which is not what i had hoped.
with that in mind does anyone have a snippet of code that executes an xpath query and gives me the ability to store the returned value in a property so that i can use it in a component condition?
Answered 06/25/2007 by: misk
Orange Senior Belt

Please log in to comment
0
Try using the property like this [%COMPUTERNAME%]




________________
Regards,
Rakesh.
Answered 06/25/2007 by: rakesh.kumar
Senior Yellow Belt

Please log in to comment
0
tried that too, no joy! such a nightmare!
Answered 06/25/2007 by: misk
Orange Senior Belt

Please log in to comment
0
/MachineInventory/Machines/Machine[\[]@name="[ComputerName]"[\]]/Attributes/Attribute[\[]@name="City"[\]]

From Formatted

If a substring of the form [\x] is found, it is replaced by the character x , where x is one character, without any further processing. Only the first character after the backslash is kept; everything else is removed. For example, to include a literal left bracket ([), use [\[]. The text [\[]Bracket Text[\]] resolves to [Bracket Text].

What does the log resolve [ComputerName] to?
Answered 06/26/2007 by: fuz_kitten
Second Degree Blue Belt

Please log in to comment
0
thx for the help.
when looking at the log it seems as if the CA ISXmlAppSearch does not attempt to resolve the string whatsoever.

for example if i set the Element column of the ISXmlLocator table to any of the following it does not get resolved and shows up character for character in the lof.

Value in table What appears in log as element value to look for
[ComputerName] [ComputerName]
[%ComputerName%] [%ComputerName%]
[\[]ComputerName] [\[]ComputerName]
[[ALLUSERS]] [[ALLUSERS]]

It is as if no attempt is made to resolve any part of the expression when using the xml app search.
Can anyone confirm this?
Answered 06/26/2007 by: misk
Orange Senior Belt

Please log in to comment
0
I'm sorry but I've never used the ISXmlAppSearch table. Where is the CA scheduled? Is it deferred?
Answered 06/26/2007 by: fuz_kitten
Second Degree Blue Belt

Please log in to comment
0
are you using the default WIX xml CA's ?

I have a bunch of examples for that which use almost identical syntax. Let me know if you want them .
Answered 06/28/2007 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
0
i am using installshield 8 which adds in the CA xmlappsearch. the problem is that it does not resolve the xpath string. if you have some examples that can sort my problem i would appreciate it
Answered 07/02/2007 by: misk
Orange Senior Belt

Please log in to comment
0
just to let anyone know we called installshield on this issue and it turns out that the IS custom action that is used when you create an xml appsearch does not resolve the xpath it is passed. therefore what i was trying to do would never work!
Answered 07/05/2007 by: misk
Orange Senior Belt

Please log in to comment
0
//configuration/appSettings/add[\[]@key='azmanStore'[\]]/@value

//FormManagement/ReplaceItems/ReplaceItem/NewUrl

//appSettings/add[\[]@key='AUDIT_QUEUE'[\]]/@value

//MonitoredProcessStartInfo[\[]ProcessName='ISS RuleBase'[/]]/EnvironmentVariables/Parameter[\[]@key='SSAMSQBIN'[/]]/@value

//configuration/applicationSettings/SIS.Framework.Auditing.MsmqDistributor.Properties.Settings/setting[\[]@name='AuditQueuePath'[\]]/value
Answered 07/09/2007 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
0
try a single ' around the "[Computername]"

ie

'[Computername]'
Answered 07/09/2007 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity