create_snapshot.bat 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. rem The new package will be created from here
  2. set BUILD_PACK_DIR=%TEMP%\doublecmd-release
  3. rem The new package will be saved here
  4. set PACK_DIR=%CD%\doublecmd-release
  5. rem Prepare target dir
  6. mkdir %PACK_DIR%
  7. rem Get revision number
  8. call src\platform\git2revisioninc.exe.cmd %CD%
  9. echo %REVISION%> %PACK_DIR%\revision.txt
  10. rem Read version number
  11. for /f tokens^=2delims^=^" %%a in ('findstr "MajorVersionNr" src\doublecmd.lpi') do (set DC_MAJOR=%%a)
  12. for /f tokens^=2delims^=^" %%a in ('findstr "MinorVersionNr" src\doublecmd.lpi') do (set DC_MINOR=%%a)
  13. for /f tokens^=2delims^=^" %%a in ('findstr "RevisionNr" src\doublecmd.lpi') do (set DC_MICRO=%%a)
  14. if [%DC_MINOR%] == [] set DC_MINOR=0
  15. if [%DC_MICRO%] == [] set DC_MICRO=0
  16. set DC_VER=%DC_MAJOR%.%DC_MINOR%.%DC_MICRO%
  17. rem Change log
  18. git log -n 10 --format="%%h %%al %%ai%%n%%s%%n" > %PACK_DIR%\changelog.txt
  19. rem Get libraries
  20. pushd install
  21. curl -o windows.7z -L https://github.com/doublecmd/snapshots/raw/main/windows.7z
  22. "%ProgramFiles%\7-Zip\7z.exe" x windows.7z
  23. del /Q windows.7z
  24. popd
  25. rem Set processor architecture
  26. set CPU_TARGET=i386
  27. set OS_TARGET=win32
  28. call :doublecmd
  29. rem Set processor architecture
  30. set CPU_TARGET=x86_64
  31. set OS_TARGET=win64
  32. call :doublecmd
  33. GOTO:EOF
  34. :doublecmd
  35. rem Build all components of Double Commander
  36. call build.bat darkwin
  37. rem Copy libraries
  38. copy install\windows\lib\%CPU_TARGET%\*.dll %CD%\
  39. copy install\windows\lib\%CPU_TARGET%\winpty-agent.exe %CD%\
  40. rem Prepare install dir
  41. mkdir %BUILD_PACK_DIR%
  42. rem Prepare install files
  43. call install\windows\install.bat
  44. rem Create *.7z archive
  45. "%ProgramFiles%\7-Zip\7z.exe" a -mx9 %PACK_DIR%\doublecmd-%DC_VER%.r%REVISION%.%CPU_TARGET%-%OS_TARGET%.7z %DC_INSTALL_DIR%\*
  46. rem Clean
  47. del /Q *.dll
  48. del /Q *.exe
  49. call clean.bat
  50. rm -rf %BUILD_PACK_DIR%
  51. GOTO:EOF