diff --git a/.gitignore b/.gitignore
index 2b27112ac8..48513041d2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,5 @@ ipch/
*-nodegyp*
/gyp-mac-tool
/dist-osx
+/npm.wxs
+/tools/msvs/npm.wixobj
diff --git a/tools/msvs/msi/nodemsi.wixproj b/tools/msvs/msi/nodemsi.wixproj
index 8ac7a3e3a9..e45372457b 100644
--- a/tools/msvs/msi/nodemsi.wixproj
+++ b/tools/msvs/msi/nodemsi.wixproj
@@ -1,4 +1,5 @@
+
Debug
@@ -15,15 +16,16 @@
..\..\..\$(Configuration)\
obj\$(Configuration)\
- Debug;ProductVersion=$(NodeVersion)
+ Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\
..\..\..\$(Configuration)\
obj\$(Configuration)\
- Debug;ProductVersion=$(NodeVersion)
+ Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\
+
@@ -40,4 +42,4 @@
-->
-
\ No newline at end of file
+
diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs
index e3fa2ecd42..d3586e3321 100644
--- a/tools/msvs/msi/product.wxs
+++ b/tools/msvs/msi/product.wxs
@@ -17,6 +17,7 @@
+
+
+
+
@@ -37,6 +41,8 @@
+
+
diff --git a/vcbuild.bat b/vcbuild.bat
index 709d71ce7c..8bd93164a3 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -83,6 +83,7 @@ if not defined msi goto run
python "%~dp0tools\getnodeversion.py" > "%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
+heat dir deps\npm -var var.NPMSourceDir -dr NodeModulesFolder -cg NPMFiles -gg -template fragment -nologo -out npm.wxs
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /t:Clean,Build /p:Configuration=%config% /p:NodeVersion=%NODE_VERSION% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit