Skip to content

Commit

Permalink
win/msi: refactor 'node.js runtime' feature
Browse files Browse the repository at this point in the history
* This feature now includes the start menu items.
* 'nodejsvars.bat' was renamed to 'nodevars.bat'.
* Improved feature description.
  • Loading branch information
piscisaureus committed Mar 8, 2013
1 parent 2320ffb commit fb62532
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 46 deletions.
96 changes: 50 additions & 46 deletions tools/msvs/msi/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@
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 Id="NodeRuntime"
Level="1"
Title="Node.js runtime"
Description="Install the core Node.js runtime (node.exe)."
Absent="disallow">
<ComponentRef Id="NodeExecutable"/>
<ComponentRef Id="NodeVarsScript"/>
<ComponentRef Id="NodeStartMenuAndRegistryEntries"/>
<ComponentGroupRef Id="Product.Generated"/>

<Feature Id="NodePerfCtrSupport"
Level="1"
Expand Down Expand Up @@ -68,9 +74,6 @@
</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>
Expand All @@ -97,28 +100,24 @@

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

<Directory Id="$(var.ProgramFilesFolderId)">
<Directory Id="INSTALLDIR" Name="nodejs">
<Component Id="nodeexe" Guid="AEC0F08E-89B3-4C35-A286-8DB8598597F2">
<File Id="filenodeexe" KeyPath="yes" Source="$(var.SourceDir)\node.exe" />
</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="INSTALLDIR">
<Component Id="NodeExecutable">
<File Id="node.exe" KeyPath="yes" Source="$(var.SourceDir)\node.exe"/>
</Component>

<Component Id="NodeVarsScript">
<File Id="nodevars.bat" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\nodevars.bat"/>
</Component>

<?if $(var.NoPerfCtr) != 1 ?>
<Component Id="NodePerfCtrSupport">
<File Id="node_perfctr_provider_man" Name="node_perfctr_provider.man" Source="$(var.RepoDir)\src\res\node_perfctr_provider.man">
Expand All @@ -136,6 +135,38 @@
<?endif?>
</DirectoryRef>

<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="NodeStartMenuAndRegistryEntries">
<RegistryValue Root="HKCU"
Key="$(var.RegistryKeyPath)"
Name="InstallPath"
Type="string"
Value="[INSTALLDIR]"
KeyPath="yes"/>
<RegistryValue Root="HKCU"
Key="$(var.RegistryKeyPath)"
Name="Version"
Type="string"
Value="$(var.ProductVersion)"/>
<Shortcut Id="NodeVarsScriptShortcut"
Name="Node.js command prompt"
Target="[%ComSpec]"
Arguments='/k "[INSTALLDIR]nodevars.bat"'
Show="normal"
WorkingDirectory="INSTALLDIR"/>
<Shortcut Id="NodeExecutableShortcut"
Name="Node.js"
Target="[INSTALLDIR]node.exe"
WorkingDirectory="INSTALLDIR"/>
<Shortcut Id="UninstallProduct"
Name="Uninstall Node.js"
Target="[SystemFolder]msiexec.exe"
Arguments="/x [ProductCode]"/>
<RemoveFolder Id="RemoveApplicationProgramsFolder"
On="uninstall"/>
</Component>
</DirectoryRef>

<DirectoryRef Id="INSTALLDIR">
<Component Id="NpmCmdScript">
<File Id="npm.cmd" KeyPath="yes" Source="$(var.NpmSourceDir)\bin\npm.cmd"/>
Expand Down Expand Up @@ -187,23 +218,6 @@
</DirectoryRef>

<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"
Expand All @@ -217,16 +231,6 @@
</Component>
</DirectoryRef>

<ComponentGroup Id="allfiles">
<ComponentRef Id="nodeexe"/>
<ComponentRef Id="nodejsvars" />
<ComponentRef Id="noderegistry" />
</ComponentGroup>

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

<ComponentGroup Id="internet.shortcuts">
<ComponentRef Id="InternetShortcuts"/>
</ComponentGroup>
Expand Down
File renamed without changes.

0 comments on commit fb62532

Please sign in to comment.