SFML community forums
Help => General => Topic started by: Cook on March 07, 2021, 10:00:49 pm
-
Hi,
How does one pack and add images to the Release .exe file?
If you do it normally, you will have an error message (attached image).
-
its not a good idea to pack many resources in the .exe file. one reason is that your final file will be too big. another is that you'll have all resources loaded 100% of the time, even if you are not using them. and there are some other good reasons too.
but in your case, your application is not finding the images. are these files in the same folder as the project?
-
its not a good idea to pack any resources in the .exe file. one reason is that your final file will be too big. another is that you'll have all resources loaded 100% of the time, even if you are not using them. and there are some other good reasons too.
but in your case, your application is not finding the images. are these files in the same folder as the project?
No, I moved the .exe to the Desktop to play with.
I would like to pack the resources with the .exe file.
How do I pack them as 1 file?
I would also like to share them with others.
-
then put the resources in the same folder as the .exe
or specify the full path, like " c:/user/Desktop/myAppResources/images/tiles.png "
if you really want to embed resources in your executable, you need to convert them to C header, create an array in your code with the binary values, and then use the loadFromMemory option. here's a topic explaining that (https://en.sfml-dev.org/forums/index.php?topic=11368.0). in Linux there is a simple program that does the 'conversion' from the file, called xxd.
-
then put the resources in the same folder as the .exe
or specify the full path, like " c:/user/Desktop/myAppResources/images/tiles.png "
if you really want to embed resources in your executable, you need to convert them to C header, create an array in your code with the binary values, and then use the loadFromMemory option. here's a topic explaining that (https://en.sfml-dev.org/forums/index.php?topic=11368.0). in Linux there is a simple program that does the 'conversion' from the file, called xxd.
Hi Stauricus,
Thanks for the help.
Actually, all I needed was WinRar and to follow the steps in the video.
1. Add the relevant files and .exe to Winrar.
2. Change the archive name extension to .exe
3. Check the "Create SFX archive"
4. Go to Advanced tab -> SFX Options -> General
5. Type in the path to extract to E.g. C:\Program Files (x86)
6. Go to Advanced tab -> SFX Options -> Text and Icon
7. Add relavant images and instructions
8. Press OK, OK.
You will then have an .exe file that you can hand around to your friends and family.
References
https://www.youtube.com/watch?v=6BGZYIEqx7s (https://www.youtube.com/watch?v=6BGZYIEqx7s)
-
oh,then you wanted a way to pack resources to distribute your application, not adding resources to your executable.
good that you found out. that's not related to SFML, by the way.
there are of other programs that do that, mainly related to Windows: Installer Creator, Installer Maker, Nullsoft Scriptable Install System, etc.
-
Hi Stauricus,
Like this?
https://installforge.net/