Skip to content

Commit

Permalink
win,msi: link node.exe to iojs.exe
Browse files Browse the repository at this point in the history
Add a feature to the MSI installer that, when selected, hard-links
node.exe to iojs.exe.

PR: #346
Reviewed-by: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-by: Rod Vagg <rod@vagg.com>
  • Loading branch information
piscisaureus committed Jan 14, 2015
1 parent 01736dd commit 42c31f4
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tools/msvs/msi/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
<ComponentRef Id="AppData" />
<ComponentGroupRef Id="Product.Generated"/>

<Feature Id="NodeAlias"
Level="1"
Title="Alias node to iojs"
Description="Create node.exe as an alias for iojs.exe.">
<ComponentRef Id="NodeAlias"/>
</Feature>

<Feature Id="NodePerfCtrSupport"
Level="1"
Title="Performance counters"
Expand Down Expand Up @@ -117,6 +124,12 @@
<File Id="iojs.exe" KeyPath="yes" Source="$(var.SourceDir)\iojs.exe"/>
</Component>

<Component Id="NodeAlias" Guid="fde09cce-a503-4409-a3c4-61ae2a5a5906">
<!-- Always remove node.exe. The hard link will be recreated by the
`LinkNodeExeToIojsExe` custom action whenever needed. -->
<RemoveFile Id="node.exe" Name="node.exe" On="both" />
</Component>

<Component Id="NodeVarsScript">
<File Id="nodevars.bat" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\nodevars.bat"/>
</Component>
Expand Down Expand Up @@ -249,6 +262,19 @@
</Component>
</DirectoryRef>

<CustomAction Id="LinkNodeExeToIojsExe"
FileKey="iojs.exe"
ExeCommand="-e &quot; require('fs').linkSync(process.execPath, require('path').resolve(process.execPath, '../node.exe')); &quot;"
Impersonate="no"
Execute="deferred"
Return="check" />

<InstallExecuteSequence>
<Custom Action="LinkNodeExeToIojsExe" After="InstallFiles">
$NodeAlias = 3
</Custom>
</InstallExecuteSequence>

<UI Id="NodeInstallUI">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8"/>
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12"/>
Expand Down

0 comments on commit 42c31f4

Please sign in to comment.