• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
3     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
4
5  <?define ProductName = "Node.js" ?>
6  <?define ProductDescription = "Node.js" ?>
7  <?define ProductAuthor = "Node.js Foundation" ?>
8
9  <?define RegistryKeyPath = "SOFTWARE\Node.js" ?>
10
11  <?define RepoDir="$(var.ProjectDir)..\..\..\" ?>
12  <?define SourceDir="$(var.RepoDir)\$(var.Configuration)\" ?>
13
14  <Product Id="*"
15           Name="$(var.ProductName)"
16           Language="!(loc.LocaleId)"
17           Version="$(var.ProductVersion)"
18           Manufacturer="$(var.ProductAuthor)"
19           UpgradeCode="47c07a3a-42ef-4213-a85d-8f5a59077c28">
20
21    <Package Languages="!(loc.LocaleId)"
22             InstallerVersion="200"
23             Compressed="yes"
24             InstallScope="perMachine"/>
25
26    <Condition Message="This application is only supported on Windows 8.1, Windows Server 2012 R2, or higher.">
27      <![CDATA[Installed OR (VersionNT >= 603) OR (VersionNT >= 602 AND MsiNTProductType <> 1)]]>
28    </Condition>
29
30    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes"/>
31
32    <MajorUpgrade AllowSameVersionUpgrades="yes"
33                  DowngradeErrorMessage="!(loc.MajorUpgrade_DowngradeErrorMessage)"/>
34
35    <Upgrade Id="1d60944c-b9ce-4a71-a7c0-0384eb884baa">
36      <UpgradeVersion Maximum="1.0.0"
37                      IncludeMaximum="no"
38                      Property="NODE_0X_DETECTED" />
39      <UpgradeVersion Minimum="1.0.0"
40                      IncludeMinimum="yes"
41                      Property="EARLY_IO_DETECTED" />
42    </Upgrade>
43
44    <Icon Id="NodeIcon" SourceFile="$(var.RepoDir)\src\res\node.ico"/>
45    <Property Id="ARPPRODUCTICON" Value="NodeIcon"/>
46    <Property Id="ApplicationFolderName" Value="nodejs"/>
47    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
48
49    <!-- PropertyRef of the account users for setting InstallDir permission explicitly -->
50    <PropertyRef Id="WIX_ACCOUNT_LOCALSYSTEM" />
51    <PropertyRef Id="WIX_ACCOUNT_USERS" />
52    <PropertyRef Id="WIX_ACCOUNT_ADMINISTRATORS" />
53
54    <Property Id="INSTALLDIR" Secure="yes">
55      <RegistrySearch Id="InstallPathRegistry"
56                      Type="raw"
57                      Root="HKLM"
58                      Key="$(var.RegistryKeyPath)"
59                      Name="InstallPath"/>
60      <!-- Also need to search under HKCU to support upgrading from old
61           versions. If we wanted to disable backward compatibility, this
62           second search could be deleted. -->
63      <RegistrySearch Id="InstallPathRegistryCU"
64                      Type="raw"
65                      Root="HKCU"
66                      Key="$(var.RegistryKeyPath)"
67                      Name="InstallPath"/>
68    </Property>
69
70    <Feature Id="NodeRuntime"
71             Level="1"
72             Title="!(loc.NodeRuntime_Title)"
73             Description="!(loc.NodeRuntime_Description)"
74             Absent="disallow">
75      <ComponentRef Id="NodeExecutable"/>
76      <ComponentRef Id="NodeRegistryEntries"/>
77      <ComponentRef Id="NodeVarsScript"/>
78      <ComponentRef Id="NodeStartMenu"/>
79      <ComponentRef Id="AppData" />
80      <ComponentRef Id="InstallToolsBat" />
81      <ComponentRef Id="SetInstallDirPermission" />
82      <ComponentGroupRef Id="Product.Generated"/>
83
84      <Feature Id="NodeEtwSupport"
85               Level="1"
86               Title="!(loc.NodeEtwSupport_Title)"
87               Description="!(loc.NodeEtwSupport_Description)">
88        <ComponentRef Id="NodeEtwSupport"/>
89      </Feature>
90    </Feature>
91
92    <Feature Id="corepack"
93             Level="1"
94             Title="!(loc.corepack_Title)"
95             Description="!(loc.corepack_Description)">
96      <ComponentRef Id="CorepackCmdScript"/>
97      <ComponentRef Id="CorepackBashScript"/>
98      <ComponentGroupRef Id="CorepackSourceFiles"/>
99    </Feature>
100
101    <Feature Id="npm"
102             Level="1"
103             Title="!(loc.npm_Title)"
104             Description="!(loc.npm_Description)">
105      <ComponentRef Id="NpmCmdScript"/>
106      <ComponentRef Id="NpmBashScript"/>
107      <ComponentRef Id="NpxCmdScript"/>
108      <ComponentRef Id="NpxBashScript"/>
109      <ComponentRef Id="NpmConfigurationFile"/>
110      <ComponentRef Id="AppData" />
111      <ComponentRef Id="SetInstallDirPermission" />
112      <ComponentGroupRef Id="NpmSourceFiles"/>
113    </Feature>
114
115    <Feature Level="1"
116             Id="DocumentationShortcuts"
117             Title="!(loc.DocumentationShortcuts_Title)"
118             Description="!(loc.DocumentationShortcuts_Description)">
119      <ComponentRef Id="DocumentationShortcuts"/>
120    </Feature>
121
122    <Feature Id="EnvironmentPath"
123             Level="1"
124             Title="!(loc.EnvironmentPath_Title)"
125             Description="!(loc.EnvironmentPath_Description)">
126      <Feature Id="EnvironmentPathNode"
127               Level="1"
128               Title="!(loc.EnvironmentPathNode_Title)"
129               Description="!(loc.EnvironmentPathNode_Description)">
130        <ComponentRef Id="EnvironmentPathNode"/>
131      </Feature>
132
133      <Feature Id="EnvironmentPathNpmModules"
134               Level="1"
135               Title="!(loc.EnvironmentPathNpmModules_Title)"
136               Description="!(loc.EnvironmentPathNpmModules_Description)">
137        <ComponentRef Id="EnvironmentPathNpmModules"/>
138      </Feature>
139    </Feature>
140
141    <Directory Id="TARGETDIR" Name="SourceDir">
142      <Directory Id="ProgramMenuFolder">
143        <Directory Id="ApplicationProgramsFolder" Name="Node.js"/>
144      </Directory>
145
146      <Directory Id="$(var.ProgramFilesFolderId)">
147        <Directory Id="INSTALLDIR" Name="nodejs">
148        </Directory>
149      </Directory>
150    </Directory>
151
152    <DirectoryRef Id="INSTALLDIR">
153      <Component Id="NodeExecutable">
154        <File Id="node.exe" KeyPath="yes" Source="$(var.SourceDir)\node.exe"/>
155      </Component>
156
157      <Component Id="NodeRegistryEntries">
158        <RegistryValue Root="HKLM"
159                       Key="$(var.RegistryKeyPath)"
160                       Name="InstallPath"
161                       Type="string"
162                       Value="[INSTALLDIR]"
163                       KeyPath="yes"/>
164        <RegistryValue Root="HKLM"
165                       Key="$(var.RegistryKeyPath)"
166                       Name="Version"
167                       Type="string"
168                       Value="$(var.ProductVersion)"/>
169      </Component>
170
171      <Component Id="NodeVarsScript">
172        <File Id="nodevars.bat" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\nodevars.bat"/>
173      </Component>
174
175      <Component Id="InstallToolsBat">
176        <File Id="InstallToolsBat" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\install_tools\install_tools.bat"/>
177      </Component>
178
179      <?if $(var.NoETW) != 1 ?>
180      <Component Id="NodeEtwSupport">
181        <File Id="node_etw_provider.man" Source="$(var.RepoDir)\src\res\node_etw_provider.man">
182          <util:EventManifest MessageFile="[INSTALLDIR]node.exe" ResourceFile="[INSTALLDIR]node.exe"/>
183        </File>
184      </Component>
185      <?endif?>
186    </DirectoryRef>
187
188    <DirectoryRef Id="INSTALLDIR">
189      <!-- Create component for setting the install directory permission explicitly -->
190      <Component Id="SetInstallDirPermission" Guid="{EFFC4F74-183A-4237-BBD7-0CAD2B950053}">
191        <CreateFolder>
192          <Permission User="[WIX_ACCOUNT_USERS]" GenericRead="yes" Traverse="yes" GenericExecute="yes" Synchronize="yes"
193                      GenericWrite="no" WriteAttributes="no" WriteExtendedAttributes="no"/>
194          <Permission User="[AUTHENTICATED_USERS]" GenericRead="yes" Traverse="yes" GenericExecute="yes" Synchronize="yes"
195                      GenericWrite="no" WriteAttributes="no" WriteExtendedAttributes="no"/>
196          <Permission User="[WIX_ACCOUNT_ADMINISTRATORS]" GenericAll="yes"/>
197          <Permission User="[WIX_ACCOUNT_LOCALSYSTEM]" GenericAll="yes"/>
198        </CreateFolder>
199      </Component>
200    </DirectoryRef>
201
202    <DirectoryRef Id="ApplicationProgramsFolder">
203      <Component Id="NodeStartMenu">
204        <!-- RegistryValue needed because every Component must have a KeyPath.
205             Because of ICE43, the Root must be HKCU. -->
206        <RegistryValue Root="HKCU"
207                       Key="$(var.RegistryKeyPath)\Components"
208                       Name="NodeStartMenuShortcuts"
209                       Type="integer"
210                       Value="1"
211                       KeyPath="yes"/>
212        <Shortcut Id="NodeVarsScriptShortcut"
213                  Name="Node.js command prompt"
214                  Target="[%ComSpec]"
215                  Arguments='/k "[INSTALLDIR]nodevars.bat"'
216                  Show="normal"
217                  WorkingDirectory="INSTALLDIR"/>
218        <Shortcut Id="InstallToolsShortcut"
219                  Name="Install Additional Tools for Node.js"
220                  Target="[%ComSpec]"
221                  Arguments='/d /c "[INSTALLDIR]install_tools.bat"'
222                  Show="normal"
223                  WorkingDirectory="INSTALLDIR"/>
224        <Shortcut Id="NodeExecutableShortcut"
225                  Name="Node.js"
226                  Target="[INSTALLDIR]node.exe"
227                  WorkingDirectory="INSTALLDIR"/>
228        <Shortcut Id="UninstallProduct"
229                  Name="Uninstall Node.js"
230                  Target="[SystemFolder]msiexec.exe"
231                  Arguments="/x [ProductCode]"/>
232        <RemoveFolder Id="RemoveApplicationProgramsFolder"
233                      On="uninstall"/>
234      </Component>
235    </DirectoryRef>
236
237    <DirectoryRef Id="INSTALLDIR">
238      <Component Id="CorepackCmdScript">
239        <File Id="corepack.cmd" KeyPath="yes" Source="$(var.CorepackSourceDir)\shims\nodewin\corepack.cmd"/>
240      </Component>
241
242      <Component Id="CorepackBashScript">
243        <File Id="corepack.sh" KeyPath="yes" Source="$(var.CorepackSourceDir)\shims\nodewin\corepack"/>
244      </Component>
245
246      <Component Id="NpmCmdScript">
247        <File Id="npm.cmd" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm.cmd"/>
248      </Component>
249
250      <Component Id="NpmBashScript">
251        <File Id="npm.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm"/>
252      </Component>
253
254      <Component Id="NpxCmdScript">
255        <File Id="npx.cmd" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npx.cmd"/>
256      </Component>
257
258      <Component Id="NpxBashScript">
259        <File Id="npx.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npx"/>
260      </Component>
261
262      <Directory Id="NodeModulesFolder" Name="node_modules">
263        <Directory Id="NpmFolder" Name="npm">
264          <Component Id="NpmConfigurationFile">
265            <File Id="npm.rc" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\npm\npmrc"/>
266          </Component>
267        </Directory>
268      </Directory>
269
270      <Directory Id="AppDataFolder">
271        <Directory Id="AppDataDir" Name="npm">
272          <Component Id="AppData" Guid="D3B35D0E-D0F9-4D11-A773-D4608E90E1D1">
273            <CreateFolder />
274            <RemoveFolder Id="AppDataDir" On="uninstall" />
275            <RegistryValue Root="HKCU" Key="$(var.RegistryKeyPath)\Components" Type="string" Value="" />
276          </Component>
277        </Directory>
278      </Directory>
279    </DirectoryRef>
280
281    <DirectoryRef Id="ApplicationProgramsFolder">
282      <Component Id="DocumentationShortcuts">
283        <RegistryValue Root="HKCU"
284                       Key="$(var.RegistryKeyPath)\Components"
285                       Name="DocumentationShortcuts"
286                       Type="integer"
287                       Value="1"
288                       KeyPath="yes"/>
289        <util:InternetShortcut Id="WebsiteShortcut"
290                               Name="Node.js website"
291                               Target="https://nodejs.org/"
292                               Type="url"/>
293        <util:InternetShortcut Id="DocsShortcut"
294                               Name="Node.js documentation"
295                               Target="https://nodejs.org/download/$(var.DistTypeDir)/v$(var.FullVersion)/docs/api/"
296                               Type="url"/>
297      </Component>
298    </DirectoryRef>
299
300    <DirectoryRef Id="INSTALLDIR">
301      <Component Id="EnvironmentPathNode">
302        <RegistryValue Root="HKLM"
303                       Key="$(var.RegistryKeyPath)\Components"
304                       Name="EnvironmentPathNode"
305                       Type="integer"
306                       Value="1"
307                       KeyPath="yes"/>
308        <Environment Id="EnvironmentPathNode"
309                     Action="set"
310                     Name="PATH"
311                     Part="last"
312                     System="yes"
313                     Value="[INSTALLDIR]"/>
314      </Component>
315
316      <Component Id="EnvironmentPathNpmModules">
317        <RegistryValue Root="HKCU"
318                       Key="$(var.RegistryKeyPath)\Components"
319                       Name="EnvironmentPathNpmModules"
320                       Type="integer"
321                       Value="1"
322                       KeyPath="yes"/>
323        <Environment Id="EnvironmentPathNpmModules"
324                     Action="set"
325                     Name="PATH"
326                     Part="last"
327                     System="no"
328                     Value="[AppDataFolder]npm"/>
329      </Component>
330    </DirectoryRef>
331
332    <Binary Id='CustomActionsDLL'
333            SourceFile='$(var.custom_actions.TargetDir)$(var.custom_actions.TargetName).dll' />
334
335    <CustomAction Id="SetInstallScope"
336                  BinaryKey="CustomActionsDLL"
337                  DllEntry="SetInstallScope"
338                  Execute="immediate"
339                  Return="check" />
340
341    <CustomAction Id="BroadcastEnvironmentUpdate"
342                  BinaryKey="CustomActionsDLL"
343                  DllEntry="BroadcastEnvironmentUpdate"
344                  Execute="immediate"
345                  Return="check" />
346
347    <CustomAction Id="GetLocalizedUserNames"
348                  BinaryKey="CustomActionsDLL"
349                  DllEntry="GetLocalizedUserNames"
350                  Execute="immediate"
351                  Return="check" />
352
353    <Property Id="WixShellExecTarget" Value="[#InstallToolsBat]" />
354    <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" />
355
356    <InstallUISequence>
357      <Custom Action='SetInstallScope' Before='FindRelatedProducts'/>
358    </InstallUISequence>
359
360    <InstallExecuteSequence>
361      <Custom Action='SetInstallScope' Before='FindRelatedProducts'/>
362      <Custom Action='GetLocalizedUserNames' After='SetInstallScope'/>
363      <Custom Action='BroadcastEnvironmentUpdate' After='InstallFinalize'/>
364    </InstallExecuteSequence>
365
366    <UI Id="NodeInstallUI">
367      <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8"/>
368      <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12"/>
369      <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes"/>
370
371      <Property Id="DefaultUIFont" Value="WixUI_Font_Normal"/>
372      <Property Id="WixUI_Mode" Value="FeatureTree"/>
373
374      <DialogRef Id="ErrorDlg"/>
375      <DialogRef Id="FatalError"/>
376      <DialogRef Id="FilesInUse"/>
377      <DialogRef Id="MsiRMFilesInUse"/>
378      <DialogRef Id="PrepareDlg"/>
379      <DialogRef Id="ProgressDlg"/>
380      <DialogRef Id="ResumeDlg"/>
381      <DialogRef Id="UserExit"/>
382      <DialogRef Id="WelcomeDlg"/>
383      <DialogRef Id="LicenseAgreementDlg"/>
384      <DialogRef Id="InstallDirDlg"/>
385      <DialogRef Id="BrowseDlg"/>
386      <DialogRef Id="InvalidDirDlg"/>
387      <Dialog Id="NativeToolsDlg" Width="370" Height="270" Title="!(loc.NativeToolsDlg_Title)">
388        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.NativeToolsDlgBannerBitmap)" />
389        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.NativeToolsDlgTitle)" />
390        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.NativeToolsDlgDescription)" />
391        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
392
393        <Control Id="Intro" Type="Text" X="20" Y="65" Width="330" Height="30" NoPrefix="yes" Text="!(loc.NativeToolsDlgIntro)" />
394        <Control Id="InstallCheckbox" Type="CheckBox" X="20" Y="105" Width="330" Height="30" Property="NATIVETOOLSCHECKBOX" CheckBoxValue="1" Text="!(loc.NativeToolsDlgInstallCheckbox)" />
395        <Control Id="ManualDetails" Type="Hyperlink" X="20" Y="140" Width="330" Height="30" Text="!(loc.NativeToolsDlgManualDetails)" />
396
397        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
398        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
399        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
400        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
401          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
402        </Control>
403      </Dialog>
404
405      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
406      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
407      <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
408      <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">LicenseAccepted = "1"</Publish>
409      <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
410      <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Order="20">1</Publish>
411      <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="10">1</Publish>
412      <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="10">1</Publish>
413      <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="20">1</Publish>
414      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
415      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
416      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>
417      <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
418      <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
419      <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
420      <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
421      <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
422      <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">Installed</Publish>
423      <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="2">NOT Installed</Publish>
424      <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="NativeToolsDlg">1</Publish>
425      <Publish Dialog="NativeToolsDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg">1</Publish>
426      <Publish Dialog="NativeToolsDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
427      <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">NATIVETOOLSCHECKBOX = 1</Publish>
428      <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
429
430      <Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="!(loc.WIXUI_EXITDIALOGOPTIONALTEXT)"/>
431    </UI>
432
433    <UIRef Id="WixUI_Common"/>
434    <UIRef Id="WixUI_ErrorProgressText"/>
435    <WixVariable Id="WixUIBannerBmp" Value="$(var.RepoDir)\doc\thin-white-stripe.jpg"/>
436    <WixVariable Id="WixUIDialogBmp" Value="$(var.RepoDir)\doc\full-white-stripe.jpg"/>
437    <WixVariable Id="WixUILicenseRtf" Value="$(var.SourceDir)\LICENSE.rtf"/>
438  </Product>
439
440</Wix>
441