windows/msi: add node.js prompt to startmenu
authorJeroen Janssen <jeroen.janssen@gmail.com>
Mon, 4 Jun 2012 16:59:01 +0000 (18:59 +0200)
committerBert Belder <bertbelder@gmail.com>
Mon, 4 Jun 2012 19:39:51 +0000 (21:39 +0200)
tools/msvs/msi/product.wxs
tools/msvs/nodejsvars.bat [new file with mode: 0644]

index 6189b47..bf27634 100755 (executable)
@@ -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.repoDir)\tools\msvs\nodejsvars.bat" />
+          </Component>
         </Directory>
       </Directory>
 
         <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"/>
       <ComponentRef Id="nodepdb"/>
       <?endif?>
       <ComponentRef Id="ApplicationShortcut" />
+      <ComponentRef Id="nodejsvars" />
     </ComponentGroup>
 
     <Feature Id="nodejs" Title="node.js engine" Level="1" Description="$(var.ProductDescription)">
diff --git a/tools/msvs/nodejsvars.bat b/tools/msvs/nodejsvars.bat
new file mode 100644 (file)
index 0000000..68be313
--- /dev/null
@@ -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%
\ No newline at end of file