Page 1 of 1

Windows Auto zip batch

Posted: Wed Apr 18, 2012 2:01 am
by akira
So one day I was annoyed because of manually zipping and and running the compiled file so i decided to make this handy little batch file to do it for me. Because I am a lazy prick.

Code: Select all

@REM ------- BEGIN build.bat ----------------
@setlocal
@echo off
set path="C:\Program Files\WinRAR\";%path%
set path="C:\games\love\0.8.0\";%path%

winrar.exe a -afzip -m5 -ed -r -ep1 lovegame-src.zip lovegame-src\*

ren lovegame-src.zip lovegame-src.love

rem C:\games\LOVE\0.8.0\love.exe --console lovegame-src.love
love --console lovegame-src.love

ren lovegame-src.love lovegame-src.zip

del lovegame-src.zip

REM ------- END build.bat ------------------
Set your love install path or manually add it. This uses winrar to zip and basic windows commands to rename and delete.

Thought I would share this because well it saves some time. more so when your on a roll and forget things easy.

Re: Windows Auto zip batch

Posted: Wed Apr 18, 2012 2:41 am
by slime
This is useful for creating a .love file for distributing on the forums or wherever, but I hope you know you can drag the folder containing main.lua onto the LÖVE executable (or onto a shortcut to it) and it will run your game. :)

Re: Windows Auto zip batch

Posted: Wed Apr 18, 2012 2:44 am
by akira
slime wrote:This is useful for creating a .love file for distributing on the forums or wherever, but I hope you know you can drag the folder containing main.lua onto the LÖVE executable (or onto a shortcut to it) and it will run your game. :)
No I didn't know that. But my games folder and my love installation folder are in two different locations. So this was the easier method of keeping my screen clean.

Besides I was spoiled by osx so my desktop is almost always clean. Even though I use 7.

Re: Windows Auto zip batch

Posted: Wed Apr 18, 2012 5:10 pm
by Robin
Still, you can replace it with a single line:

Code: Select all

love --console lovegame-src
(basically what dragging and dropping does, only with the console)

Re: Windows Auto zip batch

Posted: Wed Apr 18, 2012 5:35 pm
by akira
This is true, but the batch file is more of a tool for auto zipping, renaming then running, and finally deleting when your done testing. Its a tool for lazy people. :D

Re: Windows Auto zip batch

Posted: Wed Apr 18, 2012 5:40 pm
by Robin
But it does all this extra work! The net effect of the two are exactly the same (provided you're not doing something weird like depending on the case insensitivity of NTFS).

If it didn't delete the .love at the end, it would be useful to test a game right before distributing the .love.

Re: Windows Auto zip batch

Posted: Wed Apr 18, 2012 10:31 pm
by DumpOnIt
Smart batch file! Here's another way you can test it:

Code: Select all

"C:\Program Files\LOVE\love.exe" .
Play.bat in the source folder!! :awesome:

Re: Windows Auto zip batch

Posted: Thu Apr 19, 2012 12:20 am
by akira
Robin wrote:But it does all this extra work! The net effect of the two are exactly the same (provided you're not doing something weird like depending on the case insensitivity of NTFS).

If it didn't delete the .love at the end, it would be useful to test a game right before distributing the .love.
so you remove a hole 2 lines of code? Then it will run its test, package and your done.