Why are you re-inventing the wheel?  Util:XmlFile and Util:XmlConfig are quite 
serviceable and give you full rollback support.

Scheduling depends.  There's no one magic value.  Since you should be using a 
deferred action, you'll be limited to the range after CostFinalize to before 
InstallFinalize.  The file must exist before you can edit it, so InstallFiles 
will need to have been run first.  That leaves you after InstallFiles to before 
InstallFinalize.

--
John Merryweather Cooper
Senior Software Engineer | Enterprise Service Applications | Continuing 
Development
Jack Henry & Associates, Inc.® | Lenexa, KS  66214 | Ext:  431050 
|jocoo...@jackhenry.com



-----Original Message-----
From: Brian Enderle [mailto:bria...@gmail.com] 
Sent: Tuesday, October 21, 2014 12:24 PM
To: WiX Users
Subject: [WiX-users] When to call CustomAction

I am trying to run a CA after setting up a website to modify the web.config 
file based on the IIS version being used.

What should I use for the "After" value (in the InstallExecuteSequence) to make 
sure the CustomAction executes after the website is installed?

Here is the code I am using:


<Product>
...
    <InstallExecuteSequence>
      <!-- Only execute on install (not repair or uninstall) -->
      <Custom Action='WebConfigProperties' After='InstallServices'>NOT 
Installed AND NOT REMOVE</Custom>
      <Custom Action='UpdateWebConfig' After='WebConfigProperties'>NOT 
Installed AND NOT REMOVE</Custom>
    </InstallExecuteSequence>

</Product>


  <!-- Includes setup info for installing IIS information -->
  <Fragment>

    <!-- Create a component group so we only have to make one reference in 
Product.wxs -->
    <ComponentGroup Id="IISConfiguration">
      <ComponentRef Id="InstallWebsite" />
      <ComponentRef Id="InstallAppPool" />
    </ComponentGroup>

    <!-- Get username / password from AcctInfoDlg.wxs -->
    <!--<util:User Id="WebAppPoolUser" Name="[IISSERVICEACCOUNT]"
Password="[IISPASSWORD]" ></util:User>-->

    <DirectoryRef Id="INSTALLFOLDER_FOXPROCONNECTWS">

      <!-- Setup application pool information using IISSERVICEACCOUNT from 
AcctInfoDlg.wxs -->
      <Component Id="InstallAppPool" Guid="$(var.AppPoolGUID)"
KeyPath="yes">
        <iis:WebAppPool Id="FoxProConnectWS"
                        Name="FoxProConnectWS"
                        Identity="applicationPoolIdentity"
                        ManagedPipelineMode="Integrated"
                        ManagedRuntimeVersion="v4.0" />

      </Component>

      <!-- Create the website in IIS -->
      <Component Id="InstallWebsite" Guid="$(var.WebsiteGUID)"
KeyPath="yes">
        <iis:WebVirtualDir Id="WebSiteVirtualDir" Alias="FoxProConnectWS"
Directory="INSTALLFOLDER_FOXPROCONNECTWS" WebSite="FoxProWebsite" >
          <iis:WebApplication Id="WebSiteApp" Name="FoxProConnectWS"
Isolation="medium" WebAppPool="FoxProConnectWS" />
        </iis:WebVirtualDir>
      </Component>

    </DirectoryRef>

    <!-- These 'website's are defined outside of the 'DirectoryRef' so as to 
create the websites under the 'Default Web Site' entry in IIS -->
    <iis:WebSite Id="FoxProWebsite" Description="FoxProConnectWS"
Directory="INSTALLFOLDER_FOXPROCONNECTWS"  >
      <iis:WebAddress Id="AllUnassigned" Port="80" />
    </iis:WebSite>


    <Binary Id="CustomAction.CA"
SourceFile="$(var.SolutionDir)CustomActions\bin\$(var.Configuration)\CustomActions.CA.dll"
/>
    <CustomAction Id="WebConfigProperties"
              Return="check"
              Property="UpdateWebConfig"

Value="FoxProConnectWSPath=[INSTALLFOLDER_FOXPROCONNECTWS];FoxProPath=[FOXPROPATH]"
/>

    <CustomAction Id="UpdateWebConfig"
                  BinaryKey="CustomAction.CA"
                  DllEntry="UpdateWebConfigCustomAction"
                  Execute="deferred"
                  Impersonate="no"
                  Return="check" />

  </Fragment>
Brian

If you can't explain it simply, you don't understand it well enough.  - Albert 
Einstein
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are 
intended
exclusively for the individual or entity to which it is addressed. The message, 
together with any attachment, may contain confidential and/or privileged 
information.
Any unauthorized review, use, printing, saving, copying, disclosure or 
distribution 
is strictly prohibited. If you have received this message in error, please 
immediately advise the sender by reply email and delete all copies.


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to