SFML community forums

General => SFML projects => Topic started by: binary1248 on November 30, 2013, 02:12:43 am

Title: SFML Installer
Post by: binary1248 on November 30, 2013, 02:12:43 am
Since so many people tend to have problems/fear building SFML for themselves instead of relying on pre-built versions which are outdated relatively fast and going through the headache of trying to get incompatible versions running on a totally different compiler version, I thought this would be a good opportunity to put SFGUI and SFNUL through a bit of testing.

That, and I was completely bored :P.

So any ways... I present... SFML Installer.

What is SFML Installer you might ask? Well, it's not like any other installer you have encountered before. This one actually builds the files it installs on the fly on the target system using your development toolchain. This rules out any possible incompatibilities and since it grabs the latest SFML master, a "reinstall" should automatically update your library to the latest version available on GitHub (in case Laurent was nice and fixed the bug you might have discovered ^^). And... the dialog windows are all driven by OpenGL :D.

Under the hood, SFML Installer is basically just a download client (which supports HTTPS with certificate verification through SFNUL for GitHub downloading) and a command executor. All it does is grab SFML from GitHub, looks for CMake and your toolchain and configures/compiles SFML so that it can install it to a directory of your choosing. This is simple for some people to do on their own, however the installer does it all automatically for those who can't or don't want to.

Right now, it has support for Code::Blocks and Visual Studio detection, meaning it will find make/nmake if you have a typical install of one of those on your system. If you have MinGW or nmake installed by themselves, they will only be found if they are executable through the PATH environment variable, but I assume they would have been added to PATH anyway in that case. If you are unlucky enough to have multiple Visual Studio installations on your system, SFML Installer will automatically use the latest version that is installed, if you don't like it and think it can be done better... repository details further down :P.

The default settings compile all possible configurations of dynamic/static and debug/release, so you won't be missing your favourite library when developing.

Since using pre-compiled libraries is mostly popular on Windows, I only coded in support for Windows for now. Anyone who thinks Linux/OS X might need support can fill in the empty functions that are already in the repository and try your luck. Whoever has more ambitious plans for the installer framework is free to realize them since the code is released under the WTFPL... because I was bored.

Like most open source code I write, the repository can be found over at GitHub: https://github.com/binary1248/SFMLInstaller

If you don't care about the code and just want the statically linked executable: SFMLInstaller.exe (http://en.file-upload.net/download-8348283/SFMLInstaller.exe.html)

If you don't trust me and think my win32 code will format your drive... well you're out of luck for now ;D.
Title: Re: SFML Installer
Post by: Grimshaw on November 30, 2013, 04:10:48 am
Man this project is so amazing, with the correct growth, it can become huge! Not only in the sfml domain.. It could be made even more generic! Good job!
Title: AW: SFML Installer
Post by: eXpl0it3r on November 30, 2013, 11:53:40 am
Now we just need to test it some more and then make Laurent to host the installer and promote it on the download page. :D
Title: Re: SFML Installer
Post by: Tank on November 30, 2013, 02:17:21 pm
Actually that's what a build system should be normally capable of. Automatically. Let's build something like that to make building others' stuff fun again. ;-)
Title: Re: SFML Installer
Post by: The Illusionist Mirage on November 30, 2013, 04:44:26 pm
Nice project binary1248. :)

Quote from: binary1248
If you don't trust me and think my win32 code will format your drive

But I'm not sure of what you meant by that.

Now we just need to test it some more and then make Laurent to host the installer and promote it on the download page. :D

I agree with exploiter.

P.S binary1248 Your license is amazing ;)
Title: Re: SFML Installer
Post by: nebula on December 02, 2013, 08:47:31 pm
Just tested it because I got a new version of visual studio. and everything worked out fine :D (except avira.. that program trolled me :D)
Title: Re: SFML Installer
Post by: Laurent on December 02, 2013, 09:10:04 pm
A few suggestions that may add some comfort at small costs:

