2 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
4 <?if $(sys.BUILDARCH)="x64" ?>
5 <?define ArchSuffix=" 64-bit" ?>
7 <?define ArchSuffix="" ?>
10 <?if $(env.CFG_CHANNEL)="stable" ?>
11 <?define ProductName="Rust $(env.CFG_VER_MAJOR).$(env.CFG_VER_MINOR) ($(env.CFG_ABI)$(var.ArchSuffix))" ?>
13 <?define ProductName="Rust $(env.CFG_CHANNEL) $(env.CFG_VER_MAJOR).$(env.CFG_VER_MINOR) ($(env.CFG_ABI)$(var.ArchSuffix))" ?>
16 <?define BaseRegKey="Software\[Manufacturer]\Rust $(env.CFG_CHANNEL) ($(env.CFG_ABI)$(var.ArchSuffix))\$(env.CFG_VER_MAJOR).$(env.CFG_VER_MINOR)" ?>
18 <!-- Upgrade code should be different for each platform -->
19 <?if $(sys.BUILDARCH)="x64" ?>
20 <?if $(env.CFG_ABI)="GNU" ?>
21 <!-- UpgradeCode shoud stay the same for all MSI versions in channel -->
22 <?if $(env.CFG_CHANNEL)="stable" ?>
23 <?define UpgradeCode="B440B077-F8D1-4730-8E1D-D6D37702B4CE" ?>
24 <?elseif $(env.CFG_CHANNEL)="beta" ?>
25 <?define UpgradeCode="7205CEDC-CDA6-4B62-8E4E-4D19EC5D88FC" ?>
26 <?elseif $(env.CFG_CHANNEL)="nightly" ?>
27 <?define UpgradeCode="622497D9-E0B1-448E-838A-4A33D0C5F82C" ?>
28 <?elseif $(env.CFG_CHANNEL)="dev" ?>
29 <?define UpgradeCode="7D32FD99-BB26-45CF-935D-1B0593BBDDBE" ?>
31 <?elseif $(env.CFG_ABI)="MSVC" ?>
32 <?if $(env.CFG_CHANNEL)="stable" ?>
33 <?define UpgradeCode="123039F9-68E3-44F1-AC9F-C78ADD4D0723" ?>
34 <?elseif $(env.CFG_CHANNEL)="beta" ?>
35 <?define UpgradeCode="ABC640B9-2AB5-4270-9A0D-E54E502A1CCA" ?>
36 <?elseif $(env.CFG_CHANNEL)="nightly" ?>
37 <?define UpgradeCode="56263F12-4AA1-4FE1-AFAE-572915C4FA3E" ?>
38 <?elseif $(env.CFG_CHANNEL)="dev" ?>
39 <?define UpgradeCode="231A9544-7E39-4A60-A069-0EB3CA4BAB2E" ?>
42 <?define PlatformProgramFilesFolder="ProgramFiles64Folder" ?>
43 <?elseif $(sys.BUILDARCH)="x86" ?>
44 <?if $(env.CFG_ABI)="GNU" ?>
45 <?if $(env.CFG_CHANNEL)="stable" ?>
46 <?define UpgradeCode="1C7CADA5-D117-43F8-A356-DF15F9FBEFF6" ?>
47 <?elseif $(env.CFG_CHANNEL)="beta" ?>
48 <?define UpgradeCode="5229EAC1-AB7C-4A62-9881-6FAD2DE7D0F9" ?>
49 <?elseif $(env.CFG_CHANNEL)="nightly" ?>
50 <?define UpgradeCode="B94FF1C2-2C7B-4859-A08B-546815516FDA" ?>
51 <?elseif $(env.CFG_CHANNEL)="dev" ?>
52 <?define UpgradeCode="7E6D1349-2773-4792-B8CD-EA2685D86A99" ?>
54 <?elseif $(env.CFG_ABI)="MSVC" ?>
55 <?if $(env.CFG_CHANNEL)="stable" ?>
56 <?define UpgradeCode="5805719C-45E9-4CF6-9CE7-1E8B57F3C243" ?>
57 <?elseif $(env.CFG_CHANNEL)="beta" ?>
58 <?define UpgradeCode="BC0731C1-BED1-424C-BE99-3589C35C84DE" ?>
59 <?elseif $(env.CFG_CHANNEL)="nightly" ?>
60 <?define UpgradeCode="FF193BBC-E73B-4FBD-ADE0-12F3CFC84145" ?>
61 <?elseif $(env.CFG_CHANNEL)="dev" ?>
62 <?define UpgradeCode="87DFC303-6492-4E9B-911E-56EAD56C5E58" ?>
65 <?define PlatformProgramFilesFolder="ProgramFilesFolder" ?>
67 <?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?>
71 Name="$(var.ProductName)"
73 Version="$(env.CFG_VER_MAJOR).$(env.CFG_VER_MINOR).$(env.CFG_VER_PATCH).$(env.CFG_VER_BUILD)"
74 UpgradeCode="$(var.UpgradeCode)"
75 Manufacturer="The Rust Project Developers">
77 Comments="Rust is a systems programming language that runs blazingly fast, prevents almost all crashes, and eliminates data races."
78 InstallerVersion="200"
79 InstallPrivileges="elevated"
82 <Icon Id="rust.ico" SourceFile="rust-logo.ico" />
83 <Property Id="ApplicationFolderName" Value="Rust $(env.CFG_CHANNEL) $(env.CFG_ABI) $(env.CFG_VER_MAJOR).$(env.CFG_VER_MINOR)" />
84 <Property Id="WixAppFolder" Value="WixPerMachineFolder" />
85 <Property Id="ARPPRODUCTICON" Value="rust.ico" />
86 <Property Id="ARPURLINFOABOUT" Value="https://www.rust-lang.org/" />
87 <Property Id="ARPCOMMENTS" Value="$(env.CFG_RELEASE_INFO)" />
88 <!-- This is a dual-mode package. http://msdn.microsoft.com/en-us/library/windows/desktop/dd408068.aspx -->
89 <Property Id="ALLUSERS" Value="2" Secure="yes" />
90 <Property Id="MSIINSTALLPERUSER" Secure="yes" />
91 <!-- The actual install location (initialized below) -->
92 <Property Id="INSTALLDIR" Secure="yes" />
94 <!-- Detect path(s) of a previous installation. -->
95 <Property Id="INSTALLDIR_USER">
96 <RegistrySearch Id="InstallDir_User" Type="raw" Root="HKCU" Key="$(var.BaseRegKey)" Name="InstallDir" />
98 <Property Id="INSTALLDIR_MACHINE">
99 <RegistrySearch Id="InstallDir_Mach" Type="raw" Root="HKLM" Key="$(var.BaseRegKey)" Name="InstallDir" />
102 <!-- Set ALLUSERS to match the previous installation mode, otherwise FindRelatedProducts will ignore
103 the previous installation. If both INSTALLDIR_USER and INSTALLDIR_MACHINE are set, prefer the former. -->
104 <SetProperty Sequence="first" Before="FindRelatedProducts"
105 Id="ALLUSERS" Value="{}">INSTALLDIR_USER</SetProperty>
107 <!-- Set default values if RegSearch found nothing, or if we not upgrading -->
108 <SetProperty Sequence="both" Before="SetINSTALLDIR1"
109 Id="INSTALLDIR_USER" Value="[LocalAppDataFolder]Programs\[ApplicationFolderName]">NOT INSTALLDIR_USER</SetProperty>
110 <SetProperty Sequence="both" Before="SetINSTALLDIR1"
111 Id="INSTALLDIR_MACHINE" Value="[$(var.PlatformProgramFilesFolder)][ApplicationFolderName]">NOT INSTALLDIR_MACHINE</SetProperty>
113 <!-- Choose the default install location according to ALLUSERS (unless set from the command line) -->
114 <SetProperty Sequence="both" Action="SetINSTALLDIR1" Before="SetINSTALLDIR2"
115 Id="INSTALLDIR" Value="[INSTALLDIR_USER]">NOT INSTALLDIR AND NOT ALLUSERS</SetProperty>
116 <SetProperty Sequence="both" Action="SetINSTALLDIR2" Before="CostFinalize"
117 Id="INSTALLDIR" Value="[INSTALLDIR_MACHINE]">NOT INSTALLDIR AND ALLUSERS</SetProperty>
119 <SetProperty Sequence="ui" Before="CostFinalize"
120 Id="WixAppFolder" Value="WixPerUserFolder">NOT ALLUSERS</SetProperty>
122 <!-- UI sets ALLUSERS per user selection; progagate this choice to MSIINSTALLPERUSER before executing installation actions -->
123 <SetProperty Sequence="ui" Before="ExecuteAction"
124 Id="MSIINSTALLPERUSER" Value="1">NOT ALLUSERS</SetProperty>
126 <!-- Update ARPINSTALLLOCATION to match INSTALLDIR -->
127 <SetProperty Sequence="execute" Before="CostFinalize"
128 Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" />
130 <!-- Path of cmd.exe for the shortcut -->
131 <Property Id="SHORTCUTTARGET" Value="%windir%\System32\cmd.exe" />
132 <!-- Microsoft Installer will resolve any Enviroment Variables in the working directory at install time -->
133 <Property Id="SHORTCUTWKDIR" Value="%SystemDrive%\" />
136 <FindRelatedProducts After="AppSearch" />
138 <InstallExecuteSequence>
139 <FindRelatedProducts After="AppSearch" />
140 <RemoveExistingProducts Before="InstallInitialize" />
141 </InstallExecuteSequence>
143 <Upgrade Id="$(var.UpgradeCode)">
145 Minimum="$(env.CFG_VER_MAJOR).$(env.CFG_VER_MINOR).0"
146 Maximum="$(env.CFG_VER_MAJOR).$(env.CFG_VER_MINOR).65535"
149 MigrateFeatures="yes"
150 Property="UPGRADE_DETECTED"
154 <!-- Specifies a single cab file to be embedded in the installer's .msi. -->
155 <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
157 <!-- Send a WM_SETTINGCHANGE message to tell processes like explorer to update their
158 environments so any new command prompts get the updated %PATH% -->
159 <CustomActionRef Id="WixBroadcastEnvironmentChange" />
161 <!-- Installation directory and files are defined in Files.wxs -->
162 <Directory Id="TARGETDIR" Name="SourceDir">
163 <Directory Id="$(var.PlatformProgramFilesFolder)">
164 <Directory Id="INSTALLDIR" Name="Rust">
165 <!-- Root directories for every feature should have different IDs for correct work of heat.exe -->
166 <Directory Id="Rustc" Name="." />
167 <?if $(env.CFG_MINGW)="1" ?>
168 <Directory Id="Gcc" Name="." />
170 <Directory Id="Docs" Name="." />
171 <Directory Id="Cargo" Name="." />
172 <Directory Id="Std" Name="." />
173 <Directory Id="Rls" Name="." />
174 <Directory Id="Analysis" Name="." />
178 <!-- Record our install location -->
179 <Component Id="InstallDir" Guid="*">
180 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)"
183 Value="[INSTALLDIR]" />
186 <!-- Add $/bin to PATH -->
187 <Component Id="PathEnvPerMachine" Guid="*">
188 <Condition>ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)</Condition>
189 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="PathEnvPerMachine" Type="string" Value="1" KeyPath="yes" />
190 <!-- [INSTALLDIR] contains trailing backslash -->
191 <Environment Id="PathPerMachine" Name="PATH" Value="[INSTALLDIR]bin" Permanent="no" Part="last" Action="set" System="yes" />
193 <Component Id="PathEnvPerUser" Guid="*">
194 <Condition>ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))</Condition>
195 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="PathEnvPerUser" Type="string" Value="1" KeyPath="yes" />
196 <Environment Id="PathPerUser" Name="PATH" Value="[INSTALLDIR]bin" Permanent="no" Part="last" Action="set" System="no" />
199 <!-- Start Menu shortcuts -->
200 <Directory Id="ProgramMenuFolder">
201 <Directory Id="ApplicationProgramsFolder" Name="Rust">
202 <Component Id="RustShellShortcut" Guid="*">
203 <Shortcut Id="RustShell"
204 Name="$(var.ProductName) Shell"
205 Description="Opens Command Prompt with Rust tools directory added to the PATH"
206 Target="[SHORTCUTTARGET]"
207 Arguments="/K path [INSTALLDIR]bin;%PATH%"
208 WorkingDirectory="SHORTCUTWKDIR">
209 <Icon Id="rust2.ico" SourceFile="rust-logo.ico" />
211 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="RustShell" Type="integer" Value="1" KeyPath="yes" />
212 <RemoveFolder Id="ApplicationProgramsFolder1" On="uninstall" />
214 <Component Id="DocIndexShortcut" Guid="*">
215 <Shortcut Id="RustDocs"
216 Name="$(var.ProductName) Documentation"
217 Description="Opens Rust HTML documentation in the default browser"
218 Target="[INSTALLDIR]share\doc\rust\html\index.html" />
219 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="RustDocs" Type="integer" Value="1" KeyPath="yes" />
220 <RemoveFolder Id="ApplicationProgramsFolder2" On="uninstall" />
228 Title="Rust compiler and standard crates"
233 <ComponentGroupRef Id="RustcGroup" />
234 <ComponentRef Id="RustShellShortcut" />
235 <ComponentRef Id="InstallDir" />
238 Title="The Rust standard library"
242 <ComponentGroupRef Id="StdGroup" />
245 Title="Cargo, the Rust package manager"
249 <ComponentGroupRef Id="CargoGroup" />
251 <?if $(env.CFG_MINGW)="1" ?>
253 Title="Linker and platform libraries"
254 Description="If you choose to not install this component, you will require an external MinGW installation in order to create executables and libraries."
258 <ComponentGroupRef Id="GccGroup" />
262 Title="HTML documentation"
266 <ComponentGroupRef Id="DocsGroup" />
267 <ComponentRef Id="DocIndexShortcut" />
271 Description="Add Rust to PATH environment variable"
275 <ComponentRef Id="PathEnvPerMachine" />
276 <ComponentRef Id="PathEnvPerUser" />
279 Title="RLS, the Rust Language Server"
283 <ComponentGroupRef Id="RlsGroup" />
284 <ComponentGroupRef Id="AnalysisGroup" />
287 <UIRef Id="RustUI" />