Skip to content

Commit

Permalink
pak: add bat wrapper for windows
Browse files Browse the repository at this point in the history
an easy-to-use drag-and-drop wrapper
and bump version to 2.0
  • Loading branch information
myfreeer committed Apr 15, 2018
1 parent 3698170 commit e07f86a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions appveyor.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ set MSYSTEM=MINGW32
call C:\msys64\usr\bin\bash -lc "cd \"$APPVEYOR_BUILD_FOLDER\" && exec ./test.sh"
move /Y .\build_i686-w64-mingw32\pak.exe .\pak_mingw32.exe

echo Packaging...
7z a -mx9 chrome-pak.7z .\pak_mingw64.exe .\pak_mingw32.exe .\pack.bat .\unpack.bat
echo Done.
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 0.0-{build}
version: 2.0-{build}
skip_tags: true
build_script:
- cmd: >-
Expand All @@ -11,5 +11,6 @@ test: off
artifacts:
- path: pak_mingw64.exe
- path: pak_mingw32.exe
- path: chrome-pak.7z
cache:
- tests
15 changes: 15 additions & 0 deletions pack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off
setlocal EnableExtensions EnableDelayedExpansion
if exist "%SystemRoot%\SysWOW64\cmd.exe" set x64=1
set core_x64=pak_mingw64.exe
set core_x86=pak_mingw32.exe
set "WORK_DIR=%~dp0"
set "file=%~1"
set "pack_file=%~dpn1_packed.pak"
if not exist "%WORK_DIR%" md "%WORK_DIR%"
pushd "%WORK_DIR%"
if "%x64%"=="1" ( set core=%core_x64% ) else ( set core=%core_x86% )
if not exist %core% echo core program (%core%) NOT FOUND! &pause &exit
if exist "%file%" %core% -p "%file%" "%pack_file%"
if exist "%pack_file%" echo packed "%pack_file%" from "%file%"
timeout /t 5||pause
Empty file modified test.sh
100644 → 100755
Empty file.
16 changes: 16 additions & 0 deletions unpack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off
setlocal EnableExtensions EnableDelayedExpansion
if exist "%SystemRoot%\SysWOW64\cmd.exe" set x64=1
set core_x64=pak_mingw64.exe
set core_x86=pak_mingw32.exe
set "WORK_DIR=%~dp0"
set "file=%~1"
set unpack_dir=%~dpn1_unpacked
if not exist "%WORK_DIR%" md "%WORK_DIR%"
pushd "%WORK_DIR%"
if "%x64%"=="1" ( set core=%core_x64% ) else ( set core=%core_x86% )
if not exist %core% echo core program (%core%) NOT FOUND! &pause &exit
if not exist "%unpack_dir%" md "%unpack_dir%"
if exist "%file%" %core% -u "%file%" "%unpack_dir%"
if exist "%unpack_dir%\pak_index.ini" echo Unpacked "%file%" to "%unpack_dir%"
timeout /t 5||pause

0 comments on commit e07f86a

Please sign in to comment.