From 23ea91ccb2525eccdb073821341e1d1b88f88d0c Mon Sep 17 00:00:00 2001 From: Pairi Daiza Date: Fri, 18 Dec 2020 13:43:29 +0100 Subject: [PATCH] + chg: Improvement of the make portable batch file --- .gitignore | 7 ++----- Build/{make_zip.bat => make_7-zip.bat} | 23 +++++++++++------------ 2 files changed, 13 insertions(+), 17 deletions(-) rename Build/{make_zip.bat => make_7-zip.bat} (89%) diff --git a/.gitignore b/.gitignore index f6283b853..6894b5546 100644 --- a/.gitignore +++ b/.gitignore @@ -26,14 +26,11 @@ Thumbs.db *.VC.db* /.vs -/minipath/.vs /Bin -/build.user.bat -/Build/.vs /Build/Packages -/Build/temp_zip* +/Build/temp_7-zip* +/Build/make_7-zip_* /Build/notepad3*setup_* -/distrib/Notepad3*.exe /packages /other_sln/packages diff --git a/Build/make_zip.bat b/Build/make_7-zip.bat similarity index 89% rename from Build/make_zip.bat rename to Build/make_7-zip.bat index 8535581d5..5e12e46cf 100644 --- a/Build/make_zip.bat +++ b/Build/make_7-zip.bat @@ -3,8 +3,8 @@ rem **************************************************************************** rem * * rem * Notepad3 * rem * * -rem * make_zip.bat * -rem * Batch file for creating the zip packages * +rem * make_7-zip.bat * +rem * Batch file for creating the portable .zip packages * rem * * rem * See License.txt for details about distribution and modification. * rem * * @@ -26,7 +26,7 @@ IF /I "%~1" == "/?" GOTO SHOWHELP SET INPUTDIRx86=bin\Release_x86_v142 SET INPUTDIRx64=bin\Release_x64_v142 -SET "TEMP_NAME=temp_zip" +SET "TEMP_NAME=temp_7-zip" IF NOT EXIST "..\%INPUTDIRx86%\Notepad3.exe" CALL :SUBMSG "ERROR" "Compile Notepad3 x86 first!" IF NOT EXIST "..\%INPUTDIRx86%\minipath.exe" CALL :SUBMSG "ERROR" "Compile MiniPath x86 first!" @@ -45,21 +45,20 @@ CALL :SubZipFiles %INPUTDIRx64% x64 rem Compress everything into a single ZIP file PUSHD "packages" -IF EXIST "Notepad3_%NP2_VER%.zip" DEL "Notepad3_%NP2_VER%.zip" +IF EXIST "Notepad3_%NP3_VER%.zip" DEL "Notepad3_%NP3_VER%.zip" IF EXIST "%TEMP_NAME%" RD /S /Q "%TEMP_NAME%" IF NOT EXIST "%TEMP_NAME%" MD "%TEMP_NAME%" -REM IF EXIST "Notepad3_%NP2_VER%*.exe" COPY /Y /V "Notepad3_%NP2_VER%*.exe" "%TEMP_NAME%\" >NUL -IF EXIST "Notepad3_%NP2_VER%*.zip" COPY /Y /V "Notepad3_%NP2_VER%*.zip" "%TEMP_NAME%\" >NUL +IF EXIST "Notepad3_%NP3_VER%*.zip" COPY /Y /V "Notepad3_%NP3_VER%*.zip" "%TEMP_NAME%\" >NUL PUSHD "%TEMP_NAME%" -"%SEVENZIP%" a -tzip -mx=9 Notepad3_%NP2_VER%.zip * >NUL +"%SEVENZIP%" a -tzip -mx=7 Notepad3_%NP3_VER%.zip * >NUL IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!" -CALL :SUBMSG "INFO" "Notepad3_%NP2_VER%.zip created successfully!" +CALL :SUBMSG "INFO" "Notepad3_%NP3_VER%.zip created successfully!" -MOVE /Y "Notepad3_%NP2_VER%.zip" ".." >NUL +MOVE /Y "Notepad3_%NP3_VER%.zip" ".." >NUL POPD IF EXIST "%TEMP_NAME%" RD /S /Q "%TEMP_NAME%" @@ -75,7 +74,7 @@ EXIT /B :SubZipFiles -SET "ZIP_NAME=Notepad3_%NP2_VER%_%2%SUFFIX%" +SET "ZIP_NAME=Notepad3_%NP3_VER%_%2%SUFFIX%" TITLE Creating %ZIP_NAME%.zip... CALL :SUBMSG "INFO" "Creating %ZIP_NAME%.zip..." echo off @@ -103,7 +102,7 @@ SET "FAVORITES=%TEMP_NAME%\Favorites" IF NOT EXIST "%FAVORITES%" MD "%FAVORITES%" PUSHD "%TEMP_NAME%" -"%SEVENZIP%" a -tzip -mx=9^ +"%SEVENZIP%" a -tzip -mx=7^ "%ZIP_NAME%.zip" "License.txt" "Notepad3.exe" "Notepad3.ini" "grepWinLicense.txt" "Readme.txt"^ "Favorites" "minipath.exe" "minipath.ini" "grepWinNP3.exe" "lng" "themes" "Docs">NUL IF %ERRORLEVEL% NEQ 0 CALL :SUBMSG "ERROR" "Compilation failed!" @@ -140,7 +139,7 @@ FOR /F "tokens=3,4 delims= " %%K IN ( FOR /F "tokens=3,4 delims= " %%K IN ( 'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\VersionEx.h"') DO (SET "VerBuild=%%K") -SET NP2_VER=%VerMajor%.%VerMinor%.%VerRev%.%VerBuild% +SET NP3_VER=%VerMajor%.%VerMinor%.%VerRev%.%VerBuild% EXIT /B