Skip to content

Commit e418df7

Browse files
jimschubertsblom
authored andcommitted
windows/msi: add feature selection to installer
1 parent c3c8eee commit e418df7

2 files changed

Lines changed: 41 additions & 12 deletions

File tree

tools/msvs/msi/nodemsi.wixproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
3434
<DefineConstants>Debug;ProductVersion=$(NodeVersion);NoETW=$(NoETW);NoPerfCtr=$(NoPerfCtr);NPMSourceDir=..\..\..\deps\npm\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
3535
</PropertyGroup>
36+
<PropertyGroup>
37+
<EnableProjectHarvesting>True</EnableProjectHarvesting>
38+
</PropertyGroup>
3639
<ItemGroup>
3740
<Compile Include="product.wxs" />
3841
<Compile Include="..\..\..\npm.wxs" />

tools/msvs/msi/product.wxs

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@
106106
Arguments='/k "[APPLICATIONROOTDIRECTORY]nodejsvars.bat"'
107107
Show="normal"
108108
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
109+
<Shortcut Id="UninstallProduct"
110+
Name="Uninstall Node.js"
111+
Target="[SystemFolder]msiexec.exe"
112+
Arguments="/x [ProductCode]"
113+
Description="Uninstalls $(var.ProductName)" />
114+
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
115+
<RegistryValue Root="HKCU" Key="Software\Joyent\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
116+
</Component>
117+
<Component Id="InternetShortcuts" Guid="3351B877-49BA-4BC0-BF5E-21BA623FD07C">
109118
<util:InternetShortcut Id="OnlineWebsiteShortcut"
110119
Name="Node.js website"
111120
Target="http://nodejs.org"
@@ -114,12 +123,6 @@
114123
Name="Node.js documentation"
115124
Target="http://nodejs.org/dist/v$(var.ProductVersion)/docs/api/"
116125
Type="url"/>
117-
<Shortcut Id="UninstallProduct"
118-
Name="Uninstall Node.js"
119-
Target="[SystemFolder]msiexec.exe"
120-
Arguments="/x [ProductCode]"
121-
Description="Uninstalls $(var.ProductName)" />
122-
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
123126
<RegistryValue Root="HKCU" Key="Software\Joyent\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
124127
</Component>
125128
</DirectoryRef>
@@ -135,22 +138,38 @@
135138
<?if $(var.Configuration) = Debug ?>
136139
<ComponentRef Id="nodepdb"/>
137140
<?endif?>
138-
<ComponentRef Id="ApplicationShortcut" />
139141
<ComponentRef Id="nodejsvars" />
140142
</ComponentGroup>
141143

142-
<Feature Id="nodejs" Title="node.js engine" Level="1" Description="$(var.ProductDescription)">
144+
<ComponentGroup Id="application.shortcuts">
145+
<ComponentRef Id="ApplicationShortcut" />
146+
</ComponentGroup>
147+
148+
<ComponentGroup Id="internet.shortcuts">
149+
<ComponentRef Id="InternetShortcuts"/>
150+
</ComponentGroup>
151+
152+
<Feature Id="nodejs" Title="node.js engine" Level="1" Description="$(var.ProductDescription)" Absent="disallow">
143153
<ComponentGroupRef Id="allfiles" />
144154
<ComponentGroupRef Id="Product.Generated" />
145155
</Feature>
146156

157+
<Feature Id="nodejs.shortcuts" Title="node.js shortcuts" Description="$(var.ProductDescription) Shortcuts">
158+
<Feature Id="feature.application.shortcuts" Title="Application Shortcuts" Level="1" Description="$(var.ProductDescription) standard application shortcuts">
159+
<ComponentGroupRef Id="application.shortcuts"/>
160+
</Feature>
161+
<Feature Id="feature.internet.shortcuts" Title="Internet Shortcuts" Level="1" Description="$(var.ProductDescription) internet shortcuts to the project's website and online documentation for this version">
162+
<ComponentGroupRef Id="internet.shortcuts"/>
163+
</Feature>
164+
</Feature>
165+
147166
<UI Id="NodeInstallUI">
148167
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
149168
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
150169
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
151170

152171
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
153-
<Property Id="WixUI_Mode" Value="Minimal" />
172+
<Property Id="WixUI_Mode" Value="FeatureTree" />
154173

155174
<DialogRef Id="ErrorDlg" />
156175
<DialogRef Id="FatalError" />
@@ -163,15 +182,22 @@
163182
<DialogRef Id="WelcomeDlg" />
164183
<DialogRef Id="LicenseAgreementDlg"/>
165184

166-
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
185+
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
186+
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
167187
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
168-
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="PrepareDlg">1</Publish>
188+
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg">LicenseAccepted = "1"</Publish>
169189
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
170-
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
190+
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
191+
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
192+
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>
193+
<Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
171194
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
172195
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
173196
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
174197
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
198+
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">Installed</Publish>
199+
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" Order="2">NOT Installed</Publish>
200+
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
175201

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

0 commit comments

Comments
 (0)