source.wxs.erb 4.84 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?xml version='1.0'?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

  <!-- This is how we include wxi files -->
  <?include "parameters.wxi" ?>

  <!--
    Id="*" is to enable upgrading. * means that the product ID will be autogenerated on each build.
    Name is made of localized product name and version number.
  -->
  <Product Id="*" Name="!(loc.ProductName) v$(var.DisplayVersionNumber)" Language="!(loc.LANG)"
          Version="$(var.VersionNumber)" Manufacturer="!(loc.ManufacturerName)" UpgradeCode="$(var.UpgradeCode)">

    <!--
15
      Minimum installer version (2.0) - Window XP and above.
Salim Alam's avatar
Salim Alam committed
16
      The install scope is per machine, not the current user
17
    -->
18
    <Package InstallerVersion="200" InstallPrivileges="elevated"
Salim Alam's avatar
Salim Alam committed
19
             Compressed="yes" InstallScope="perMachine" />
20 21 22

    <Media Id="1" Cabinet="Project.cab" EmbedCab="yes" CompressionLevel="high" />

23 24 25 26 27 28 29
    <!--
      Take advantage of Windows Installer 5.0 feature (if available) to disable 
      checkpointing and other costings that take significant amounts of time 
      ref: https://msdn.microsoft.com/en-us/library/windows/desktop/dd408005(v=vs.85).aspx
    -->
    <Property Id="MSIFASTINSTALL" Value="7" />

30 31 32 33 34
    <!--
      Uncomment launch condition below to check for minimum OS
      601 = Windows 7/Server 2008R2.
    -->
    <!-- Condition Message="!(loc.MinimumOSVersionMessage)">
Salim Alam's avatar
Salim Alam committed
35
      <![CDATA[Installed OR VersionNT >= 601]]>
36
    </Condition -->
Salim Alam's avatar
Salim Alam committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

    <!-- We always do Major upgrades -->
    <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" />

    <!--
      If fastmsi is set, custom actions will be invoked during install to unzip
      project files, and during uninstall to remove the project folder
    -->
    <% if fastmsi %>
    <SetProperty Id="FastUnzip"
                 Value="FASTZIPDIR=[INSTALLLOCATION];FASTZIPAPPNAME=chefdk"
                 Sequence="execute"
                 Before="FastUnzip" />

    <CustomAction Id="FastUnzip"
                  BinaryKey="CustomActionFastMsiDLL"
                  DllEntry="FastUnzip"
                  Execute="deferred"
                  Return="check" />

    <Binary Id="CustomActionFastMsiDLL"
            SourceFile="CustomActionFastMsi.CA.dll" />

    <CustomAction Id="Cleanup"
                  Directory="INSTALLLOCATION"
                  ExeCommand="cmd /C &quot;rd /S /Q chefdk&quot;"
                  Execute="deferred"
                  Return="ignore" />
65 66

    <InstallExecuteSequence>
Salim Alam's avatar
Salim Alam committed
67 68
      <Custom Action="FastUnzip" After="InstallFiles">NOT Installed</Custom>
      <Custom Action="Cleanup" After="RemoveFiles">REMOVE~="ALL"</Custom>
69 70
    </InstallExecuteSequence>

Salim Alam's avatar
Salim Alam committed
71 72 73 74 75
    <UI>
      <ProgressText Action="FastUnzip">!(loc.FileExtractionProgress)</ProgressText>
    </UI>
    <% end %>

76
    <Directory Id="TARGETDIR" Name="SourceDir">
77
      <Directory Id="WINDOWSVOLUME">
78 79 80 81 82 83
<% hierarchy.each.with_index do |(name, id), index| -%>
        <%= '  '*index %><Directory Id="<%= id %>" Name="<%= name %>">
<% end -%>
<% hierarchy.keys.each.with_index do |_, index| -%>
        <%= '  '*(hierarchy.size - index-1) %></Directory>
<% end -%>
84 85 86
      </Directory>
    </Directory>

87 88
    <SetDirectory Id="WINDOWSVOLUME" Value="[WindowsVolume]" />

89
    <!-- Set the components defined in our fragment files that will be used for our feature  -->
90
    <Feature Id="ProjectFeature" Title="!(loc.FeatureMainName)" Absent="disallow" AllowAdvertise="no" Level="1" ConfigurableDirectory="<%= wix_install_dir %>">
91 92 93
      <ComponentGroupRef Id="ProjectDir" />
    </Feature>

Seth Vargo's avatar
Seth Vargo committed
94
    <!-- UI Stuff -->
95 96 97
    <Icon Id="project.ico" SourceFile="Resources\assets\project_16x16.ico"/>
    <Property Id="ARPPRODUCTICON" Value="project.ico" />
    <Property Id="ARPHELPLINK" Value="http://www.getchef.com/" />
98
    <Property Id="WIXUI_INSTALLDIR" Value="<%= wix_install_dir %>" />
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117

    <UIRef Id="ProjectUI_InstallDir"/>
    <UI Id="ProjectUI_InstallDir">
      <UIRef Id="WixUI_FeatureTree"/>
      <TextStyle Id="WixUI_Font_Normal_White" FaceName="Tahoma" Size="8" Red="255" Green="255" Blue="255" />
      <TextStyle Id="WixUI_Font_Bigger_White" FaceName="Tahoma" Size="12" Red="255" Green="255" Blue="255" />
      <TextStyle Id="WixUI_Font_Title_White" FaceName="Tahoma" Size="9" Bold="yes" Red="255" Green="255" Blue="255" />
    </UI>

    <WixVariable Id="WixUILicenseRtf" Value="Resources\assets\LICENSE.rtf" />
    <WixVariable Id="WixUIDialogBmp" Value="Resources\assets\dialog_background.bmp" />
    <WixVariable Id="WixUIBannerBmp" Value="Resources\assets\banner_background.bmp" />

    <WixVariable Id="WixUIExclamationIco" Value="Resources\assets\project_32x32.ico" />
    <WixVariable Id="WixUIInfoIco" Value="Resources\assets\project_32x32.ico" />
    <WixVariable Id="WixUINewIco" Value="Resources\assets\project_16x16.ico" />
    <WixVariable Id="WixUIUpIco" Value="Resources\assets\project_16x16.ico" />
  </Product>
</Wix>