This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- VBScript Custom action text being evaluated as property
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 15, 2011
07:27 AM
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:
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:
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:
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 15, 2011
10:01 AM
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.
"[\[]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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 16, 2011
10:16 AM
yep - that did it. Thanks for the link 🙂