user1030817
user1030817

Reputation: 1

wix custom action Configuring Application Pools

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:&quot;Default Web Site&quot;/[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

Answers (2)

Yan Sklyarenko
Yan Sklyarenko

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:&quot;Default Web Site&quot; /[\[]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

wimh
wimh

Reputation: 15232

the text Application pool configured is not a valid condition.

See the Conditional Statement Syntax, or some examples here.

Upvotes: 0

Related Questions