github.com/bananabytelabs/wazero@v0.0.0-20240105073314-54b22a776da8/packaging/msi/wazero.wxs (about)

     1  <?xml version="1.0" encoding="UTF-8"?>
     2  <!--
     3      Copyright 2023 Tetrate
     4  
     5      Licensed under the Apache License, Version 2.0 (the "License");
     6      you may not use this file except in compliance with the License.
     7      You may obtain a copy of the License at
     8  
     9          http://www.apache.org/licenses/LICENSE-2.0
    10  
    11      Unless required by applicable law or agreed to in writing, software
    12      distributed under the License is distributed on an "AS IS" BASIS,
    13      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14      See the License for the specific language governing permissions and
    15      limitations under the License.
    16  -->
    17  <!-- This builds a minimal package of wazero. The only required variable is Version
    18       Ex. `candle.exe -dVersion=0.6.1`
    19  
    20       While all options used are documented, the initial version of this file was helped by:
    21       * cloudflared - https://github.com/cloudflare/cloudflared/commit/38af26e232d6a5fd981d40981b702a1d06a3b8ee
    22       * podman - https://github.com/containers/podman/commit/b6b0b6e8bd0f8c75fe9411f722a43f9305c6137a -->
    23  <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    24  
    25      <?ifndef var.Version?>
    26      <?error Version must be defined. Ex. candle -dVersion=0.6.1?>
    27      <?endif?>
    28  
    29      <?ifndef var.Bin?>
    30      <?define Bin = "dist/wazero_windows_amd64/wazero.exe" ?>
    31      <?endif?>
    32  
    33      <!-- UpgradeCode needs to be constant until an incompatible change occurs
    34           See https://docs.microsoft.com/en-us/windows/win32/msi/upgrade-table -->
    35      <?ifndef var.UpgradeCode?>
    36      <?define UpgradeCode = "bef1bfc9-a5fc-4819-988f-807e47312f57" ?>
    37      <?endif?>
    38  
    39      <!-- Id="*" means it will be automatically generated: TODO: Consider if we should version-correlate the Id
    40  
    41           wazero help statements currently only render in one language. Set it accordingly.
    42           Language="1033" - English Codepage="1252" - ANSI US English
    43           https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-ucoderef/28fefe92-d66c-4b03-90a9-97b473223d43
    44           -->
    45      <Product Id="*" Name="wazero" Manufacturer="Tetrate"  Version="$(var.Version)" UpgradeCode="$(var.UpgradeCode)"
    46               Language="1033" Codepage="1252">
    47  
    48          <Package Id="*" Keywords="Installer" Description="wazero installer" Manufacturer="Tetrate"
    49                   InstallerVersion="310" Languages="1033" Compressed="yes" SummaryCodepage="1252" Platform="x64" />
    50  
    51          <!-- wazero.exe is embedded inside the installer: wazero.msi
    52               Cabinet="Wazero.cab" because light.exe fails on "wazero.cab" -->
    53          <Media Id="1" Cabinet="Wazero.cab" EmbedCab="yes"/>
    54  
    55          <!-- We allow the special version 0.0.1.1 in order to run tests. Releases will always be real versions. -->
    56          <Upgrade Id="$(var.UpgradeCode)">
    57              <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/>
    58              <UpgradeVersion Minimum="0.0.0" Maximum="$(var.Version)" IncludeMinimum="yes" IncludeMaximum="no"
    59                              Property="OLDERVERSIONBEINGUPGRADED"/>
    60          </Upgrade>
    61          <Condition Message="A newer version of wazero is already installed.">NOT NEWERVERSIONDETECTED</Condition>
    62  
    63          <!-- Use standard properties as it is easier to comment values vs XML attributes.
    64               See https://docs.microsoft.com/en-us/windows/win32/msi/property-reference -->
    65          <Property Id="ARPURLINFOABOUT" Value="https://wazero.io"/>
    66  
    67          <!-- There's currently no use case for control-panel based repair or modify -->
    68          <Property Id="ARPNOREPAIR" Value="1"/>
    69          <Property Id="ARPNOMODIFY" Value="1"/>
    70  
    71          <Property Id="ALLUSERS" Secure="yes"/>
    72  
    73          <!-- On Windows, when Id="TARGETDIR" Name="SourceDir": it will error otherwise -->
    74          <Directory Id="TARGETDIR" Name="SourceDir">
    75              <Directory Id="ProgramFiles64Folder">
    76                  <Directory Id="INSTALLDIR" Name="wazero">
    77                      <Component Id="WazeroBin" Guid="*">
    78                          <RemoveFolder Id="INSTALLDIR" On="uninstall"/>
    79                          <!-- KeyPath="yes" - means this will be looked at to see if it is already installed -->
    80                          <File Id="ExecutableFile" Name="wazero.exe" KeyPath="yes" Source="$(var.Bin)"/>
    81                      </Component>
    82                  </Directory>
    83              </Directory>
    84  
    85              <Component Id="Path" Guid="{fb130dec-3828-4ebc-b253-e7368cba14e8}">
    86                  <Environment Id="PATH" Name="PATH" Value="[INSTALLDIR]" Permanent="no" Part="last" Action="set" System="no" />
    87              </Component>
    88  
    89          </Directory>
    90  
    91          <!-- Use most common size 48x48 for the Add/Remove programs -->
    92          <Icon Id="icon.ico" SourceFile="packaging/icon@48w.ico"/>
    93          <Property Id="ARPPRODUCTICON" Value="icon.ico"/>
    94  
    95          <Feature Id="Complete" Level="1">
    96              <ComponentRef Id="WazeroBin"/>
    97              <ComponentRef Id="Path" />
    98          </Feature>
    99  
   100          <InstallExecuteSequence>
   101              <RemoveExistingProducts Before="InstallInitialize"/>
   102          </InstallExecuteSequence>
   103      </Product>
   104  </Wix>