Merge branch 'v0.10'
[platform/upstream/nodejs.git] / tools / msvs / msi / product.wxs
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 = "Joyent, Inc. and other Node contributors" ?>
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="1033"
17            Version="$(var.ProductVersion)"
18            Manufacturer="$(var.ProductAuthor)"
19            UpgradeCode="1d60944c-b9ce-4a71-a7c0-0384eb884baa">
20
21     <Package InstallerVersion="200" Compressed="yes"/>
22
23     <Media Id="1" Cabinet="media1.cab" EmbedCab="yes"/>
24
25     <MajorUpgrade AllowSameVersionUpgrades="yes"
26                   DowngradeErrorMessage="A later version of node.js is already installed. Setup will now exit."/>
27
28     <Icon Id="NodeIcon" SourceFile="$(var.RepoDir)\src\res\node.ico"/>
29     <Property Id="ARPPRODUCTICON" Value="NodeIcon"/>
30     <Property Id="ApplicationFolderName" Value="nodejs"/>
31     <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>
32
33     <Property Id="INSTALLDIR">
34       <RegistrySearch Id="InstallPathRegistry"
35                       Type="raw"
36                       Root="HKCU"
37                       Key="$(var.RegistryKeyPath)"
38                       Name="InstallPath"/>
39     </Property>
40
41     <Feature Id="NodeRuntime"
42              Level="1"
43              Title="Node.js runtime"
44              Description="Install the core Node.js runtime (node.exe)."
45              Absent="disallow">
46       <ComponentRef Id="NodeExecutable"/>
47       <ComponentRef Id="NodeVarsScript"/>
48       <ComponentRef Id="NodeStartMenuAndRegistryEntries"/>
49       <ComponentGroupRef Id="Product.Generated"/>
50
51       <Feature Id="NodePerfCtrSupport"
52                Level="1"
53                Title="Performance counters"
54                Description="Installs support for Node.js-specific performance counters.">
55         <ComponentRef Id="NodePerfCtrSupport"/>
56       </Feature>
57
58       <Feature Id="NodeEtwSupport"
59                Level="1"
60                Title="Event tracing (ETW)"
61                Description="Installs support for event tracing (ETW) events generated by Node.js.">
62         <ComponentRef Id="NodeEtwSupport"/>
63       </Feature>
64     </Feature>
65
66     <Feature Id="npm"
67              Level="1"
68              Title="npm package manager"
69              Description="Install npm, the recommended package manager for Node.js.">
70       <ComponentRef Id="NpmCmdScript"/>
71       <ComponentRef Id="NpmBashScript"/>
72       <ComponentRef Id="NpmConfigurationFile"/>
73       <ComponentGroupRef Id="NpmSourceFiles"/>
74     </Feature>
75
76     <Feature Level="1"
77              Id="DocumentationShortcuts"
78              Title="Online documentation shortcuts"
79              Description="Add start menu entries that link the the online documentation for Node.js $(var.ProductVersion) and the Node.js website.">
80       <ComponentRef Id="DocumentationShortcuts"/>
81     </Feature>
82
83     <Feature Id="EnvironmentPath"
84              Level="1"
85              Title="Add to PATH"
86              Description="Add Node, npm, and modules that were globally installed by npm to the PATH environment variable.">
87       <Feature Id="EnvironmentPathNode"
88                Level="1"
89                Title="Node and npm"
90                Description="Add Node and npm (if installed) to the PATH environment variable.">
91         <ComponentRef Id="EnvironmentPathNode"/>
92       </Feature>
93
94       <Feature Id="EnvironmentPathNpmModules"
95                Level="1"
96                Title="npm modules"
97                Description="Add modules that are installed globally by npm to the PATH environment variable. This option works for the current user only; other users need to update their PATH manually.">
98         <ComponentRef Id="EnvironmentPathNpmModules"/>
99       </Feature>
100     </Feature>
101
102     <Directory Id="TARGETDIR" Name="SourceDir">
103       <Directory Id="ProgramMenuFolder">
104         <Directory Id="ApplicationProgramsFolder" Name="Node.js"/>
105       </Directory>
106
107       <Directory Id="$(var.ProgramFilesFolderId)">
108         <Directory Id="INSTALLDIR" Name="nodejs">
109         </Directory>
110       </Directory>
111     </Directory>
112
113     <DirectoryRef Id="INSTALLDIR">
114       <Component Id="NodeExecutable">
115         <File Id="node.exe" KeyPath="yes" Source="$(var.SourceDir)\node.exe"/>
116       </Component>
117
118       <Component Id="NodeVarsScript">
119         <File Id="nodevars.bat" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\nodevars.bat"/>
120       </Component>
121
122       <?if $(var.NoPerfCtr) != 1 ?>
123       <Component Id="NodePerfCtrSupport">
124         <File Id="node_perfctr_provider_man" Name="node_perfctr_provider.man" Source="$(var.RepoDir)\src\res\node_perfctr_provider.man">
125           <util:PerfCounterManifest ResourceFileDirectory="[INSTALLDIR]"/>
126         </File>
127       </Component>
128       <?endif?>
129
130       <?if $(var.NoETW) != 1 ?>
131       <Component Id="NodeEtwSupport">
132         <File Id="node_etw_provider.man" Source="$(var.RepoDir)\src\res\node_etw_provider.man">
133           <util:EventManifest MessageFile="[INSTALLDIR]node.exe" ResourceFile="[INSTALLDIR]node.exe"/>
134         </File>
135       </Component>
136       <?endif?>
137     </DirectoryRef>
138
139     <DirectoryRef Id="ApplicationProgramsFolder">
140       <Component Id="NodeStartMenuAndRegistryEntries">
141         <RegistryValue Root="HKCU"
142                        Key="$(var.RegistryKeyPath)"
143                        Name="InstallPath"
144                        Type="string"
145                        Value="[INSTALLDIR]"
146                        KeyPath="yes"/>
147         <RegistryValue Root="HKCU"
148                        Key="$(var.RegistryKeyPath)"
149                        Name="Version"
150                        Type="string"
151                        Value="$(var.ProductVersion)"/>
152         <Shortcut Id="NodeVarsScriptShortcut"
153                   Name="Node.js command prompt"
154                   Target="[%ComSpec]"
155                   Arguments='/k "[INSTALLDIR]nodevars.bat"'
156                   Show="normal"
157                   WorkingDirectory="INSTALLDIR"/>
158         <Shortcut Id="NodeExecutableShortcut"
159                   Name="Node.js"
160                   Target="[INSTALLDIR]node.exe"
161                   WorkingDirectory="INSTALLDIR"/>
162         <Shortcut Id="UninstallProduct"
163                   Name="Uninstall Node.js"
164                   Target="[SystemFolder]msiexec.exe"
165                   Arguments="/x [ProductCode]"/>
166         <RemoveFolder Id="RemoveApplicationProgramsFolder"
167                       On="uninstall"/>
168       </Component>
169     </DirectoryRef>
170
171     <DirectoryRef Id="INSTALLDIR">
172       <Component Id="NpmCmdScript">
173         <File Id="npm.cmd" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm.cmd"/>
174       </Component>
175
176       <Component Id="NpmBashScript">
177         <File Id="npm.sh" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm"/>
178       </Component>
179
180       <Directory Id="NodeModulesFolder" Name="node_modules">
181         <Directory Id="NpmFolder" Name="npm">
182           <Component Id="NpmConfigurationFile">
183             <File Id="npm.rc" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\npm\npmrc"/>
184           </Component>
185         </Directory>
186       </Directory>
187     </DirectoryRef>
188
189     <DirectoryRef Id="ApplicationProgramsFolder">
190       <Component Id="DocumentationShortcuts">
191         <RegistryValue Root="HKCU"
192                        Key="$(var.RegistryKeyPath)\Components"
193                        Name="DocumentationShortcuts"
194                        Type="integer"
195                        Value="1"
196                        KeyPath="yes"/>
197         <util:InternetShortcut Id="WebsiteShortcut"
198                                Name="Node.js website"
199                                Target="http://nodejs.org"
200                                Type="url"/>
201         <util:InternetShortcut Id="DocsShortcut"
202                                Name="Node.js documentation"
203                                Target="http://nodejs.org/dist/v$(var.ProductVersion)/docs/api/"
204                                Type="url"/>
205       </Component>
206     </DirectoryRef>
207
208     <DirectoryRef Id="INSTALLDIR">
209       <Component Id="EnvironmentPathNode">
210         <RegistryValue Root="HKLM"
211                        Key="$(var.RegistryKeyPath)\Components"
212                        Name="EnvironmentPathNode"
213                        Type="integer"
214                        Value="1"
215                        KeyPath="yes"/>
216         <Environment Id="EnvironmentPathNode"
217                      Action="set"
218                      Name="PATH"
219                      Part="last"
220                      System="yes"
221                      Value="[INSTALLDIR]"/>
222       </Component>
223
224       <Component Id="EnvironmentPathNpmModules">
225         <RegistryValue Root="HKCU"
226                        Key="$(var.RegistryKeyPath)\Components"
227                        Name="EnvironmentPathNpmModules"
228                        Type="integer"
229                        Value="1"
230                        KeyPath="yes"/>
231         <Environment Id="EnvironmentPathNpmModules"
232                      Action="set"
233                      Name="PATH"
234                      Part="last"
235                      System="no"
236                      Value="[AppDataFolder]npm"/>
237       </Component>
238     </DirectoryRef>
239
240     <UI Id="NodeInstallUI">
241       <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8"/>
242       <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12"/>
243       <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes"/>
244
245       <Property Id="DefaultUIFont" Value="WixUI_Font_Normal"/>
246       <Property Id="WixUI_Mode" Value="FeatureTree"/>
247
248       <DialogRef Id="ErrorDlg"/>
249       <DialogRef Id="FatalError"/>
250       <DialogRef Id="FilesInUse"/>
251       <DialogRef Id="MsiRMFilesInUse"/>
252       <DialogRef Id="PrepareDlg"/>
253       <DialogRef Id="ProgressDlg"/>
254       <DialogRef Id="ResumeDlg"/>
255       <DialogRef Id="UserExit"/>
256       <DialogRef Id="WelcomeDlg"/>
257       <DialogRef Id="LicenseAgreementDlg"/>
258       <DialogRef Id="InstallDirDlg"/>
259       <DialogRef Id="BrowseDlg"/>
260       <DialogRef Id="InvalidDirDlg"/>
261
262       <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
263       <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
264       <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
265       <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">LicenseAccepted = "1"</Publish>
266       <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
267       <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Order="20">1</Publish>
268       <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="10">1</Publish>
269       <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="10">1</Publish>
270       <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="20">1</Publish>
271       <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
272       <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
273       <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
274       <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>
275       <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
276       <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
277       <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
278       <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
279       <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
280       <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">Installed</Publish>
281       <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="2">NOT Installed</Publish>
282       <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
283
284       <Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="Node.js has been successfully installed."/>
285     </UI>
286
287     <UIRef Id="WixUI_Common"/>
288     <WixVariable Id="WixUIBannerBmp" Value="..\..\..\doc\thin-white-stripe.jpg"/>
289     <WixVariable Id="WixUIDialogBmp" Value="..\..\..\doc\full-white-stripe.jpg"/>
290     <WixVariable Id="WixUILicenseRtf" Value="$(var.SourceDir)\LICENSE.rtf"/>
291   </Product>
292
293 </Wix>