Vidéos d'aide de Screencast
Recherche de vidéos d'aide Close Back
to help

Discovered Issue and Fix for Inventory Solution x64 Add Remove Programs Data Workaround

Created: 21 Mai 2009 | Updated: 21 Mai 2009 | 3 comments
Traductions
l'image des dfrancis
0 1 Vote
Login to vote

Anyone familiar with Inventory Solution for Windows and 64-bit operating systems should know that Inventory Solution 6.1 SP2 does not pull 64-bit programs into the Inv AeX OS Add Remove Programs table. Altiris has published a workaround for this in AKB 39284.

However, this workaround does not account for any program names with apostrophe's in their names which causes the generated XML to be faulty and not import correctly. In our environment, this information is bundled in the same NSE as a majority of our data from the Software Inventory task, so any system with an apostrophe in its program name causes us to never receive any updates to that table or the Inv AeX SW Audit Software table. Any tasks (targeted software delivery jobs or otherwise) that are dependent on either of these two tables for software installs/uninstalls may yield undesirable results.

When doing some troubleshooting, I ran across this in the NS's log:

Log File Name: F:\Program Files\Altiris\Notification Server\Logs\a.log
Priority: 1
Date: 5/21/2009 7:24:42 AM
Tick Count: 494592421
Host Name: NSSERVER
Process: aexsvc.exe (1388)
Thread ID: 5448
Module: AltirisNativeHelper.dll
Source: Altiris.NS.ClientMessaging.FileDispatcher.ProcessFileCallback
Description: Unable to process the file "F:\Program Files\Altiris\Notification Server\NSCap\EvtQueue\Process\nseF213.tmp" Moving to "F:\Program Files\Altiris\Notification Server\NSCap\EvtQueue\Bad\XmlException\nseF215.tmp". Reason: This is an unexpected token. The expected token is 'NAME'. Line 454, position 46.

When I pulled up the offending file and went to line 454, I was presented with the following (note: I tweaked the registry on the test box to include an apostrophe in the program name and the path name.)

<row c0='Testing Random Software With David's Apostrophe Issue' c1='False' c2='5.2' c3='' c4='C:\Program Files\Apostrophe's\uninstall.exe' c5='' c6='' c7='' c8='' c9='' c10='' />

Position 46 is just after the apostrophe. Since the tags are being opened/closed by apostrophes instead of double-quotes, the XML thinks that c0 stops at the word David, and the extra apostrophe throws the rest of the file off.

Elsewhere in that same file I noticed the &quot; tag was being used to generate double quotes without interfering with the XML. The same must hold true for apostrophes, right? Yes. The &apos; tag will allow the XML to go through with zero problems.

If you dig into the AddRemoveProgramsX64.vbs file referenced in the KB article, at the bottom you'll see a function ToXmlString which is what we're going to need to change for this fix. After seeing the logic behind the other string replacements, I added the boldfaced line replacing the apostrophe (Chr(39)) with &apos; and everything was fine after that.

Function ToXmlString (strInput)
 Dim strOutput
 If (IsNull(strInput)) Then
  ToXMLString = strInput
 Else
  strOutput = Replace(strInput, "&", "&amp;")
  strOutput = Replace(strOutput, """", "&quot;")
  strOutput = Replace(strOutput, Chr(39), "&apos;")
  strOutput = Replace(strOutput, "<", "&lt;")
  ToXmlString = Replace(strOutput, ">", "&gt;")
 End If
End Function 

I've heard this issue was supposed to be fixed in Inventory Solution 6.1 SP3 when it is released, but if you have a larger environment you may not be able to upgrade right away without doing some testing, so I wanted to throw out this fix for anyone else that may be suffering from this issue in the meantime.

Commentaires CommentairesAccéder au dernier commentaire

l'image des luisdg

Wow, with all these fixes you've submitted I wonder how long it will take for Symantec to hire you!  Thanks again dfrancis!!!

0
Login to vote
l'image des aclachey

Nice work D...... AWESOME WRITE UP..... A++++

0
Login to vote
l'image des KSchroeder

Just FYI to all, Inventory 6.1 SP3 was released last Friday.  I haven't verified that this fix is included, but reportedly x64 Add/Remove Inventory is working properly now (whether by using this method or some other work-around, I'm not sure).

Thanks,
Kyle
Symantec Trusted Advisor

For Forum threads, please click "Mark as Solution" if answered.
For all content, please give a thumbs up if you agree with or support the post.

0
Login to vote