Reputation: 1
I'm trying change application pool for my web application with help custom action
<InstallExecuteSequence>
<Custom Action="ConfigureAppPools" Before="InstallFinalize">Application pool configured</Custom>
</InstallExecuteSequence>
<!-- Snip -->
<CustomAction Id="ConfigureAppPools" Execute="deferred" Impersonate="no" Return="check" Directory="TARGETDIR" ExeCommand="[SystemFolder]inetsrv\appcmd set site /site.name:"Default Web Site"/[path='/MyWeb'].applicationPool:MyWeb"/>
but get following error LGHT0204 : ICE03: Invalid format string; Table: CustomAction, Column: Target, Key(s): ConfigureAppPools
How fix ?
Upvotes: 0
Views: 1425
Reputation: 32250
You should escape the square brackets in your ExeCommand attribute (those around path=...
), because otherwise MSI thinks it is a property it must format. Try this:
<CustomAction Id="ConfigureAppPools" Execute="deferred" Impersonate="no" Return="check" Directory="TARGETDIR" ExeCommand="[SystemFolder]inetsrv\appcmd set site /site.name:"Default Web Site" /[\[]path='/MyWeb'[\]].applicationPool:MyWeb"/>
Each square bracket you'd like to escape must be prefixed with backslash, and wrapper into another pair of square brackets.
Upvotes: 4
Reputation: 15232
the text Application pool configured
is not a valid condition.
See the Conditional Statement Syntax, or some examples here.
Upvotes: 0