Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 3rd, 2012  |  syntax: None  |  size: 16.39 KB  |  hits: 28  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. wix - web application install with initial iis settings; need upgrade files NOT changing iis settings
  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
  4.      xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
  5.  
  6.   <?include Config.wxi ?>
  7.  
  8.   <Product
  9.     Id="E3105F82-0460-4C3C-8F6C-778405E81F61"
  10.     Name="Website"
  11.     Language="1033"
  12.     Version="1.0.0.1"
  13.     Manufacturer="Website"
  14.     UpgradeCode="E3105F82-0460-4C3C-8F6C-778405E81F61">
  15.  
  16.     <Package
  17.       InstallerVersion="200" Compressed="yes" />
  18.  
  19.     <Media
  20.       Id="1"
  21.       Cabinet="media1.cab"
  22.       EmbedCab="yes" />
  23.  
  24.     <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
  25.     <UIRef Id="CustomWixUI_InstallDir"/>
  26.  
  27.     <FeatureRef Id="InitialFeature"/>
  28.  
  29.   </Product>
  30.  
  31.   <Fragment>
  32.     <Feature Id="InitialFeature" Title="Initial (Full)" Level="1">
  33.       <ComponentGroupRef Id="WebPublishCmp"/>
  34.       <ComponentRef Id="IIS.Component"/>
  35.     </Feature>
  36.  
  37.     <Feature Id="WebFilesFeature" Title="Website (Files)" Level="1">
  38.       <ComponentGroupRef Id="WebPublishCmp"/>
  39.     </Feature>
  40.  
  41.  
  42.   </Fragment>
  43.  
  44.   <Fragment>
  45.     <Component Id="IIS.Component" Guid="6FAD9EC7-D2B0-4471-A657-C8AF5F6F707F" KeyPath="yes" Directory="INSTALLLOCATION">
  46.       <iis:WebSite Id="DefaultWebSite" Description="$(var.WebSiteName)" Directory="INSTALLLOCATION" >
  47.         <iis:WebAddress Id="AllUnassigned" Port="80"/>
  48.       </iis:WebSite>
  49.       <iis:WebAppPool Id="WebsiteAppPool" Name="App" Identity="networkService" />
  50.       <iis:WebVirtualDir Id="My.VirtualDir" Alias="App" Directory="INSTALLLOCATION" WebSite="DefaultWebSite">
  51.         <iis:WebApplication Id="Application" Name="App" WebAppPool="WebsiteAppPool"/>
  52.       </iis:WebVirtualDir>
  53.     </Component>
  54.   </Fragment>
  55.  
  56.   <Fragment>
  57.     <Directory Id="TARGETDIR" Name="SourceDir">
  58.       <Directory Id="ProgramFilesFolder">
  59.         <Directory Id="INSTALLLOCATION" Name="Website">
  60.         </Directory>
  61.       </Directory>
  62.     </Directory>
  63.   </Fragment>
  64. </Wix>
  65.        
  66. <MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" Schedule="afterInstallInitialize" DowngradeErrorMessage="A later version of of this product is already installed. Setup will now exit."/>
  67.        
  68. <?xml version="1.0" encoding="utf-8" ?>
  69. <Include xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"
  70.      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
  71.  
  72.     <!-- The RegistrySearch elements will populate these properties with values from the registry IF they exist there, otherwise the default values will be used -->
  73.     <Property Id="REG_WEBSITE_NAME" Value="WebsiteName" >
  74.         <RegistrySearch Id="WEB_WEBSITE_NAME_Remembered" Root="HKLM" Key="SOFTWAREPRODUCT_NAME" Name="Website_Name" Type="raw" />
  75.     </Property>
  76.     <Property Id="REG_WEB_APP_POOL_NAME" Value="PoolName" >
  77.         <RegistrySearch Id="WEB_APP_POOL_NAME_Remembered" Root="HKLM" Key="SOFTWAREPRODUCT_NAME" Name="WebApp_PoolName" Type="raw" />
  78.     </Property>
  79.     <Property Id="REG_WEB_APP_POOL_IDENTITY_DOMAIN">
  80.         <RegistrySearch Id="WEB_APP_POOL_IDENTITY_DOMAIN_Remembered" Root="HKLM" Key="SOFTWAREPRODUCT_NAME" Name="WebApp_PoolIdentityDomain" Type="raw" />
  81.     </Property>
  82.     <Property Id="REG_WEB_APP_POOL_IDENTITY_USERNAME" Value="NetworkService" >
  83.         <RegistrySearch Id="WEB_APP_POOL_IDENTITY_USERNAME_Remembered" Root="HKLM" Key="SOFTWAREPRODUCT_NAME" Name="WebApp_PoolIdentityUsername" Type="raw" />
  84.     </Property>
  85.     <!-- Notice that the password is NOT stored in the registry and is hidden so it's not shown in logs -->
  86.     <Property Id="WEB_APP_POOL_IDENTITY_PWD" Hidden="yes" />
  87.  
  88.     <!-- This is the compnent that actually writes the values to the registry on install -->
  89.     <Component Id="C_RegistryEntries" Directory="INSTALLLOCATION">
  90.         <RegistryValue Root="HKLM" Key="SOFTWAREProviderWebsites" Name="Website_Name"                  Type="string" Value="[WEBSITE_NAME]"/>
  91.         <RegistryValue Root="HKLM" Key="SOFTWAREProviderWebsites" Name="WebApp_PoolName"               Type="string" Value="[WEB_APP_POOL_NAME]"/>
  92.         <RegistryValue Root="HKLM" Key="SOFTWAREProviderWebsites" Name="WebApp_PoolIdentityDomain"     Type="string" Value="[WEB_APP_POOL_IDENTITY_DOMAIN]"/>
  93.         <RegistryValue Root="HKLM" Key="SOFTWAREProviderWebsites" Name="WebApp_PoolIdentityUsername"   Type="string" Value="[WEB_APP_POOL_IDENTITY_USERNAME]"/>
  94.     </Component>
  95.  
  96.     <!-- These CustomActions set the property that are used for the install from the registry values (These actions are only run under the conditions in the sequences below) -->
  97.     <CustomAction Id='SetWebAppName'                    Property='WEBSITE_NAME'                     Value='[REG_WEBSITE_NAME]'/>
  98.     <CustomAction Id='SetWebAppPoolName'                Property='WEB_APP_POOL_NAME'                Value='[REG_WEB_APP_POOL_NAME]'/>
  99.     <CustomAction Id='SetWebAppPoolIdentityDomain'      Property='WEB_APP_POOL_IDENTITY_DOMAIN'     Value='[REG_WEB_APP_POOL_IDENTITY_DOMAIN]'/>
  100.     <CustomAction Id='SetWebAppPoolIdentityUsername'    Property='WEB_APP_POOL_IDENTITY_USERNAME'   Value='[REG_WEB_APP_POOL_IDENTITY_USERNAME]'/>
  101.  
  102.     <!-- The CustomActions above that set the variables used in the installation are only run if they were not supplied by the command line -->
  103.     <InstallUISequence>
  104.         <Custom Action='SetWebAppName'                  After='AppSearch'>REG_WEBSITE_NAME                      AND (NOT WEBSITE_NAME)</Custom>
  105.         <Custom Action='SetWebAppPoolName'              After='AppSearch'>REG_WEB_APP_POOL_NAME                 AND (NOT WEB_APP_POOL_NAME)</Custom>
  106.         <Custom Action='SetWebAppPoolIdentityDomain'    After='AppSearch'>REG_WEB_APP_POOL_IDENTITY_DOMAIN      AND (NOT WEB_APP_POOL_IDENTITY_DOMAIN)</Custom>
  107.         <Custom Action='SetWebAppPoolIdentityUsername'  After='AppSearch'>REG_WEB_APP_POOL_IDENTITY_USERNAME    AND (NOT WEB_APP_POOL_IDENTITY_USERNAME)</Custom>
  108.     </InstallUISequence>
  109.     <InstallExecuteSequence>
  110.         <!-- After='RemoveExistingProducts' is used under this sequence because of the use of MajorUpgrades -->
  111.         <Custom Action='SetWebAppName'                  After='RemoveExistingProducts'>REG_WEBSITE_NAME                     AND (NOT WEBSITE_NAME)</Custom>
  112.         <Custom Action='SetWebAppPoolName'              After='RemoveExistingProducts'>REG_WEB_APP_POOL_NAME                    AND (NOT WEB_APP_POOL_NAME)</Custom>
  113.         <Custom Action='SetWebAppPoolIdentityDomain'    After='RemoveExistingProducts'>REG_WEB_APP_POOL_IDENTITY_DOMAIN     AND (NOT WEB_APP_POOL_IDENTITY_DOMAIN)</Custom>
  114.         <Custom Action='SetWebAppPoolIdentityUsername'  After='RemoveExistingProducts'>REG_WEB_APP_POOL_IDENTITY_USERNAME   AND (NOT WEB_APP_POOL_IDENTITY_USERNAME)</Custom>
  115.     </InstallExecuteSequence>
  116.  
  117. </Include>
  118.        
  119. <?xml version="1.0" encoding="UTF-8"?>
  120. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"
  121.      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
  122.  
  123.     <!--NEVER EVER EVER EVER CHANGE THE UPGRADE CODE!!!!!!!!!!!!!!! -->
  124.     <?define UpgradeCode="PUT-GUID-HERE" ?>
  125.  
  126.     <Product Id="*" Name="ProductName" Language="1033" Version="X.X.X.X" Manufacturer="XYZ" UpgradeCode="$(var.UpgradeCode)">
  127.         <Package InstallerVersion="200" Compressed="yes" />
  128.  
  129.         <!-- This includes our properties that implement the "Remember Property" pattern -->
  130.         <?include Configuration.wxi ?>
  131.  
  132.         <Media Id="1" Cabinet="media.cab" EmbedCab="yes" />
  133.  
  134.         <MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" Schedule="afterInstallInitialize"
  135.                       DowngradeErrorMessage="A later version of this product is already installed. Setup will now exit."/>
  136.  
  137.         <!-- Creating default directory structure (INSTALLLOCATION be override by user, but it starts in Program Files) -->
  138.         <Directory Id="TARGETDIR" Name="SourceDir">
  139.             <Directory Id='ProgramFilesFolder' Name='PFiles'>
  140.                 <Directory Id="INSTALLLOCATION" Name="TheDefaultInstallFolderName">
  141.  
  142.                 </Directory>
  143.             </Directory>
  144.         </Directory>
  145.  
  146.         <Feature Id="F_Content" Title="Content" Level="1" Description="The website content" ConfigurableDirectory="INSTALLLOCATION">
  147.             <ComponentRef Id="C_RegistryEntries"/>
  148.             <!-- The C_WebAppContent can either be generated by the WiX tool "heat", or a hand-crafted set of content, this component is not included in this example -->
  149.             <ComponentGroupRef Id="C_WebAppContent" />
  150.         </Feature>
  151.  
  152.         <Feature Id="F_IISWebsite" Title="IIS Website" Description="The IIS website and application pool" Level="1">
  153.             <ComponentRef Id="C_IISWebsite" />
  154.         </Feature>
  155.  
  156.         <InstallExecuteSequence>
  157.         </InstallExecuteSequence>
  158.  
  159.         <!-- Specify UI -->
  160.         <UIRef Id="UIFlow" />
  161.     </Product>
  162. </Wix>
  163.        
  164. <?xml version="1.0" encoding="utf-8" ?>
  165. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension"
  166.      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  167.  
  168.     <Fragment>      
  169.         <DirectoryRef Id="INSTALLLOCATION">
  170.             <Component Id="C_IISWebsite" Guid="{PUT-GUID-HERE}" KeyPath="yes">
  171.                 <!-- This does not create a user, it's just an object that's referenced by the WebAppPool component -->
  172.                 <util:User Id="WebAppPoolUser" CreateUser="no" Name="[WEB_APP_POOL_IDENTITY_USERNAME]"
  173.                            Password="[WEB_APP_POOL_IDENTITY_PWD]" Domain="[WEB_APP_POOL_IDENTITY_DOMAIN]"/>
  174.  
  175.                 <!-- The "Identity" attritbute below needs to be set to "other" to use the util:User defined above -->
  176.                 <iis:WebAppPool Id="WebAppPool" Name="[WEB_APP_POOL_NAME]" Identity="other" User="WebAppPoolUser"/>
  177.  
  178.                 <iis:WebSite Id="DefaultWebSite" Description="[WEBSITE_NAME]" Directory="INSTALLLOCATION" >
  179.                     <iis:WebAddress Id="AllUnassigned" Port="80"/>
  180.                 </iis:WebSite>
  181.  
  182.                 <iis:WebVirtualDir Id="My.VirtualDir" Alias="App" Directory="INSTALLLOCATION" WebSite="DefaultWebSite">
  183.                     <iis:WebApplication Id="Application" Name="App" WebAppPool="WebAppPool"/>
  184.                 </iis:WebVirtualDir>
  185.             </Component>
  186.         </DirectoryRef>
  187.     </Fragment>
  188. </Wix>
  189.        
  190. <?xml version="1.0" encoding="utf-8" ?>
  191. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  192.     <Fragment>
  193.         <UI Id="UIFlow">
  194.             <!-- This uses the WixUI plugin -->
  195.             <UIRef Id="WixUI_FeatureTree" />
  196.             <UIRef Id="WixUI_ErrorProgressText" />
  197.  
  198.             <!-- Injection of custom UI. -->
  199.             <DialogRef Id="IisSetupDlg" />
  200.  
  201.             <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="IisSetupDlg" Order="3">LicenseAccepted = "1"</Publish>
  202.             <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="PoolSettingsDlg">1</Publish>
  203.         </UI>
  204.     </Fragment>
  205. </Wix>
  206.        
  207. <?xml version="1.0" encoding="utf-8" ?>
  208. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  209.     <Fragment>
  210.         <UI>
  211.             <Dialog Id="IisSetupDlg" Width="370" Height="270" Title="IIS Settings - [ProductName]" NoMinimize="yes">                
  212.                 <!-- Web App details prompt -->
  213.                 <Control Id="WebsiteNameLabel" Type="Text" X="45" Y="53" Width="100" Height="15" TabSkip="no" Text="&Website Name:" />
  214.                 <Control Id="WebsiteNameEdit" Type="Edit" X="45" Y="65" Width="220" Height="18" Property="WEBSITE_NAME" Text="{80}" />
  215.  
  216.                 <!-- Back button -->
  217.                 <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&Back">
  218.                     <Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
  219.                 </Control>
  220.  
  221.                 <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&Next">
  222.                     <Publish Event="NewDialog" Value="PoolSettingsDlg">
  223.                         <!--if settings are correct, allow next dialog-->
  224.                         <![CDATA[WEBSITE_NAME <> ""]]>
  225.                     </Publish>
  226.                 </Control>
  227.  
  228.                 <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
  229.                     <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
  230.                 </Control>
  231.  
  232.                 <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
  233.                 <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
  234.                     <Text>Please enter IIS Configuration</Text>
  235.                 </Control>
  236.  
  237.                 <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
  238.                 <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
  239.                     <Text>{WixUI_Font_Title}IIS Settings</Text>
  240.                 </Control>
  241.  
  242.                 <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
  243.             </Dialog>
  244.  
  245.             <Dialog Id="PoolSettingsDlg" Width="370" Height="300" Title="Application Pool Settings - [ProductName]" NoMinimize="yes">
  246.                 <!-- name of the application pool -->
  247.                 <Control Id="PoolNameLabel" Type="Text" X="45" Y="53" Width="100" Height="15" TabSkip="no" Text="&Pool name:" />
  248.                 <Control Id="PoolNameEdit" Type="Edit" X="45" Y="65" Width="220" Height="18" Property="WEB_APP_POOL_NAME" Text="{80}" />
  249.  
  250.                 <!-- domain -->
  251.                 <Control Id="DomainPoolLabel" Type="Text" X="45" Y="85" Width="100" Height="15" TabSkip="no" Text="&Domain for AppPool:" />
  252.                 <Control Id="DomainPoolEdit" Type="Edit" X="45" Y="97" Width="220" Height="18" Property="WEB_APP_POOL_IDENTITY_DOMAIN" Text="{80}" />
  253.  
  254.                 <!-- Login -->
  255.                 <Control Id="LoginPoolLabel" Type="Text" X="45" Y="117" Width="100" Height="15" TabSkip="no" Text="&Login for AppPool:" />
  256.                 <Control Id="LoginPoolEdit" Type="Edit" X="45" Y="129" Width="220" Height="18" Property="WEB_APP_POOL_IDENTITY_USERNAME" Text="{80}" />
  257.  
  258.                 <!-- Password -->
  259.                 <Control Id="PasswordPoolLabel" Type="Text" X="45" Y="149" Width="100" Height="15" TabSkip="no" Text="&Password for AppPool:" />
  260.                 <Control Id="PasswordPoolEdit" Type="Edit" X="45" Y="161" Width="220" Height="18" Property="WEB_APP_POOL_IDENTITY_PWD" Text="{80}" Password="yes" />
  261.  
  262.                 <!-- Back button -->
  263.                 <Control Id="Back" Type="PushButton" X="180" Y="264" Width="56" Height="17" Text="&Back">
  264.                     <Publish Event="NewDialog" Value="IisSetupDlg">1</Publish>
  265.                 </Control>
  266.                 <Control Id="Next" Type="PushButton" X="236" Y="264" Width="56" Height="17" Default="yes" Text="&Next">
  267.                     <Publish Event="NewDialog" Value="CustomizeDlg">
  268.                         <!--if settings are correct, allow next dialog-->
  269.                         <![CDATA[WEB_APP_POOL_NAME <> ""
  270.                                  or WEB_APP_POOL_IDENTITY_DOMAIN <> ""
  271.                                  or WEB_APP_POOL_IDENTITY_USERNAME <> ""
  272.                                  or WEB_APP_POOL_IDENTITY_PWD <> ""]]>
  273.                     </Publish>
  274.                 </Control>
  275.  
  276.                 <Control Id="Cancel" Type="PushButton" X="304" Y="264" Width="56" Height="17" Cancel="yes" Text="Cancel">
  277.                     <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
  278.                 </Control>
  279.  
  280.                 <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
  281.                 <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
  282.                     <Text>Please enter AppPool Configuration for IIS</Text>
  283.                 </Control>
  284.  
  285.                 <Control Id="BottomLine" Type="Line" X="0" Y="255" Width="370" Height="0" />
  286.                 <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
  287.                     <Text>{WixUI_Font_Title}Application Pool Settings</Text>
  288.                 </Control>
  289.  
  290.                 <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
  291.             </Dialog>
  292.         </UI>
  293.     </Fragment>
  294. </Wix>