1<?xml version="1.0" encoding="UTF-8"?> 2<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 3 4 <?if $(sys.BUILDARCH)="x64" ?> 5 <?define ArchSuffix=" 64-bit" ?> 6 <?else?> 7 <?define ArchSuffix="" ?> 8 <?endif?> 9 10 <?define ProductName="Wasmtime $(env.WT_VERSION) $(var.ArchSuffix))" ?> 11 12 <?define BaseRegKey="Software\[Manufacturer]\Wasmtime ($(sys.BUILDARCH))\$(env.WT_VERSION)" ?> 13 14 <Product Id="*" UpgradeCode="A00EBA3C-5C90-42DA-8176-3D46447D2211" Version="$(env.WT_VERSION)" Language="1033" Name="Wasmtime" Manufacturer="Crane Station"> 15 <Package InstallerVersion="300" Compressed="yes"/> 16 <Media Id="1" Cabinet="wasmtime.cab" EmbedCab="yes" /> 17 18 <InstallUISequence> 19 <FindRelatedProducts After="AppSearch" /> 20 </InstallUISequence> 21 <InstallExecuteSequence> 22 <FindRelatedProducts After="AppSearch" /> 23 <RemoveExistingProducts Before="InstallInitialize" /> 24 </InstallExecuteSequence> 25 26 <Directory Id="TARGETDIR" Name="SourceDir"> 27 <Directory Id="ProgramFiles64Folder"> 28 <Directory Id="INSTALLDIR" Name="Wasmtime"> 29 <Directory Id="BINDIR" Name="bin"/> 30 </Directory> 31 </Directory> 32 33 <!-- Record our install location --> 34 <Component Id="InstallDir" Guid="*"> 35 <RegistryKey Root='HKLM' Key='$(var.BaseRegKey)'> 36 <RegistryValue Type='string' Name='InstallDir' Value='[INSTALLDIR]'/> 37 </RegistryKey> 38 </Component> 39 40 <!-- Add install dir to PATH --> 41 <Component Id="PathEnvPerMachine" Guid="*"> 42 <!-- <Condition>ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)</Condition> --> 43 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="PathEnvPerMachine" Type="string" Value="1" KeyPath="yes" /> 44 <!-- [INSTALLDIR] contains trailing backslash --> 45 <Environment Id="PathPerMachine" Name="PATH" Value="[INSTALLDIR]bin" Permanent="no" Part="last" Action="set" System="yes" /> 46 </Component> 47 <Component Id="PathEnvPerUser" Guid="*"> 48 <!-- <Condition>ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))</Condition> --> 49 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="PathEnvPerUser" Type="string" Value="1" KeyPath="yes" /> 50 <Environment Id="PathPerUser" Name="PATH" Value="[INSTALLDIR]bin" Permanent="no" Part="last" Action="set" System="no" /> 51 </Component> 52 </Directory> 53 54 <DirectoryRef Id="INSTALLDIR"> 55 <Component Id="LICENSE" Guid="*"> 56 <File Id="LICENSE" Source="LICENSE" KeyPath="yes" Checksum="yes"/> 57 </Component> 58 <Component Id="README" Guid="*"> 59 <File Id="README.md" Source="README.md" KeyPath="yes" Checksum="yes"/> 60 </Component> 61 </DirectoryRef> 62 63 <DirectoryRef Id="BINDIR"> 64 <Component Id="wasmtime.exe" Guid="*"> 65 <File Id="wasmtime.exe" Source="target\x86_64-pc-windows-msvc\release\wasmtime.exe" KeyPath="yes" Checksum="yes"/> 66 </Component> 67 </DirectoryRef> 68 69 <Feature Id="InstallWasmtime" Title="Wasmtime" Level="1"> 70 <ComponentRef Id="wasmtime.exe" /> 71 <ComponentRef Id="LICENSE" /> 72 <ComponentRef Id="README" /> 73 <ComponentRef Id="InstallDir" /> 74 </Feature> 75 <Feature Id="AddToPath" 76 Title="Add to PATH" 77 Description="Add Wasmtime to PATH environment variable" 78 Level="1" 79 AllowAdvertise="no"> 80 <ComponentRef Id="PathEnvPerMachine" /> 81 <ComponentRef Id="PathEnvPerUser" /> 82 </Feature> 83 <CustomActionRef Id="WixBroadcastEnvironmentChange" /> 84 </Product> 85</Wix> 86