Windows Auto zip batch

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
akira
Prole
Posts: 9
Joined: Sun Mar 07, 2010 5:23 pm

Windows Auto zip batch

Post 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.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Windows Auto zip batch

Post 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. :)
akira
Prole
Posts: 9
Joined: Sun Mar 07, 2010 5:23 pm

Re: Windows Auto zip batch

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Windows Auto zip batch

Post 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)
Help us help you: attach a .love.
akira
Prole
Posts: 9
Joined: Sun Mar 07, 2010 5:23 pm

Re: Windows Auto zip batch

Post 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
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Windows Auto zip batch

Post 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.
Help us help you: attach a .love.
User avatar
DumpOnIt
Prole
Posts: 30
Joined: Fri Apr 06, 2012 6:59 am

Re: Windows Auto zip batch

Post 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:
akira
Prole
Posts: 9
Joined: Sun Mar 07, 2010 5:23 pm

Re: Windows Auto zip batch

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot] and 4 guests