• 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="InstallToolsBat" />
80      <ComponentRef Id="SetInstallDirPermission" />
81      <ComponentGroupRef Id="Product.Generated"/>
82
83      <Feature Id="NodeEtwSupport"
84               Level="1"
85               Title="!(loc.NodeEtwSupport_Title)"
86               Description="!(loc.NodeEtwSupport_Description)">
87        <ComponentRef Id="NodeEtwSupport"/>
88      </Feature>
89    </Feature>
90
91    <Feature Id="corepack"
92             Level="1"
93             Title="!(loc.corepack_Title)"
94             Description="!(loc.corepack_Description)">
95      <ComponentRef Id="CorepackCmdScript"/>
96      <ComponentRef Id="CorepackBashScript"/>
97      <ComponentGroupRef Id="CorepackSourceFiles"/>
98    </Feature>
99
100    <Feature Id="npm"
101             Level="1"
102             Title="!(loc.npm_Title)"
103             Description="!(loc.npm_Description)">
104      <ComponentRef Id="NpmCmdScript"/>
105      <ComponentRef Id="NpmBashScript"/>
106      <ComponentRef Id="NpxCmdScript"/>
107      <ComponentRef Id="NpxBashScript"/>
108      <ComponentRef Id="NpmConfigurationFile"/>
109      <ComponentRef Id="SetInstallDirPermission" />
110      <ComponentGroupRef Id="NpmSourceFiles"/>
111    </Feature>
112
113    <Feature Level="1"
114             Id="DocumentationShortcuts"
115             Title="!(loc.DocumentationShortcuts_Title)"
116             Description="!(loc.DocumentationShortcuts_Description)">
117      <ComponentRef Id="DocumentationShortcuts"/>
118    </Feature>
119
120    <Feature Id="EnvironmentPath"
121             Level="1"
122             Title="!(loc.EnvironmentPath_Title)"
123             Description="!(loc.EnvironmentPath_Description)">
124      <Feature Id="EnvironmentPathNode"
125               Level="1"
126               Title="!(loc.EnvironmentPathNode_Title)"
127               Description="!(loc.EnvironmentPathNode_Description)">
128        <ComponentRef Id="EnvironmentPathNode"/>
129      </Feature>
130
131      <Feature Id="EnvironmentPathNpmModules"
132               Level="1"
133               Title="!(loc.EnvironmentPathNpmModules_Title)"
134               Description="!(loc.EnvironmentPathNpmModules_Description)">
135        <ComponentRef Id="EnvironmentPathNpmModules"/>
136      </Feature>
137    </Feature>
138
139    <Directory Id="TARGETDIR" Name="SourceDir">
140      <Directory Id="ProgramMenuFolder">
141        <Directory Id="ApplicationProgramsFolder" Name="Node.js"/>
142      </Directory>
143
144      <Directory Id="$(var.ProgramFilesFolderId)">
145        <Directory Id="INSTALLDIR" Name="nodejs">
146        </Directory>
147      </Directory>
148    </Directory>
149
150    <DirectoryRef Id="INSTALLDIR">
151      <Component Id="NodeExecutable">
152        <File Id="node.exe" KeyPath="yes" Source="$(var.SourceDir)\node.exe"/>
153      </Component>
154
155      <Component Id="NodeRegistryEntries">
156        <RegistryValue Root="HKLM"
157                       Key="$(var.RegistryKeyPath)"
158                       Name="InstallPath"
159                       Type="string"
160                       Value="[INSTALLDIR]"
161                       KeyPath="yes"/>
162        <RegistryValue Root="HKLM"
163                       Key="$(var.RegistryKeyPath)"
164                       Name="Version"
165                       Type="string"
166                       Value="$(var.ProductVersion)"/>
167      </Component>
168
169      <Component Id="NodeVarsScript">
170        <File Id="nodevars.bat" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\nodevars.bat"/>
171      </Component>
172
173      <Component Id="InstallToolsBat">
174        <File Id="InstallToolsBat" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\install_tools\install_tools.bat"/>
175      </Component>
176
177      <?if $(var.NoETW) != 1 ?>
178      <Component Id="NodeEtwSupport">
179        <File Id="node_etw_provider.man" Source="$(var.RepoDir)\src\res\node_etw_provider.man">
180          <util:EventManifest MessageFile="[INSTALLDIR]node.exe" ResourceFile="[INSTALLDIR]node.exe"/>
181        </File>
182      </Component>
183      <?endif?>
184    </DirectoryRef>
185
186    <DirectoryRef Id="INSTALLDIR">
187      <!-- Create component for setting the install directory permission explicitly -->
188      <Component Id="SetInstallDirPermission" Guid="{EFFC4F74-183A-4237-BBD7-0CAD2B950053}">
189        <CreateFolder>
190          <Permission User="[WIX_ACCOUNT_USERS]" GenericRead="yes" Traverse="yes" GenericExecute="yes" Synchronize="yes"
191                      GenericWrite="no" WriteAttributes="no" WriteExtendedAttributes="no"/>
192          <Permission User="[AUTHENTICATED_USERS]" GenericRead="yes" Traverse="yes" GenericExecute="yes" Synchronize="yes"
193                      GenericWrite="no" WriteAttributes="no" WriteExtendedAttributes="no"/>
194          <Permission User="[WIX_ACCOUNT_ADMINISTRATORS]" GenericAll="yes"/>
195          <Permission User="[WIX_ACCOUNT_LOCALSYSTEM]" GenericAll="yes"/>
196        </CreateFolder>
197      </Component>
198    </DirectoryRef>
199
200    <DirectoryRef Id="ApplicationProgramsFolder">
201      <Component Id="NodeStartMenu">
202        <!-- RegistryValue needed because every Component must have a KeyPath.
203             Because of ICE43, the Root must be HKCU. -->
204        <RegistryValue Root="HKCU"
205                       Key="$(var.RegistryKeyPath)\Components"
206                       Name="NodeStartMenuShortcuts"
207                       Type="integer"
208                       Value="1"
209                       KeyPath="yes"/>
210        <Shortcut Id="NodeVarsScriptShortcut"
211                  Name="Node.js command prompt"
212                  Target="[%ComSpec]"
213                  Arguments='/k "[INSTALLDIR]nodevars.bat"'
214                  Show="normal"
215                  WorkingDirectory="INSTALLDIR"/>
216        <Shortcut Id="InstallToolsShortcut"
217                  Name="Install Additional Tools for Node.js"
218                  Target="[%ComSpec]"
219                  Arguments='/d /c "[INSTALLDIR]install_tools.bat"'
220                  Show="normal"
221                  WorkingDirectory="INSTALLDIR"/>
222        <Shortcut Id="NodeExecutableShortcut"
223                  Name="Node.js"
224                  Target="[INSTALLDIR]node.exe"
225                  WorkingDirectory="INSTALLDIR"/>
226        <Shortcut Id="UninstallProduct"
227                  Name="Uninstall Node.js"
228                  Target="[SystemFolder]msiexec.exe"
229                  Arguments="/x [ProductCode]"/>
230        <RemoveFolder Id="RemoveApplicationProgramsFolder"
231                      On="uninstall"/>
232      </Component>
233    </DirectoryRef>
234
235    <DirectoryRef Id="INSTALLDIR">
236      <Component Id="CorepackCmdScript">
237        <File Id="corepack.cmd" KeyPath="yes" Source="$(var.CorepackSourceDir)\shims\nodewin\corepack.cmd"/>
238      </Component>
239
240      <Component Id="CorepackBashScript">
241        <File Id="corepack.sh" KeyPath="yes" Source="$(var.CorepackSourceDir)\shims\nodewin\corepack"/>
242      </Component>
243
244      <Component Id="NpmCmdScript">
245        <File Id="npm.cmd" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm.cmd"/>
246      </Component>
247
248      <Component Id="NpmBashScript">
249        <File Id="npm.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm"/>
250      </Component>
251
252      <Component Id="NpxCmdScript">
253        <File Id="npx.cmd" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npx.cmd"/>
254      </Component>
255
256      <Component Id="NpxBashScript">
257        <File Id="npx.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npx"/>
258      </Component>
259
260      <Directory Id="NodeModulesFolder" Name="node_modules">
261        <Directory Id="NpmFolder" Name="npm">
262          <Component Id="NpmConfigurationFile">
263            <File Id="npm.rc" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\npm\npmrc"/>
264          </Component>
265        </Directory>
266      </Directory>
267    </DirectoryRef>
268
269    <DirectoryRef Id="ApplicationProgramsFolder">
270      <Component Id="DocumentationShortcuts">
271        <RegistryValue Root="HKCU"
272                       Key="$(var.RegistryKeyPath)\Components"
273                       Name="DocumentationShortcuts"
274                       Type="integer"
275                       Value="1"
276                       KeyPath="yes"/>
277        <util:InternetShortcut Id="WebsiteShortcut"
278                               Name="Node.js website"
279                               Target="https://nodejs.org/"
280                               Type="url"/>
281        <util:InternetShortcut Id="DocsShortcut"
282                               Name="Node.js documentation"
283                               Target="https://nodejs.org/download/$(var.DistTypeDir)/v$(var.FullVersion)/docs/api/"
284                               Type="url"/>
285      </Component>
286    </DirectoryRef>
287
288    <DirectoryRef Id="INSTALLDIR">
289      <Component Id="EnvironmentPathNode">
290        <RegistryValue Root="HKLM"
291                       Key="$(var.RegistryKeyPath)\Components"
292                       Name="EnvironmentPathNode"
293                       Type="integer"
294                       Value="1"
295                       KeyPath="yes"/>
296        <Environment Id="EnvironmentPathNode"
297                     Action="set"
298                     Name="PATH"
299                     Part="last"
300                     System="yes"
301                     Value="[INSTALLDIR]"/>
302      </Component>
303
304      <Component Id="EnvironmentPathNpmModules">
305        <RegistryValue Root="HKCU"
306                       Key="$(var.RegistryKeyPath)\Components"
307                       Name="EnvironmentPathNpmModules"
308                       Type="integer"
309                       Value="1"
310                       KeyPath="yes"/>
311        <Environment Id="EnvironmentPathNpmModules"
312                     Action="set"
313                     Name="PATH"
314                     Part="last"
315                     System="no"
316                     Value="[AppDataFolder]npm"/>
317      </Component>
318    </DirectoryRef>
319
320    <Binary Id='CustomActionsDLL'
321            SourceFile='$(var.custom_actions.TargetDir)$(var.custom_actions.TargetName).dll' />
322
323    <CustomAction Id="SetInstallScope"
324                  BinaryKey="CustomActionsDLL"
325                  DllEntry="SetInstallScope"
326                  Execute="immediate"
327                  Return="check" />
328
329    <CustomAction Id="BroadcastEnvironmentUpdate"
330                  BinaryKey="CustomActionsDLL"
331                  DllEntry="BroadcastEnvironmentUpdate"
332                  Execute="immediate"
333                  Return="check" />
334
335    <CustomAction Id="GetLocalizedUserNames"
336                  BinaryKey="CustomActionsDLL"
337                  DllEntry="GetLocalizedUserNames"
338                  Execute="immediate"
339                  Return="check" />
340
341    <Property Id="WixShellExecTarget" Value="[#InstallToolsBat]" />
342    <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" />
343
344    <InstallUISequence>
345      <Custom Action='SetInstallScope' Before='FindRelatedProducts'/>
346    </InstallUISequence>
347
348    <InstallExecuteSequence>
349      <Custom Action='SetInstallScope' Before='FindRelatedProducts'/>
350      <Custom Action='GetLocalizedUserNames' After='SetInstallScope'/>
351      <Custom Action='BroadcastEnvironmentUpdate' After='InstallFinalize'/>
352    </InstallExecuteSequence>
353
354    <UI Id="NodeInstallUI">
355      <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8"/>
356      <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12"/>
357      <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes"/>
358
359      <Property Id="DefaultUIFont" Value="WixUI_Font_Normal"/>
360      <Property Id="WixUI_Mode" Value="FeatureTree"/>
361
362      <DialogRef Id="ErrorDlg"/>
363      <DialogRef Id="FatalError"/>
364      <DialogRef Id="FilesInUse"/>
365      <DialogRef Id="MsiRMFilesInUse"/>
366      <DialogRef Id="PrepareDlg"/>
367      <DialogRef Id="ProgressDlg"/>
368      <DialogRef Id="ResumeDlg"/>
369      <DialogRef Id="UserExit"/>
370      <DialogRef Id="WelcomeDlg"/>
371      <DialogRef Id="LicenseAgreementDlg"/>
372      <DialogRef Id="InstallDirDlg"/>
373      <DialogRef Id="BrowseDlg"/>
374      <DialogRef Id="InvalidDirDlg"/>
375      <Dialog Id="NativeToolsDlg" Width="370" Height="270" Title="!(loc.NativeToolsDlg_Title)">
376        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.NativeToolsDlgBannerBitmap)" />
377        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.NativeToolsDlgTitle)" />
378        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.NativeToolsDlgDescription)" />
379        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
380
381        <Control Id="Intro" Type="Text" X="20" Y="65" Width="330" Height="30" NoPrefix="yes" Text="!(loc.NativeToolsDlgIntro)" />
382        <Control Id="InstallCheckbox" Type="CheckBox" X="20" Y="105" Width="330" Height="30" Property="NATIVETOOLSCHECKBOX" CheckBoxValue="1" Text="!(loc.NativeToolsDlgInstallCheckbox)" />
383        <Control Id="ManualDetails" Type="Hyperlink" X="20" Y="140" Width="330" Height="30" Text="!(loc.NativeToolsDlgManualDetails)" />
384
385        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
386        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
387        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
388        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
389          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
390        </Control>
391      </Dialog>
392
393      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
394      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
395      <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
396      <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">LicenseAccepted = "1"</Publish>
397      <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
398      <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Order="20">1</Publish>
399      <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="10">1</Publish>
400      <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="10">1</Publish>
401      <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="20">1</Publish>
402      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
403      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
404      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>
405      <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
406      <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
407      <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
408      <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
409      <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
410      <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">Installed</Publish>
411      <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="2">NOT Installed</Publish>
412      <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="NativeToolsDlg">1</Publish>
413      <Publish Dialog="NativeToolsDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg">1</Publish>
414      <Publish Dialog="NativeToolsDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
415      <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">NATIVETOOLSCHECKBOX = 1</Publish>
416      <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
417
418      <Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="!(loc.WIXUI_EXITDIALOGOPTIONALTEXT)"/>
419    </UI>
420
421    <UIRef Id="WixUI_Common"/>
422    <UIRef Id="WixUI_ErrorProgressText"/>
423    <WixVariable Id="WixUIBannerBmp" Value="$(var.RepoDir)\doc\thin-white-stripe.jpg"/>
424    <WixVariable Id="WixUIDialogBmp" Value="$(var.RepoDir)\doc\full-white-stripe.jpg"/>
425    <WixVariable Id="WixUILicenseRtf" Value="$(var.SourceDir)\LICENSE.rtf"/>
426  </Product>
427
428</Wix>
429