Scripts for packaging application

This commit is contained in:
jdescottes 2014-06-22 00:05:02 +02:00
parent 42c799d217
commit 5e5ec1a358
4 changed files with 70 additions and 43 deletions

Binary file not shown.

View File

@ -0,0 +1,16 @@
setlocal
@echo off
pushd ..\..
set PISKEL_HOME=%cd%
popd
echo "Updating Piskel icon"
ResHacker -addoverwrite "%PISKEL_HOME%\dest\desktop\releases\windows\piskel.exe", "%PISKEL_HOME%\dest\desktop\releases\windows\piskel-release.exe", "%PISKEL_HOME%\src\logo.ico", ICONGROUP, IDR_MAINFRAME, 1033
pause
explorer "%PISKEL_HOME%\dest\desktop\releases\windows"
endlocal

View File

@ -1,5 +1,5 @@
setlocal setlocal
@echo off @ECHO off
pushd ..\.. pushd ..\..
set PISKEL_HOME=%cd% set PISKEL_HOME=%cd%
@ -10,44 +10,44 @@ set MISC_FOLDER=%PISKEL_HOME%\misc
set RELEASES_FOLDER=%PISKEL_HOME%\dest\desktop\releases set RELEASES_FOLDER=%PISKEL_HOME%\dest\desktop\releases
set DEST_FOLDER=%RELEASES_FOLDER%\mac set DEST_FOLDER=%RELEASES_FOLDER%\mac
echo "Building Piskel executable for Windows ..." ECHO "Building Piskel executable for Windows ..."
echo "Creating release directory ..." ECHO "Creating release directory ..."
mkdir %DEST_FOLDER% mkdir %DEST_FOLDER%
echo "DONE" ECHO "DONE"
echo "Creating application folder ..." ECHO "Creating application folder ..."
mkdir "%DEST_FOLDER%\piskel.app" mkdir "%DEST_FOLDER%\piskel.app"
echo "DONE" ECHO "DONE"
echo "Unzip application ..." ECHO "Unzip application ..."
mkdir "%APP_BIN%\node-webkit-unzipped" mkdir "%APP_BIN%\node-webkit-unzipped"
7za x "%APP_BIN%\node-webkit-v0.9.2-osx-ia32.zip" -o"%APP_BIN%\node-webkit-unzipped" 7za x "%APP_BIN%\node-webkit-v0.9.2-osx-ia32.zip" -o"%APP_BIN%\node-webkit-unzipped"
echo "DONE" ECHO "DONE"
pause pause
echo "Copy application ..." ECHO "Copy application ..."
xcopy "%APP_BIN%\node-webkit-unzipped\node-webkit.app" "%DEST_FOLDER%\piskel.app" /E xcopy "%APP_BIN%\node-webkit-unzipped\node-webkit.app" "%DEST_FOLDER%\piskel.app" /E
:: xcopy "%APP_BIN%\node-webkit.app" "%DEST_FOLDER%\piskel.app" /E :: xcopy "%APP_BIN%\node-webkit.app" "%DEST_FOLDER%\piskel.app" /E
echo "DONE" ECHO "DONE"
echo "Copy Info.plist ..." ECHO "Copy Info.plist ..."
set CONTENTS_FOLDER=%DEST_FOLDER%\piskel.app\Contents set CONTENTS_FOLDER=%DEST_FOLDER%\piskel.app\Contents
copy "%MISC_FOLDER%\desktop\Info.plist" "%CONTENTS_FOLDER%\" copy "%MISC_FOLDER%\desktop\Info.plist" "%CONTENTS_FOLDER%\"
echo "DONE" ECHO "DONE"
echo "Copy application ..." ECHO "Copy application ..."
set RESOURCES_FOLDER=%CONTENTS_FOLDER%\Resources set RESOURCES_FOLDER=%CONTENTS_FOLDER%\Resources
copy "%RELEASES_FOLDER%\piskel\piskel.nw" "%RESOURCES_FOLDER%\" copy "%RELEASES_FOLDER%\piskel\piskel.nw" "%RESOURCES_FOLDER%\"
mv "%RESOURCES_FOLDER%\piskel.nw" "%RESOURCES_FOLDER%\app.nw" mv "%RESOURCES_FOLDER%\piskel.nw" "%RESOURCES_FOLDER%\app.nw"
echo "%RESOURCES_FOLDER%" ECHO "%RESOURCES_FOLDER%"
echo "DONE" ECHO "DONE"
echo "Copy icon ..." ECHO "Copy icon ..."
rm "%RESOURCES_FOLDER%\nw.icns" DEL "%RESOURCES_FOLDER%\nw.icns"
copy "%MISC_FOLDER%\desktop\nw.icns" "%RESOURCES_FOLDER%\" COPY "%MISC_FOLDER%\desktop\nw.icns" "%RESOURCES_FOLDER%\"
echo "DONE" ECHO "DONE"
pause pause