- add checkboxes to select the configurations to build (it's such a waste of time to build unused configurations)
- add checkboxes to select the most relevant CMake options (build doc, build examples, ...)
- add the ability to cancel everything (closing the SFML window doesn't stop the app if it's not finished)
- choose where to extract the source tree (with an option to remove it after compilation)?
Title: Re: SFML Installer
Post by: binary1248 on December 03, 2013, 05:45:53 am
A few suggestions that may add some comfort at small costs:

- add checkboxes to select the configurations to build (it's such a waste of time to build unused configurations)
- add checkboxes to select the most relevant CMake options (build doc, build examples, ...)
- add the ability to cancel everything (closing the SFML window doesn't stop the app if it's not finished)
- choose where to extract the source tree (with an option to remove it after compilation)?
Where is the pull request? ;D
Title: Re: SFML Installer
Post by: Laurent on December 03, 2013, 07:39:18 am
I wish I could get bored like you :P
Title: Re: SFML Installer
Post by: Tank on December 03, 2013, 08:06:17 am
YMMD :D
Title: Re: SFML Installer
Post by: r0d on December 03, 2013, 03:54:04 pm
Hello,

is it possible to compile SFML in 64bits for VS2013 with this auto-installer? If yes, how?
Thank you.
Title: Re: SFML Installer
Post by: binary1248 on December 03, 2013, 04:24:26 pm
If you need anything more advanced than the "default settings 32-bit" build, then you should compile it yourself instead of using the Installer. Anybody willing to build 64-bit applications is expected to know how to do this anyway so they aren't really the target audience of the Installer. But... the source code is freely available, so if you want to modify it to support 64-bit builds, go ahead.
Title: Re: SFML Installer
Post by: Tank on December 04, 2013, 08:52:11 am
Why is 64 bits on Windows still treated as being so special by many people?
Title: Re: SFML Installer
Post by: Laurent on December 04, 2013, 09:09:40 am
Quote
Why is 64 bits on Windows still treated as being so special by many people?
32 bits works everywhere and is ok for 99.9% of apps.
64 bits works on 64 bits OSes only and has no benefit for 99.9% of apps.
Title: Re: SFML Installer
Post by: Lo-X on December 04, 2013, 09:19:44 am
<troll>The size doesn't matter</troll>

Isn't it beneficial for games ? I mean more and more game have a special 64b version (if not by default now)
Title: Re: SFML Installer
Post by: Tank on December 04, 2013, 09:28:40 am
Lo-X, probably because of increased RAM demand.

Laurent, so there are still people installing a 32 bit operating system? I really wonder, because the last time I used a 32 bit Windows operating system was many many years ago. For me a 32 bit operating system is a limiting factor which can be avoided without any hassle.

And the reason why I'm asking why many people still see it as something special: I don't see a valid reason why someone who requests a 64 bit version is considered being a "pro" while someone who wants to go with 32 bit is a "valid newbie".
Title: Re: SFML Installer
Post by: eXpl0it3r on December 04, 2013, 09:36:42 am
Unfortunately there are still people using 32bit systems, but the numbers seem to decrease (http://store.steampowered.com/hwsurvey) (click on OS) month by month and the games shipping with 64bit applications are rising - for some I guess due to RAM usage.

Personally I'd like to just ignore 32bit and fully develop for x64, but as soon as you do so, you'll end up with at least one guy asking for a 32bit application and since one doesn't want to exclude others, has to use a 32bit compiler again.
Plus with MinGW there have been some more issues with x64.

Not to forget that Microsoft is treating 64bit as something special as well, by not providing an x64 compiler for VS express edition (iirc). ;)

On topic: I'll see what I can do, once I get some time to look at it. :)
Title: Re: SFML Installer
Post by: FRex on December 04, 2013, 01:40:37 pm
Quote
Why is 64 bits on Windows still treated as being so special by many people?
There is compatibility mode for 32 bit so there is not much point in caring unless you need tons of memory(which is pro).

Microsoft(apparently - see exploiter's post) doesn't provide 64 bit express, if you buy for few hundred dollars - you're a pro, if you pirate - you're evil = you don't get support for admitting it, if you have dreamspark - you SHOULD learn how to build and link yourself, that's the purpose of giving loot out for free, they are NOT gifts, they are given for learning purposes. MinGW in itself is tons of pain on 32 bit(can't be much better on 64, probably is worse) compared to how painless GCC is on Linux. Other compilers are for pros or cost money or both(Intel's, Borland's?).

It requires 2 builds if you want to support both (unless you abandon like 15-30% of user base and go only 64 bit), therefore you're a pro for knowing how to configure it all and ship two versions.

Articles like this surely don't help: http://www.gamedev.net/page/resources/_/technical/game-programming/managing-decoupling-part-2-polling-callbacks-and-events-r3044 when on gamedev and blogs of 'real' companies that claim to write 'good' code:
struct Callback16
{
  void (*f)(void);
  char data[12];
};

Unis, tutorials, old bad practices, etc. that neglect the 64 bit and/or assume pointer is 4 bytes don't help either.

Differences like registers, calling conventions etc. http://msdn.microsoft.com/en-us/library/7kcdt6fy.aspx don't seem like something non pro cares about..
Title: Re: SFML Installer
Post by: Laurent on December 04, 2013, 02:03:35 pm
Quote
Not to forget that Microsoft is treating 64bit as something special as well, by not providing an x64 compiler for VS express edition (iirc).
They do. The 64 bits MSVC version of SFML is not produced by pirated software :P
Title: Re: SFML Installer
Post by: FRex on December 04, 2013, 02:43:41 pm
They do only provide 32 bit or they do provide 64 bit too?
Also you already once stated you use(d) professional, I hope SFML wasn't built with pirated software back then either. :P
Title: Re: SFML Installer
Post by: eXpl0it3r on December 04, 2013, 02:48:40 pm
They do. The 64 bits MSVC version of SFML is not produced by pirated software :P
It seems to exist and maybe it works flawless with the newer versions, but it seems to have been a pain in the past (2008 (http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/), 2010 (http://stackoverflow.com/questions/1865069/how-to-compile-a-64-bit-application-using-visual-c-2010-express), ...).
Title: Re: SFML Installer
Post by: Laurent on December 04, 2013, 02:56:48 pm
Quote
They do only provide 32 bit or they do provide 64 bit too?
They provide both.

Quote
It seems to exist and maybe it works flawless with the newer versions, but it seems to have been a pain in the past (2008, 2010, ...).
It works for 2010 Express too. My VS 2008 is a professional version, so I don't know about the Express one.
Title: Re: SFML Installer
Post by: Tank on December 04, 2013, 04:37:36 pm
Quote from: FRex
There is compatibility mode for 32 bit so there is not much point in caring unless you need tons of memory(which is pro).
There's a compatibility mode for "everything", I don't think that's a valid reason to not do something "new". Only pros need much memory? Why?

That you can use VS Express to indeed build 64 bit binaries has been said already. Other than that, you can get a trial version of VS which is able to build 64 bit binaries. Students get the Pro editions for free. Other compilers support 64 bit binaries out of the box. Clicking on "64 bit" is definitely not what only "pros" are capable of.

Quote from: FRex
if you buy for few hundred dollars - you're a pro
I don't see how buying something makes you a pro...

Quote from: FRex
Other compilers are for pros[...]
Why?

Quote from: FRex
It requires 2 builds if you want to support both (unless you abandon like 15-30% of user base and go only 64 bit), therefore you're a pro for knowing how to configure it all and ship two versions.
It's what a developer does?! Maybe it's harder for "non-pros" to build 32 bit stuff because they find it logical to choose 64 bit because their operating system says so?

I don't know what you are trying to say with your pointer size nonsense or registers and calling conventions. We are talking about compiling for a target architecture, which often is 1 configuration setting (like a checkbox in SFML Installer), not building an assembler.

Personally I think 32/64 options make sense in a program like SFML Installer, just like you have static, dynamic, release and debug options.
Title: Re: SFML Installer
Post by: Lo-X on December 04, 2013, 05:31:53 pm
It requires 2 builds if you want to support both (unless you abandon like 15-30% of user base and go only 64 bit), therefore you're a pro for knowing how to configure it all and ship two versions.

Perhaps I miss something here but cross compilation (from 64b to 32b) is very easy to do, why only pro can do it ? With GCC I just have to have 32b libs and add a flag at compilation, any developper can do it.

I don't know about adding the 32b checkbox to the software, I always compile myself SFML to have control (plus I think it's much easier than pre-compiled than often don't work on Ubuntu due to libglew issues we don't care about in this post), so my opinion is maybe corrupted when I say I agree with Tank about it.

I think that letting the user the choice is always better. If he doesn't know what that is, he doesnt tuch it.

Having said that, I understand if Binary don't want to do it, after all he does what he wants with its program :p
Title: Re: SFML Installer
Post by: or75 on August 22, 2014, 02:00:35 pm
(http://i.imgur.com/mgZEDbM.png)

why ?
Title: Re: SFML Installer
Post by: binary1248 on August 22, 2014, 05:12:31 pm
Just for you, I updated SFMLInstaller with the newest versions of all libraries and a few fixes ;D.

Here you go: SFMLInstaller.exe (http://en.file-upload.net/download-9417595/SFMLInstaller.exe.html)
Title: Re: SFML Installer
Post by: feliwir on August 25, 2014, 05:46:01 pm
i got the same error like or75, but with ur newest executable i now get:
SFNUL Error: Certificate verification failed (specified REQUIRED), clos
ction.
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable
Required extension SGIS_texture_edge_clamp unavailable

inside a never ending loop
Title: Re: SFML Installer
Post by: binary1248 on August 27, 2014, 01:35:19 am
Yeah... maybe it is simpler to just download a nightly build ;D. I didn't intend to actively support SFMLInstaller more than a few months, and SFML's build process has gotten much easier since then (it will get even easier in the future), so SFMLInstaller really has less of a purpose now. In the end, it does the same that you would be able to do yourself with 10 clicks...

Like I said, just head over to http://nightlybuilds.ch/project/show/1/SFML and grab the latest build (green) of SFML for your compiler.