Skip to content

Commit e07f86a

Browse files
committed
pak: add bat wrapper for windows
an easy-to-use drag-and-drop wrapper and bump version to 2.0
1 parent 3698170 commit e07f86a

File tree

5 files changed

+35
-1
lines changed

5 files changed

+35
-1
lines changed

appveyor.bat

+2
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ set MSYSTEM=MINGW32
1818
call C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./test.sh"
1919
move /Y .\build_i686-w64-mingw32\pak.exe .\pak_mingw32.exe
2020

21+
echo Packaging...
22+
7z a -mx9 chrome-pak.7z .\pak_mingw64.exe .\pak_mingw32.exe .\pack.bat .\unpack.bat
2123
echo Done.

appveyor.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.0-{build}
1+
version: 2.0-{build}
22
skip_tags: true
33
build_script:
44
- cmd: >-
@@ -11,5 +11,6 @@ test: off
1111
artifacts:
1212
- path: pak_mingw64.exe
1313
- path: pak_mingw32.exe
14+
- path: chrome-pak.7z
1415
cache:
1516
- tests

pack.bat

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@echo off
2+
setlocal EnableExtensions EnableDelayedExpansion
3+
if exist "%SystemRoot%\SysWOW64\cmd.exe" set x64=1
4+
set core_x64=pak_mingw64.exe
5+
set core_x86=pak_mingw32.exe
6+
set "WORK_DIR=%~dp0"
7+
set "file=%~1"
8+
set "pack_file=%~dpn1_packed.pak"
9+
if not exist "%WORK_DIR%" md "%WORK_DIR%"
10+
pushd "%WORK_DIR%"
11+
if "%x64%"=="1" ( set core=%core_x64% ) else ( set core=%core_x86% )
12+
if not exist %core% echo core program (%core%) NOT FOUND! &pause &exit
13+
if exist "%file%" %core% -p "%file%" "%pack_file%"
14+
if exist "%pack_file%" echo packed "%pack_file%" from "%file%"
15+
timeout /t 5||pause

test.sh

100644100755
File mode changed.

unpack.bat

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@echo off
2+
setlocal EnableExtensions EnableDelayedExpansion
3+
if exist "%SystemRoot%\SysWOW64\cmd.exe" set x64=1
4+
set core_x64=pak_mingw64.exe
5+
set core_x86=pak_mingw32.exe
6+
set "WORK_DIR=%~dp0"
7+
set "file=%~1"
8+
set unpack_dir=%~dpn1_unpacked
9+
if not exist "%WORK_DIR%" md "%WORK_DIR%"
10+
pushd "%WORK_DIR%"
11+
if "%x64%"=="1" ( set core=%core_x64% ) else ( set core=%core_x86% )
12+
if not exist %core% echo core program (%core%) NOT FOUND! &pause &exit
13+
if not exist "%unpack_dir%" md "%unpack_dir%"
14+
if exist "%file%" %core% -u "%file%" "%unpack_dir%"
15+
if exist "%unpack_dir%\pak_index.ini" echo Unpacked "%file%" to "%unpack_dir%"
16+
timeout /t 5||pause

0 commit comments

Comments
 (0)