diff --git a/.gitignore b/.gitignore
index e77d5df576..68b5843eeb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,7 @@ node_g
Debug/
Release/
*.sln
+!nodemsi.sln
*.suo
*.vcproj
*.vcxproj
diff --git a/tools/msi/LICENSE.rtf b/tools/msi/LICENSE.rtf
new file mode 100644
index 0000000000..8afd327554
Binary files /dev/null and b/tools/msi/LICENSE.rtf differ
diff --git a/tools/msi/getnodeversion.py b/tools/msi/getnodeversion.py
new file mode 100644
index 0000000000..a9a5274fb2
--- /dev/null
+++ b/tools/msi/getnodeversion.py
@@ -0,0 +1,9 @@
+import sys,re;
+for line in sys.stdin:
+ if re.match('#define NODE_MAJOR_VERSION', line):
+ major = line.split()[2]
+ if re.match('#define NODE_MINOR_VERSION', line):
+ minor = line.split()[2]
+ if re.match('#define NODE_PATCH_VERSION', line):
+ patch = line.split()[2]
+print '{0:s}.{1:s}.{2:s}.0'.format(major, minor, patch)
diff --git a/tools/msi/nodemsi.sln b/tools/msi/nodemsi.sln
new file mode 100644
index 0000000000..1392bb285a
--- /dev/null
+++ b/tools/msi/nodemsi.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "nodemsi", "nodemsi.wixproj", "{1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Debug|x86.ActiveCfg = Debug|x86
+ {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Debug|x86.Build.0 = Debug|x86
+ {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Release|x86.ActiveCfg = Release|x86
+ {1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/tools/msi/nodemsi.wixproj b/tools/msi/nodemsi.wixproj
new file mode 100644
index 0000000000..4253624991
--- /dev/null
+++ b/tools/msi/nodemsi.wixproj
@@ -0,0 +1,46 @@
+
+
+
+ Debug
+ x86
+ 3.5
+ {1d808ff0-b5a9-4be9-859d-b334b6f48be2}
+ 2.0
+ node
+ Package
+ $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets
+ $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets
+ 0.0.0.0
+
+
+ ..\..\$(Configuration)\
+ obj\$(Configuration)\
+ Debug;ProductVersion=$(NodeVersion)
+
+
+ ..\..\$(Configuration)\
+ obj\$(Configuration)\
+ Debug;ProductVersion=$(NodeVersion)
+
+
+
+
+
+
+
+
+
+ $(WixExtDir)\WixUIExtension.dll
+ WixUIExtension
+
+
+
+
+
\ No newline at end of file
diff --git a/tools/msi/product.wxs b/tools/msi/product.wxs
new file mode 100644
index 0000000000..89a61295a1
--- /dev/null
+++ b/tools/msi/product.wxs
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vcbuild.bat b/vcbuild.bat
index 90e89d91db..fb56574b60 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -18,6 +18,7 @@ set noprojgen=
set nobuild=
set test=
set test_args=
+set msi=
:next-arg
if "%1"=="" goto args-done
@@ -33,6 +34,7 @@ if /i "%1"=="test-simple" set test=test-simple&goto arg-ok
if /i "%1"=="test-message" set test=test-message&goto arg-ok
if /i "%1"=="test-all" set test=test-all&goto arg-ok
if /i "%1"=="test" set test=test&goto arg-ok
+if /i "%1"=="msi" set msi=1&goto arg-ok
:arg-ok
shift
goto next-arg
@@ -51,7 +53,7 @@ echo Project files generated.
:msbuild
@rem Skip project generation if requested.
-if defined nobuild goto run
+if defined nobuild goto msi
@rem Bail out early if not running in VS build env.
if defined VCINSTALLDIR goto msbuild-found
@@ -70,6 +72,15 @@ goto run
msbuild node.sln /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit
+:msi
+@rem Skip msi generation if not requested
+if not defined msi goto run
+python "%~dp0tools\msi\getnodeversion.py" < "%~dp0src\node_version.h" > "%temp%\node_version.txt"
+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\msi\nodemsi.sln" /t:Clean,Build /p:Configuration=%config% /p:NodeVersion=%NODE_VERSION% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
+if errorlevel 1 goto exit
+
:run
@rem Run tests if requested.
if "%test%"=="" goto exit
@@ -94,9 +105,10 @@ echo Failed to create vc project files.
goto exit
:help
-echo vcbuild.bat [debug/release] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [nobuild]
+echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [nobuild]
echo Examples:
echo vcbuild.bat : builds debug build
+echo vcbuild.bat release msi : builds release build and MSI installer package
echo vcbuild.bat test : builds debug build and runs tests
echo vcbuild.bat release test-uv: builds release build and runs --libuv tests
goto exit