views:

365

answers:

1

Ok, this is driving me crazy.

I have a CA that needs to know the path of the INSTALLDIR to edit an XML file.

So, I set up a set property custom action that sets a property named RemoveAuthTypesNode to [INSTALLDIR]. Then I have a RemoveAuthTypesNode CA that is sequenced after SetConfigFolder (a set property that sets installdir to a system searched path) in the Install Execute Sequence, Deferred in System Context (doesn't work when just Deferred Exec either).

In the log I see that RemoveAuthTypesNode is set:

MSI (c) (D4:EC) [16:12:05:314]: PROPERTY CHANGE: Adding RemoveAuthTypesNode property. Its value is 'C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\'.

The custom action errors:

Error 1720.There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action RemoveAuthTypesNode script error -2146827864, Microsoft VBScript runtime error: Object required: 'objXMLDOMNode' Line 9, Column 1, MSI (s) (78:EC) [16:12:23:916]: Product: ASMI User Defined Reports -- Error 1720.There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action RemoveAuthTypesNode script error -2146827864, Microsoft VBScript runtime error: Object required: 'objXMLDOMNode' Line 9, Column 1,

This is failing because the path isn't correct so the XMLDom object never loads. I know this because if I hardcode the path everything works fine.

Also, when I search the log for CustomActionData I expected that it would be in there as being set.

Here is the code from the custom action. The msgbox is just for debugging. It is always displaying nothing.

strConfigFile = session.Property("CustomActionData") & "rsreportserver.config"
MsgBox session.Property("CustomActionData")
Set xDoc = CreateObject("Microsoft.XMLDOM")

xDoc.async = False
xDoc.Load(strConfigFile)

set objXMLDOMNode = xDoc.selectSingleNode("//Configuration/Authentication/AuthenticationTypes")
set objParentNode = objXMLDOMNode.parentNode
objParentNode.removeChild(objXMLDOMNode)

xDoc.save(strConfigFile)

Set xDoc = Nothing

What am I doing wrong? I'm sure it's something simple stupid. Help greatly appreciated.

A: 

The custom action that sets the property named for the vbscript custom action was setting a private property (not all upper case). So, the set property custom action had to be sequenced in the Execute sequence rather than the UI sequence. Once I made this change the correct data was being retrieved in the script.

It is expected if I have made a public property (all UPPER case) it would have work being in the UI sequence, however, I didn't test that theory.

PilotBob