@@ -25,6 +25,7 @@ set sign=
2525set nosnapshot =
2626set cctest_args =
2727set test_args =
28+ set stage_package =
2829set package =
2930set msi =
3031set upload =
@@ -153,6 +154,9 @@ if defined build_release (
153154 set " pch = "
154155)
155156
157+ if defined msi set stage_package = 1
158+ if defined package set stage_package = 1
159+
156160:: assign path to node_exe
157161set " node_exe = %config% \node.exe"
158162set " node_gyp_exe = " %node_exe% " deps\npm\node_modules\node-gyp\bin\node-gyp"
@@ -313,15 +317,17 @@ if errorlevel 1 echo Failed to sign exe&goto exit
313317
314318:licensertf
315319@ rem Skip license.rtf generation if not requested.
316- if not defined licensertf goto package
320+ if not defined licensertf goto stage_package
317321
318322%config% \node.exe tools\license2rtf.js < LICENSE > %config% \license.rtf
319323if errorlevel 1 echo Failed to generate license.rtf& goto exit
320324
321- :package
322- if not defined package goto msi
325+ :stage_package
326+ if not defined stage_package goto install-doctools
327+
323328echo Creating package...
324329cd Release
330+ rmdir /S /Q node-v%FULLVERSION% -win-%target_arch% > nul 2 > nul
325331mkdir node-v%FULLVERSION% -win-%target_arch% > nul 2 > nul
326332mkdir node-v%FULLVERSION% -win-%target_arch% \node_modules > nul 2 > nul
327333
@@ -333,7 +339,7 @@ copy /Y ..\README.md node-v%FULLVERSION%-win-%target_arch%\ > nul
333339if errorlevel 1 echo Cannot copy README.md && goto package_error
334340copy /Y ..\CHANGELOG.md node-v%FULLVERSION% -win-%target_arch% \ > nul
335341if errorlevel 1 echo Cannot copy CHANGELOG.md && goto package_error
336- robocopy /e ..\deps\npm node-v%FULLVERSION% -win-%target_arch% \node_modules\npm > nul
342+ robocopy ..\deps\npm node-v%FULLVERSION% -win-%target_arch% \node_modules\npm /e /xd test > nul
337343if errorlevel 8 echo Cannot copy npm package && goto package_error
338344copy /Y ..\deps\npm\bin\npm node-v%FULLVERSION% -win-%target_arch% \ > nul
339345if errorlevel 1 echo Cannot copy npm && goto package_error
@@ -349,7 +355,11 @@ if not defined noetw (
349355 copy /Y ..\src\res\node_etw_provider.man node-v%FULLVERSION% -win-%target_arch% \ > nul
350356 if errorlevel 1 echo Cannot copy node_etw_provider.man && goto package_error
351357)
358+ cd ..
352359
360+ :package
361+ if not defined package goto msi
362+ cd Release
353363echo Creating node-v%FULLVERSION% -win-%target_arch% .7z
354364del node-v%FULLVERSION% -win-%target_arch% .7z > nul 2 > nul
3553657z a -r -mx9 -t7z node-v%FULLVERSION% -win-%target_arch% .7z node-v%FULLVERSION% -win-%target_arch% > nul
0 commit comments