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 <!-- tool-rls-start -->
174 <Directory Id="Rls" Name="." />
175 <Directory Id="Analysis" Name="." />
176 <!-- tool-rls-end -->
180 <!-- Record our install location -->
181 <Component Id="InstallDir" Guid="*">
182 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)"
185 Value="[INSTALLDIR]" />
188 <!-- Add $/bin to PATH -->
189 <Component Id="PathEnvPerMachine" Guid="*">
190 <Condition>ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)</Condition>
191 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="PathEnvPerMachine" Type="string" Value="1" KeyPath="yes" />
192 <!-- [INSTALLDIR] contains trailing backslash -->
193 <Environment Id="PathPerMachine" Name="PATH" Value="[INSTALLDIR]bin" Permanent="no" Part="last" Action="set" System="yes" />
195 <Component Id="PathEnvPerUser" Guid="*">
196 <Condition>ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))</Condition>
197 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="PathEnvPerUser" Type="string" Value="1" KeyPath="yes" />
198 <Environment Id="PathPerUser" Name="PATH" Value="[INSTALLDIR]bin" Permanent="no" Part="last" Action="set" System="no" />
201 <!-- Start Menu shortcuts -->
202 <Directory Id="ProgramMenuFolder">
203 <Directory Id="ApplicationProgramsFolder" Name="Rust">
204 <Component Id="RustShellShortcut" Guid="*">
205 <Shortcut Id="RustShell"
206 Name="$(var.ProductName) Shell"
207 Description="Opens Command Prompt with Rust tools directory added to the PATH"
208 Target="[SHORTCUTTARGET]"
209 Arguments="/K path [INSTALLDIR]bin;%PATH%"
210 WorkingDirectory="SHORTCUTWKDIR">
211 <Icon Id="rust2.ico" SourceFile="rust-logo.ico" />
213 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="RustShell" Type="integer" Value="1" KeyPath="yes" />
214 <RemoveFolder Id="ApplicationProgramsFolder1" On="uninstall" />
216 <Component Id="DocIndexShortcut" Guid="*">
217 <Shortcut Id="RustDocs"
218 Name="$(var.ProductName) Documentation"
219 Description="Opens Rust HTML documentation in the default browser"
220 Target="[INSTALLDIR]share\doc\rust\html\index.html" />
221 <RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="RustDocs" Type="integer" Value="1" KeyPath="yes" />
222 <RemoveFolder Id="ApplicationProgramsFolder2" On="uninstall" />
230 Title="Rust compiler and standard crates"
235 <ComponentGroupRef Id="RustcGroup" />
236 <ComponentRef Id="RustShellShortcut" />
237 <ComponentRef Id="InstallDir" />
240 Title="The Rust standard library"
244 <ComponentGroupRef Id="StdGroup" />
247 Title="Cargo, the Rust package manager"
251 <ComponentGroupRef Id="CargoGroup" />
253 <?if $(env.CFG_MINGW)="1" ?>
255 Title="Linker and platform libraries"
256 Description="If you choose to not install this component, you will require an external MinGW installation in order to create executables and libraries."
260 <ComponentGroupRef Id="GccGroup" />
264 Title="HTML documentation"
268 <ComponentGroupRef Id="DocsGroup" />
269 <ComponentRef Id="DocIndexShortcut" />
273 Description="Add Rust to PATH environment variable"
277 <ComponentRef Id="PathEnvPerMachine" />
278 <ComponentRef Id="PathEnvPerUser" />
280 <!-- tool-rls-start -->
282 Title="RLS, the Rust Language Server"
286 <ComponentGroupRef Id="RlsGroup" />
287 <ComponentGroupRef Id="AnalysisGroup" />
289 <!-- tool-rls-end -->
291 <UIRef Id="RustUI" />