1 (edited by Blade67 2016-05-05 22:34:41)

Topic: 0.7 SDL2 Installer

Hello dear Teeworlds community!

As a request of some of my fellow programmer friends, I made a little batch script that automatically downloads and installs the SDL2 librairy!

Yes, i know, batch isn't any good, blabla. I made it to make it easyer and faster to setup a new project. And yes, i know that it'll only work on windows machines, and thats exactly why I made it. Linux mahines seem to download SDL2 automatically, so I wanted to make it easyer for Windows user too.

http://i.imgur.com/aMVGNCc.png

And yes, I hear you yell already "But Blaaaaaade!? What about Mac users!?". Honestly, I don't care about you guys. Unworthy yous! Either use Linux or Windows, but not the freaking prefix of Mac Donalds!

Anyways, here you have it :

Pastebin : [X]
Mediafire : [X]

Juste place the script in the source folder you wish, execute it, and chose one of the options!
Oh, and before i forget, you need 7-Zip for it to work. Link is in the script under the "a" option.


// Edit : Update :
Update to 0.2.

Fixed SDL version issue (Still not sure if it works how it should, let me know what version of SDL you're using!)
Fixed way too many syntax errors, can't believe it worked before..
Changed the unzipping tool. You no longer need to have 7zip installed, it downloads a standalone version for the time it need it.
Added the "ra" command which clears everything back to normal. (Removes all SDL files without deleting sdl.lua and VERSION.)
Added the version number under "a".
Downloading and installing now properly work independently of each other.
Complete installation now cleans after itself. No more temp files! Yay!

: // Blade

2

Re: 0.7 SDL2 Installer

Cool!

As I understand it, this downloads SDL 2 to be able to compile Teeworlds 0.7 on Windows?

3

Re: 0.7 SDL2 Installer

Exactly! It downloads it, extracts it from its zip file into the right folder.

4

Re: 0.7 SDL2 Installer

Why 7z and not built in .zip handler?

Clan: Riot (I'm one of three leaders: Mile, Deku, pie)
Host teeworlds maps on a fng/ctf/dm/ddrace server for testing:http://riotproductions.tk/teewo/ broken-need reinstall nginx http://riotproductions.tk/bounce?whatEven, Teeworlds NA Discord chat

5

Re: 0.7 SDL2 Installer

[pieLover] wrote:

Why 7z and not built in .zip handler?

Just guessing: The built-in zip handler probably can't be used from the command line.

6 (edited by Slinack 2016-05-05 11:17:13)

Re: 0.7 SDL2 Installer

Nice tool!

I still don't understand why the devs decided to remove those dlls from the main repository... I mean, whatever were their reasons I believe it's another step into pushing people away from playing around with teeworlds' code. It looks unnecessary and unfriendly.

Other than that, I did read your code and run it... Maybe change line 99 to goto :complete?
Also using %ProgramFiles% for sure will cause some failures to locate 7z.exe (as that's not a default path for everyone).
Well, after proper unzipping, it still doesn't solve the issue properly (working on generating a log...)
And you could also add a "q - quit the application" smile

edit: actually from what i can gather, it's somewhat related to the unzipping process (i'll do it manually).
okay so, from 7zip's --help: "e : extract files from archive (without using directory names)" looks like a bad command to use

check out these maps: infiltrate - choco - dustycloud

7

Re: 0.7 SDL2 Installer

Slinack wrote:

Other than that, I did read your code and run it... Maybe change line 99 to goto :complete?

This will cause a loop.

Slinack wrote:

Also using %ProgramFiles% for sure will cause some failures to locate 7z.exe (as that's not a default path for everyone).
Well, after proper unzipping, it still doesn't solve the issue properly (working on generating a log...)
And you could also add a "q - quit the application" smile

To detect where 7z is installed would just be ugly, anyways you should add 7z to your %PATH% because its easier to access.

One Idea would be to use 3rd party tools like "unzip.cmd"
download them tempoary and using them for unzipping.
I would rather use a folder in %TEMP% for cosmetic reasons

There are three kinds of lies: lies, damned lies, and benchmarks.

8

Re: 0.7 SDL2 Installer

http://stackoverflow.com/q/21704041/5196732

Having troubles finding servers in the serverlist? Go to Pastebin (its a referer cause there is daily a new pastebin) and add the lines to your settings.cfg (in %APPDATA%\teeworlds). Then open teeworlds and go to the favorites tab. (Note however, standard teeworlds client can only show 256 favorites, use ddnet instead)

9

Re: 0.7 SDL2 Installer

Its still a pretty early version, yesterday night, i made some changes and plan to do more, especially since SDL 2, at least this version, doesn't seem to work for everyone.

So, i'll fix the version issue, maybe make some configuration lines for easyer use, and maybe add a proper unzipper.

: // Blade.

10

Re: 0.7 SDL2 Installer

Nice, thanks for that work!

Not Luck, Just Magic.

11

Re: 0.7 SDL2 Installer

@Dune Hearing that from YOU, one of the most amazing programmers out there, is an honor.

_____________________________________________

Added complete removal of SDL (for changing versions and stuff)
Fixed Version issue
Fixed Syntax errors by some users
Fixed a bug which made the script think the directory existed, even though it was a file (probably caused by syntax errors.)
Working on a new unzipping system.

Updated script will follow in the comming hours!

: // Blade.

12 (edited by xush 2016-05-05 22:12:42)

Re: 0.7 SDL2 Installer

Thanks, its pretty useful if you just wanna jump right into coding.

Real programmers don't comment their code - it was hard to write, it should be hard to understand.
Proudly verkeckt since 2010.

13

Re: 0.7 SDL2 Installer

@xush Thats exactly what it's for! ^^

Just uploaded a new version, let me get some feedback!

: // Blade.

14

Re: 0.7 SDL2 Installer

Blade67 wrote:

And yes, I hear you yell already "But Blaaaaaade!? What about Mac users!?". Honestly, I don't care about you guys. Unworthy yous! Either use Linux or Windows, but not the freaking prefix of Mac Donalds!

Actually it is quite easy to install sdl2 on Mac. You just need MacPorts or Homebrew.

Then you can just do:

# macports:
sudo port install libsdl2

# homebrew:
brew install sdl2
Luck is allowed

15

Re: 0.7 SDL2 Installer

@HMH Like i said, i really don't care about mac users, they only have 20% of the work of linux or windows users, thats cheaty!

16

Re: 0.7 SDL2 Installer

May you can create a Github repository to let others contribute to the Project.
"echo Press any key to continue. \n timeout 3 >nul" <- continues without user input.

There are three kinds of lies: lies, damned lies, and benchmarks.

17

Re: 0.7 SDL2 Installer

@fallen.kn Yes, i know, i made it so that people who, like me, are doing other stuff while waiting for it to finish.

A github repo, huh? Maybe i'll do that. Or maybe i'll simply try creating a modular compiler, which lets you choose what to compile, what you want to output (client, server, tools, or all of it) and the version. And make it remember which projects you last compiled. Wouldn't be a bad idea actually...

18

Re: 0.7 SDL2 Installer

@blade or maybe write a teeworlds IDE from scratch!

Having troubles finding servers in the serverlist? Go to Pastebin (its a referer cause there is daily a new pastebin) and add the lines to your settings.cfg (in %APPDATA%\teeworlds). Then open teeworlds and go to the favorites tab. (Note however, standard teeworlds client can only show 256 favorites, use ddnet instead)

19

Re: 0.7 SDL2 Installer

@Schwertspitze maybe i'll do that. Would'nt be a bad IDEa. (Got it? Gosh i should stop trying to be funny...)

20 (edited by Schwertspize 2016-05-06 15:06:02)

Re: 0.7 SDL2 Installer

Reminds me of IntelliJ IDEA (it's an IDE)

@mods: if you think this is not suitable in this post, feel free to remove it

Having troubles finding servers in the serverlist? Go to Pastebin (its a referer cause there is daily a new pastebin) and add the lines to your settings.cfg (in %APPDATA%\teeworlds). Then open teeworlds and go to the favorites tab. (Note however, standard teeworlds client can only show 256 favorites, use ddnet instead)

21

Re: 0.7 SDL2 Installer

@Schwertspitze it's alright, fits the theme of a upcomming project!

: // Blade.

22

Re: 0.7 SDL2 Installer

Doesnt work for me. I've copyed the .bat File into my teeworlds/other Directory and run it as Administrator. I'd try it with the parameter -c and also -d (after that -i). I still get Errors that SDL.h and ft2build.h can't be found.
Win10, VS13 and Bam 0.5

23

Re: 0.7 SDL2 Installer

@kingtee.ger Could you post your error log?
And sorry for the late response, stuff and things going on.

: // Blade.