|
5 | 5 | <?endif?> |
6 | 6 |
|
7 | 7 | <!-- Define a unique UpgradeCode per platform --> |
8 | | -<?define UpgradeCode=8CFB9531-B959-4E1B-AA2E-4AF0FFCC4AF4?> |
| 8 | +<?if $(var.Platform) = "x64"?> |
| 9 | +<?define InstallerVersion = "200"?> |
| 10 | +<?define UpgradeCode = "8CFB9531-B959-4E1B-AA2E-4AF0FFCC4AF4"?> |
| 11 | +<?define ProgramFilesFolder = "ProgramFiles64Folder"?> |
| 12 | +<?elseif $(var.Platform) = "x86"?> |
| 13 | +<?define InstallerVersion = "200"?> |
| 14 | +<?define UpgradeCode = "767EC5D2-C8F0-4912-9901-45E21F59A284"?> |
| 15 | +<?define ProgramFilesFolder = "ProgramFilesFolder"?> |
| 16 | +<?elseif $(var.Platform) = "arm64"?> |
| 17 | +<?define InstallerVersion = "500"?> |
| 18 | +<?define UpgradeCode = "5D15E95C-F979-41B0-826C-C33C8CB5A7EB"?> |
| 19 | +<?define ProgramFilesFolder = "ProgramFiles64Folder"?> |
| 20 | +<?elseif $(var.Platform) = "arm"?> |
| 21 | +<?define InstallerVersion = "500"?> |
| 22 | +<?define UpgradeCode = "DDDE52AA-42DA-404B-9238-77DC86117CFF"?> |
| 23 | +<?define ProgramFilesFolder = "ProgramFilesFolder"?> |
| 24 | +<?endif?> |
9 | 25 |
|
10 | 26 | <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> |
11 | 27 | <Product Id="*" Name="GitHub CLI" Version="$(var.ProductVersion)" Language="1033" Manufacturer="GitHub, Inc." UpgradeCode="$(var.UpgradeCode)"> |
12 | | - <Package Compressed="yes" InstallerVersion="200" InstallScope="perMachine"/> |
| 28 | + <Package Compressed="yes" InstallerVersion="$(var.InstallerVersion)" InstallScope="perMachine"/> |
13 | 29 | <MediaTemplate EmbedCab="yes"/> |
14 | 30 |
|
15 | 31 | <!-- Remove older product(s) early but within the transaction --> |
|
21 | 37 | </Upgrade> |
22 | 38 |
|
23 | 39 | <Directory Id="TARGETDIR" Name="SourceDir"> |
24 | | - <Directory Id="ProgramFiles64Folder" Name="Program Files"> |
| 40 | + <Directory Id="$(var.ProgramFilesFolder)" Name="Program Files"> |
25 | 41 | <Directory Id="INSTALLDIR" Name="GitHub CLI"/> |
26 | 42 | </Directory> |
27 | 43 | </Directory> |
|
35 | 51 | <!-- @Guid will be automatically and durably assigned based on key path --> |
36 | 52 | <Component Directory="INSTALLDIR"> |
37 | 53 | <File Name="gh.exe"/> |
| 54 | + <Environment Id="Path" Action="set" Name="PATH" Part="last" System="yes" Value="[INSTALLDIR]"/> |
38 | 55 | </Component> |
39 | 56 |
|
40 | 57 | <!-- Persist the INSTALLDIR and restore it in subsequent installs --> |
41 | 58 | <Component Directory="INSTALLDIR"> |
42 | 59 | <RegistryValue Root="HKLM" Key="SOFTWARE\GitHub\CLI" Name="InstallDir" Type="string" Value="[INSTALLDIR]"/> |
43 | 60 | </Component> |
44 | 61 |
|
45 | | - <Component Id="Env" Guid="94FAAC3D-4478-431C-8497-FBA55DCFB249" Directory="TARGETDIR"> |
46 | | - <Environment Id="Path" Action="set" Name="PATH" Part="last" System="yes" Value="[INSTALLDIR]"/> |
| 62 | + <Component Id="OlderX86Env" Guid="50C15744-A674-404B-873C-6B58957E2A32" Directory="TARGETDIR" Win64="no"> |
| 63 | + <Condition><![CDATA[OLDERX86VERSIONDETECTED]]></Condition> |
| 64 | + |
| 65 | + <!-- Clean up the old x86 package default directory from the user environment --> |
| 66 | + <Environment Id="OlderX86Path" Action="remove" Name="PATH" Part="last" System="no" Value="[ProgramFilesFolder]GitHub CLI\"/> |
47 | 67 | </Component> |
48 | 68 | </Feature> |
49 | 69 |
|
|
0 commit comments