cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
richardh
Level 5

VBScript Custom action text being evaluated as property

This is an odd one...

I have an MSI that contains a VBscript custom action stored in the binary table, and not scheduled to be executed at all. I use this compiled MSI as a base for my transform, where I modify the properties of the CA to be executed deferred in system context (I also have a modify property CA that passes in all the required values via CustomActionData).

Now comes the tricky part:
The CA itself executes "appcmd.exe" and uses the following command line

[CODE]"szCmdLine=WinSysDir & "\inetsrv\appcmd.exe set config """ & szWebsite & """/xxx_" & szSystemName & "_" & szApplicationName & " -section:system.webServer/security/requestFiltering /-fileExtensions.[fileExtension='.config'] -commitpath:apphost""[/CODE]

If I modify the MSI so that the CA is triggered during execution of the base MSI the code is executed normally and all is well. However, if I trigger the CA via the transform the command line becomes:

"szCmdLine=WinSysDir & "\inetsrv\appcmd.exe set config """ & szWebsite & """/xxx_" & szSystemName & "_" & szApplicationName & " -section:system.webServer/security/requestFiltering /-fileExtensions. -commitpath:apphost""


In other words, the text "[fileExtension='.config']" appears to be evaluated as a property and replaced by null.

Any ideas why this is happening ? Or what I can do to prevent my command line being mangled ?:confused:
Labels (1)
0 Kudos
(2) Replies
hidenori
Level 17

To include a literal left and right bracket, try this:

"[\[]fileExtension='.config'[\]]"

See http://msdn.microsoft.com/en-us/library/windows/desktop/aa368609(v=vs.85).aspx for more information about the Formatted data type.
0 Kudos
richardh
Level 5

yep - that did it. Thanks for the link 🙂
0 Kudos