Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
windows/msi: add node.js prompt to startmenu
  • Loading branch information
japj authored and piscisaureus committed Jun 4, 2012
1 parent 04e484c commit cb24ce5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/msvs/msi/product.wxs
Expand Up @@ -64,6 +64,9 @@
<File Id="filenodepdb" KeyPath="yes" Source="$(var.sourcedir)\node.pdb" />
</Component>
<?endif?>
<Component Id="nodejsvars" Guid="*">
<File Id="filenodejsvars" KeyPath="yes" Source="$(var.sourcedir)\nodejsvars.bat" />
</Component>
</Directory>
</Directory>

Expand All @@ -85,6 +88,11 @@
<Shortcut Id="ApplicationStartMenuShortcut" Name="Node.js"
Description="$(var.ProductDescription)" Target="[APPLICATIONROOTDIRECTORY]node.exe"
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
<Shortcut Id="NodePromptStartMenuShortcut" Name="Node.js ($(var.Platform)) Command Prompt"
Description="Node.js Command Prompt" Target="[%ComSpec]"
Arguments='/k "[APPLICATIONROOTDIRECTORY]nodejsvars.bat" $(var.Platform)'
Show="normal"
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
<util:InternetShortcut Id="OnlineWebsiteShortcut"
Name="Node.js website"
Target="http://nodejs.org"/>
Expand Down Expand Up @@ -113,6 +121,7 @@
<ComponentRef Id="nodepdb"/>
<?endif?>
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="nodejsvars" />
</ComponentGroup>

<Feature Id="nodejs" Title="node.js engine" Level="1" Description="$(var.ProductDescription)">
Expand Down
19 changes: 19 additions & 0 deletions tools/msvs/nodejsvars.bat
@@ -0,0 +1,19 @@
@echo off
@rem Process arguments.
set target_arch=x86

:next-arg
if "%1"=="" goto args-done
if /i "%1"=="x86" set target_arch=x86&goto arg-ok
if /i "%1"=="x64" set target_arch=x64&goto arg-ok

echo Warning: ignoring invalid command line option `%1`.

:arg-ok
shift
goto next-arg
:args-done

@rem Ensure this Node.js is first in the PATH
echo Your environment has been set up for using Node.js (%target_arch%) and NPM
set PATH=%~dp0;%PATH%
1 change: 1 addition & 0 deletions vcbuild.bat
Expand Up @@ -114,6 +114,7 @@ if errorlevel 1 echo Failed to generate license.rtf&goto exit
@rem Skip msi generation if not requested
if not defined msi goto run
python "%~dp0tools\getnodeversion.py" > "%temp%\node_version.txt"
copy "%~dp0tools\msvs\nodejsvars.bat" %config%\nodejsvars.bat
if not errorlevel 0 echo Cannot determine current version of node.js & goto exit
for /F "tokens=*" %%i in (%temp%\node_version.txt) do set NODE_VERSION=%%i
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:Configuration=%config% /p:Platform=%msiplatform% /p:NodeVersion=%NODE_VERSION% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
Expand Down

0 comments on commit cb24ce5

Please sign in to comment.