mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
Fixes #2083. Support installing npm in the .msi
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -34,3 +34,5 @@ ipch/
|
||||
*-nodegyp*
|
||||
/gyp-mac-tool
|
||||
/dist-osx
|
||||
/npm.wxs
|
||||
/tools/msvs/npm.wixobj
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -15,15 +16,16 @@
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<OutputPath>..\..\..\$(Configuration)\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
<DefineConstants>Debug;ProductVersion=$(NodeVersion)</DefineConstants>
|
||||
<DefineConstants>Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>..\..\..\$(Configuration)\</OutputPath>
|
||||
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
|
||||
<DefineConstants>Debug;ProductVersion=$(NodeVersion)</DefineConstants>
|
||||
<DefineConstants>Debug;ProductVersion=$(NodeVersion);NPMSourceDir=..\..\..\deps\npm\</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="product.wxs" />
|
||||
<Compile Include="..\..\..\npm.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WixExtension Include="WixUIExtension">
|
||||
@@ -40,4 +42,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="ProgramFilesFolder">
|
||||
<Directory Id="NodeRoot" Name="nodejs">
|
||||
<Directory Id="NodeModulesFolder" Name="node_modules" />
|
||||
<Component Id="nodeexe" Guid="AEC0F08E-89B3-4C35-A286-8DB8598597F2">
|
||||
<File Id="filenodeexe" KeyPath="yes" Source="$(var.sourcedir)\node.exe" />
|
||||
<Environment Id="Environment"
|
||||
@@ -26,6 +27,9 @@
|
||||
System="yes"
|
||||
Value="[NodeRoot]" />
|
||||
</Component>
|
||||
<Component Id="npmcmd" Guid="31e9986d-74cd-44e1-878c-194d3e997d32">
|
||||
<File Id="filenpmcmd" KeyPath="yes" Source="$(var.NPMSourceDir)\bin\npm.cmd" />
|
||||
</Component>
|
||||
<?if $(var.Configuration) = Debug ?>
|
||||
<Component Id="nodepdb" Guid="BEC0F08E-89B3-4C35-A286-8DB8598597F2">
|
||||
<File Id="filenodepdb" KeyPath="yes" Source="$(var.sourcedir)\node.pdb" />
|
||||
@@ -37,6 +41,8 @@
|
||||
|
||||
<ComponentGroup Id="allfiles">
|
||||
<ComponentRef Id="nodeexe"/>
|
||||
<ComponentRef Id="npmcmd"/>
|
||||
<ComponentGroupRef Id="NPMFiles" />
|
||||
<?if $(var.Configuration) = Debug ?>
|
||||
<ComponentRef Id="nodepdb"/>
|
||||
<?endif?>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user