From 5e5ec1a358fb81f3413dd4f23328e4d377d23f09 Mon Sep 17 00:00:00 2001 From: jdescottes Date: Sun, 22 Jun 2014 00:05:02 +0200 Subject: [PATCH] Scripts for packaging application --- misc/desktop/package-piskel.evb | Bin 0 -> 7392 bytes misc/scripts/change-windows-icon.cmd | 16 ++++++ misc/scripts/package-mac-application.cmd | 38 ++++++------- misc/scripts/package-windows-executable.cmd | 59 ++++++++++++-------- 4 files changed, 70 insertions(+), 43 deletions(-) create mode 100644 misc/desktop/package-piskel.evb create mode 100644 misc/scripts/change-windows-icon.cmd diff --git a/misc/desktop/package-piskel.evb b/misc/desktop/package-piskel.evb new file mode 100644 index 0000000000000000000000000000000000000000..7c8bb5cbc8ff1a3b30f41aa5c5814b8f61be9127 GIT binary patch literal 7392 zcmeHMT~8B16uqzVD~ySc6v4y?Q%jm!j0uWq3;NKPl`goUEt`HQ{CV-5JB%~4AKexb ztjVT_}7pKg0J&$fYWCgfU}iXh}!j%23|p_fPzdp)ZAg>RzDz5_0@b@jaI-l^DWej3>66 zUsw3eaYLD@L@W{dDKnH`iZ0Z!i@qDk(;795q@gV_Fzywi+!5kGQS93=10QcODudYi zd43-Q&Y}z7M)F<#KSKKgURz@RoO`y9S~!OBVZ0Xj>%w;&6CwJ19>FhDZDp)lh<^lG z`kxv%8ELI`5SIz!!)VU&@n;cgUnOa^`J+u6XJlKMp`4?c=Rj^@mwEYG(Yt3~>N94@ z9Bs)<%&!YwZ8?==8Gsc>@W!#W_RvcYIB8#pweKQhG1wj-Sr*+vDLNzRY+fK9^kob# z%@OAbeA__G#`u(>GddiOr{ZW8R)@%W(qL_CE+)E$e9Prvws-Ytu2NiGn8o7?U0K;O z&DYS`l2__+i^jBNN1W&!W>~joy7tA$rAT=;z_ZD^kOS+CsJ7CE4YE4H%D`2e%*%2) zZ>e}x*4h`$fIK#Ao#1JT3_RAAnJfzDQzh+dX9gE%MKQx4&Z7hwwgl?M*0QG!V(T#b%3k;E zOP%3-IRoY;Sk9ZeU&+e$`Qu!5q=RwhZpt~+JFd?kai$hnC38s3ZN8|dc;sGYj-dw< zy>a_8L=(#RUfLE9p2BZ2qEP#8^X&VCtU8w;_jQokgPVKMW?#+Shpm3BL0%yLF8?F` z=GR5DcA6ces+X0LbDRkyeYeE-R(9uk$WBLVWg1yAO0g#;sJOGD?CkWx`3P%fEa5KI z$F9dcI7Xc}TNPbzjM;gb!j&b}cQUcoEm_SrZ+yN2&jR)bY9$3WzR8)vvO9(PJbauc ui>Ix%^lO~Sd)Td~_?UNwC&<3g2YkB}|HVSD`Dh-ahgcY|d{o%V===eT;Cgic literal 0 HcmV?d00001 diff --git a/misc/scripts/change-windows-icon.cmd b/misc/scripts/change-windows-icon.cmd new file mode 100644 index 00000000..caacdfb0 --- /dev/null +++ b/misc/scripts/change-windows-icon.cmd @@ -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 \ No newline at end of file diff --git a/misc/scripts/package-mac-application.cmd b/misc/scripts/package-mac-application.cmd index c76b82f0..b510bd13 100644 --- a/misc/scripts/package-mac-application.cmd +++ b/misc/scripts/package-mac-application.cmd @@ -1,5 +1,5 @@ setlocal -@echo off +@ECHO off pushd ..\.. set PISKEL_HOME=%cd% @@ -10,44 +10,44 @@ set MISC_FOLDER=%PISKEL_HOME%\misc set RELEASES_FOLDER=%PISKEL_HOME%\dest\desktop\releases 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% -echo "DONE" +ECHO "DONE" -echo "Creating application folder ..." +ECHO "Creating application folder ..." mkdir "%DEST_FOLDER%\piskel.app" -echo "DONE" +ECHO "DONE" -echo "Unzip application ..." +ECHO "Unzip application ..." mkdir "%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 -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.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 copy "%MISC_FOLDER%\desktop\Info.plist" "%CONTENTS_FOLDER%\" -echo "DONE" +ECHO "DONE" -echo "Copy application ..." +ECHO "Copy application ..." set RESOURCES_FOLDER=%CONTENTS_FOLDER%\Resources copy "%RELEASES_FOLDER%\piskel\piskel.nw" "%RESOURCES_FOLDER%\" mv "%RESOURCES_FOLDER%\piskel.nw" "%RESOURCES_FOLDER%\app.nw" -echo "%RESOURCES_FOLDER%" -echo "DONE" +ECHO "%RESOURCES_FOLDER%" +ECHO "DONE" -echo "Copy icon ..." -rm "%RESOURCES_FOLDER%\nw.icns" -copy "%MISC_FOLDER%\desktop\nw.icns" "%RESOURCES_FOLDER%\" -echo "DONE" +ECHO "Copy icon ..." +DEL "%RESOURCES_FOLDER%\nw.icns" +COPY "%MISC_FOLDER%\desktop\nw.icns" "%RESOURCES_FOLDER%\" +ECHO "DONE" pause diff --git a/misc/scripts/package-windows-executable.cmd b/misc/scripts/package-windows-executable.cmd index 1e6019d0..5d37241c 100644 --- a/misc/scripts/package-windows-executable.cmd +++ b/misc/scripts/package-windows-executable.cmd @@ -1,36 +1,47 @@ -setlocal -@echo off +@ECHO off -pushd ..\.. -set PISKEL_HOME=%cd% -popd +SETLOCAL -echo "Building Piskel executable for Windows ..." + PUSHD ..\.. + set PISKEL_HOME=%cd% + POPD -echo "Creating release directory ..." -mkdir "%PISKEL_HOME%\dest\desktop\releases\windows" -echo "DONE" + set VBOX_PATH="C:\Program Files (x86)\Enigma Virtual Box" + set RESOURCE_HACKER_PATH="C:\Program Files (x86)\Resource Hacker" -echo "Packaging executable ..." -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" -echo "DONE" + set APP_BIN="%PISKEL_HOME%\dest\desktop\cache\win\0.9.2" + set MISC_FOLDER=%PISKEL_HOME%\misc + set RELEASES_FOLDER=%PISKEL_HOME%\dest\desktop\releases + set DEST_FOLDER=%RELEASES_FOLDER%\win -echo "Copying dependencies ..." -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 "Building Piskel executable for Windows ..." + ECHO "Creating release directory ..." + MKDIR "%DEST_FOLDER%" + ECHO "DONE" -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%\misc\desktop\logo.ico", ICONGROUP, IDR_MAINFRAME, 1033 -rm "%PISKEL_HOME%\dest\desktop\releases\windows\piskel.exe" -mv "%PISKEL_HOME%\dest\desktop\releases\windows\piskel-release.exe" "%PISKEL_HOME%\dest\desktop\releases\windows\piskel.exe" -echo "DONE" + ECHO "Packaging executable ..." + COPY /b "%APP_BIN%\nw.exe"+"%RELEASES_FOLDER%\piskel\piskel.nw" "%DEST_FOLDER%\piskel-raw.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 \ No newline at end of file +ENDLOCAL \ No newline at end of file