summaryrefslogtreecommitdiff
path: root/tools/msvs/msi/product.wxs
blob: 891bc440553bddb023698feb18cbfbe6490f6824 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

  <?define ProductName = "Node.js" ?>
  <?define ProductDescription = "Node.js" ?>
  <?define ProductAuthor = "Joyent, Inc. and other Node contributors" ?>

  <?define RegistryKeyPath = "SOFTWARE\Node.js" ?>

  <?define RepoDir="$(var.ProjectDir)..\..\..\" ?>
  <?define SourceDir="$(var.RepoDir)\$(var.Configuration)\" ?>

  <Product Id="*"
           Name="$(var.ProductName)"
           Language="1033"
           Version="$(var.ProductVersion)"
           Manufacturer="$(var.ProductAuthor)"
           UpgradeCode="1d60944c-b9ce-4a71-a7c0-0384eb884baa">

    <Package InstallerVersion="200" Compressed="yes" />

    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

    <MajorUpgrade AllowSameVersionUpgrades="yes"
                  DowngradeErrorMessage="A later version of node.js is already installed. Setup will now exit." />

    <Icon Id="node.exe" SourceFile="$(var.RepoDir)\src\res\node.ico"/>
    <Property Id="ARPPRODUCTICON" Value="node.exe" />
    <Property Id="ApplicationFolderName" Value="nodejs" />
    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />

    <Property Id="INSTALLDIR">
      <RegistrySearch Id="InstallPathRegistry"
                      Type="raw"
                      Root="HKCU"
                      Key="$(var.RegistryKeyPath)"
                      Name="InstallPath"/>
    </Property>

    <Feature Id="nodejs" Title="node.js engine" Level="1" Description="$(var.ProductDescription)" Absent="disallow">
      <ComponentGroupRef Id="allfiles" />
      <ComponentGroupRef Id="Product.Generated" />
    </Feature>

    <Feature Id="nodejs.shortcuts" Title="node.js shortcuts" Level="1" Description="$(var.ProductDescription) Shortcuts">
      <Feature Id="nodejs.shortcuts.application" Title="Application Shortcuts" Level="1"  Description="$(var.ProductDescription) standard application shortcuts">
        <ComponentGroupRef Id="application.shortcuts"/>
      </Feature>
      <Feature Id="nodejs.shortcuts.internet" Title="Internet Shortcuts" Level="1"  Description="$(var.ProductDescription) internet shortcuts to the project's website and online documentation for this version">
        <ComponentGroupRef Id="internet.shortcuts"/>
      </Feature>
    </Feature>

    <Directory Id="TARGETDIR" Name="SourceDir">

      <Directory Id="ProgramMenuFolder">
          <Directory Id="ApplicationProgramsFolder" Name="Node.js ($(var.Platform))"/>
      </Directory>

      <Directory Id="$(var.ProgramFilesFolderId)">
        <Directory Id="INSTALLDIR" Name="nodejs">
          <Directory Id="NodeModulesFolder" Name="node_modules">
            <Directory Id="NPMFolder" Name="npm">
              <Component Id="npmrc" Guid="55B2B03F-8F32-4D62-A54A-FA428615591D">
                 <File Id="filenpmrc" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\npm\npmrc" />
              </Component>
            </Directory>
          </Directory>
          <Component Id="nodeexe" Guid="AEC0F08E-89B3-4C35-A286-8DB8598597F2">
            <File Id="filenodeexe" KeyPath="yes" Source="$(var.SourceDir)\node.exe" />
            <?if $(var.NoETW) != 1 ?>
            <File Id="node_etw_provider_man" Name="node_etw_provider.man" Source="$(var.RepoDir)\src\res\node_etw_provider.man" >
              <util:EventManifest MessageFile="[INSTALLDIR]node.exe" ResourceFile="[INSTALLDIR]node.exe"/>
            </File>
            <?endif?>
            <?if $(var.NoPerfCtr) != 1 ?>
            <File Id="node_perfctr_provider_man" Name="node_perfctr_provider.man" Source="$(var.RepoDir)\src\res\node_perfctr_provider.man" >
              <util:PerfCounterManifest ResourceFileDirectory="[INSTALLDIR]"/>
            </File>
            <?endif?>
            <Environment Id="npm_env"
                         Action="set"
                         Name="PATH"
                         Part="last"
                         System="no"
                         Value="[AppDataFolder]npm\" />
            <Environment Id="node_env"
                         Action="set"
                         Name="PATH"
                         Part="last"
                         System="yes"
                         Value="[INSTALLDIR]" />
          </Component>
          <Component Id="npmcmd" Guid="31e9986d-74cd-44e1-878c-194d3e997d32">
            <File Id="filenpmcmd" KeyPath="yes" Source="$(var.NPMSourceDir)\bin\npm.cmd" />
          </Component>
          <Component Id="npmsh" Guid="57754e12-9269-4198-a38c-2c098bf5276e">
            <File Id="filenpmsh" KeyPath="yes" Source="$(var.NPMSourceDir)\bin\npm" />
          </Component>
          <Component Id="nodejsvars" Guid="*">
            <File Id="filenodejsvars" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\nodejsvars.bat" />
          </Component>
          <Component Id="noderegistry" Guid="*" >
            <RegistryKey Root="HKCU" Key="$(var.RegistryKeyPath)">
              <RegistryValue Name="InstallPath" Type="string" Value="[INSTALLDIR]" KeyPath="yes" />
              <RegistryValue Name="Version" Type="string" Value="$(var.ProductVersion)" />
            </RegistryKey>
          </Component>
        </Directory>
      </Directory>
    </Directory>

    <DirectoryRef Id="ApplicationProgramsFolder">
      <Component Id="ApplicationShortcut" Guid="9b1ab94a-8f54-4f19-a5c4-b890de474162">
        <Shortcut Id="ApplicationStartMenuShortcut" Name="Node.js"
                  Description="$(var.ProductDescription)" Target="[INSTALLDIR]node.exe"
                  WorkingDirectory="INSTALLDIR"/>
        <Shortcut Id="NodePromptStartMenuShortcut" Name="Node.js command prompt"
                  Description="Node.js Command Prompt" Target="[%ComSpec]"
                  Arguments='/k "[INSTALLDIR]nodejsvars.bat"'
                  Show="normal"
                  WorkingDirectory="INSTALLDIR"/>
        <Shortcut Id="UninstallProduct"
                  Name="Uninstall Node.js"
                  Target="[SystemFolder]msiexec.exe"
                  Arguments="/x [ProductCode]"
                  Description="Uninstalls $(var.ProductName)" />
        <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
        <RegistryValue Root="HKCU" Key="$(var.RegistryKeyPath)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
      </Component>
      <Component Id="InternetShortcuts" Guid="3351B877-49BA-4BC0-BF5E-21BA623FD07C">
        <util:InternetShortcut Id="OnlineWebsiteShortcut"
                  Name="Node.js website"
                  Target="http://nodejs.org"
                  Type="url"/>
        <util:InternetShortcut Id="OnlineDocumentationShortcut"
                  Name="Node.js documentation"
                  Target="http://nodejs.org/dist/v$(var.ProductVersion)/docs/api/"
                  Type="url"/>
        <RegistryValue Root="HKCU" Key="$(var.RegistryKeyPath)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
      </Component>
    </DirectoryRef>

    <ComponentGroup Id="allfiles">
      <ComponentRef Id="nodeexe"/>
      <ComponentRef Id="npmcmd"/>
      <ComponentRef Id="npmsh"/>
      <ComponentRef Id="npmrc" />
      <ComponentGroupRef Id="NPMFiles" />
      <ComponentRef Id="nodejsvars" />
      <ComponentRef Id="noderegistry" />
    </ComponentGroup>

    <ComponentGroup Id="application.shortcuts">
      <ComponentRef Id="ApplicationShortcut" />
    </ComponentGroup>

    <ComponentGroup Id="internet.shortcuts">
      <ComponentRef Id="InternetShortcuts"/>
    </ComponentGroup>

    <UI Id="NodeInstallUI">
      <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
      <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
      <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

      <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
      <Property Id="WixUI_Mode" Value="FeatureTree" />

      <DialogRef Id="ErrorDlg" />
      <DialogRef Id="FatalError" />
      <DialogRef Id="FilesInUse" />
      <DialogRef Id="MsiRMFilesInUse" />
      <DialogRef Id="PrepareDlg" />
      <DialogRef Id="ProgressDlg" />
      <DialogRef Id="ResumeDlg" />
      <DialogRef Id="UserExit" />
      <DialogRef Id="WelcomeDlg" />
      <DialogRef Id="LicenseAgreementDlg"/>
      <DialogRef Id="InstallDirDlg"/>
      <DialogRef Id="BrowseDlg"/>
      <DialogRef Id="InvalidDirDlg"/>

      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
      <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
      <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg">LicenseAccepted = "1"</Publish>
      <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
      <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Order="20">1</Publish>
      <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="10">1</Publish>
      <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="10">1</Publish>
      <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="20">1</Publish>
      <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>
      <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
      <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
      <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
      <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
      <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
      <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">Installed</Publish>
      <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="InstallDirDlg" Order="2">NOT Installed</Publish>
      <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>

      <Property Id="ARPNOMODIFY" Value="1" />
      <Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="Node.js has been succesfully installed. To run Node.js open command prompt (cmd.exe), and run 'node'." />
    </UI>

    <UIRef Id="WixUI_Common" />
    <WixVariable Id="WixUIBannerBmp" Value="..\..\..\doc\thin-white-stripe.jpg" />
    <WixVariable Id="WixUIDialogBmp" Value="..\..\..\doc\full-white-stripe.jpg" />
    <WixVariable Id="WixUILicenseRtf" Value="$(var.SourceDir)\LICENSE.rtf" />
  </Product>

</Wix>