View File

@ -1,36 +1,47 @@
setlocal @ECHO off
@echo off
pushd ..\.. SETLOCAL
set PISKEL_HOME=%cd%
popd
echo "Building Piskel executable for Windows ..." PUSHD ..\..
set PISKEL_HOME=%cd%
POPD
echo "Creating release directory ..." set VBOX_PATH="C:\Program Files (x86)\Enigma Virtual Box"
mkdir "%PISKEL_HOME%\dest\desktop\releases\windows" set RESOURCE_HACKER_PATH="C:\Program Files (x86)\Resource Hacker"
echo "DONE"
echo "Packaging executable ..." set APP_BIN="%PISKEL_HOME%\dest\desktop\cache\win\0.9.2"
copy /b "%PISKEL_HOME%\dest\desktop\cache\win\0.9.2\nw.exe"+"%PISKEL_HOME%\dest\desktop\releases\piskel\piskel.nw" "%PISKEL_HOME%\dest\desktop\releases\windows\piskel.exe" set MISC_FOLDER=%PISKEL_HOME%\misc
echo "DONE" set RELEASES_FOLDER=%PISKEL_HOME%\dest\desktop\releases
set DEST_FOLDER=%RELEASES_FOLDER%\win
echo "Copying dependencies ..." ECHO "Building Piskel executable for Windows ..."
copy "%PISKEL_HOME%\dest\desktop\cache\win\0.9.2\*.dll" "%PISKEL_HOME%\dest\desktop\releases\windows\"
copy "%PISKEL_HOME%\dest\desktop\cache\win\0.9.2\nw.pak" "%PISKEL_HOME%\dest\desktop\releases\windows\"
echo "DONE"
ECHO "Creating release directory ..."
MKDIR "%DEST_FOLDER%"
ECHO "DONE"
echo "Updating Piskel icon" ECHO "Packaging executable ..."
ResHacker -addoverwrite "%PISKEL_HOME%\dest\desktop\releases\windows\piskel.exe", "%PISKEL_HOME%\dest\desktop\releases\windows\piskel-release.exe", "%PISKEL_HOME%\misc\desktop\logo.ico", ICONGROUP, IDR_MAINFRAME, 1033 COPY /b "%APP_BIN%\nw.exe"+"%RELEASES_FOLDER%\piskel\piskel.nw" "%DEST_FOLDER%\piskel-raw.exe"
rm "%PISKEL_HOME%\dest\desktop\releases\windows\piskel.exe" ECHO "DONE"
mv "%PISKEL_HOME%\dest\desktop\releases\windows\piskel-release.exe" "%PISKEL_HOME%\dest\desktop\releases\windows\piskel.exe"
echo "DONE"
ECHO "COPYing dependencies ..."
COPY "%APP_BIN%\*.dll" "%DEST_FOLDER%\"
COPY "%APP_BIN%\nw.pak" "%DEST_FOLDER%\"
ECHO "DONE"
ECHO "Updating Piskel icon -- Using Resource Hacker"
%RESOURCE_HACKER_PATH%\ResHacker -addoverwrite "%DEST_FOLDER%\piskel-raw.exe", "%DEST_FOLDER%\piskel-exploded.exe", "%MISC_FOLDER%\desktop\logo.ico", ICONGROUP, IDR_MAINFRAME, 1033
DEL "%DEST_FOLDER%\piskel-raw.exe"
ECHO "DONE"
pause ECHO "Boxing application to single file -- Using Enigma Virtual Box"
%VBOX_PATH%\enigmavbconsole "%MISC_FOLDER%\desktop\package-piskel.evb"
DEL "%DEST_FOLDER%\*.dll"
DEL "%DEST_FOLDER%\nw.pak"
DEL "%DEST_FOLDER%\piskel-exploded.exe"
ECHO "DONE"
explorer "%PISKEL_HOME%\dest\desktop\releases\windows" PAUSE
explorer "%DEST_FOLDER%\"
endlocal ENDLOCAL