Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [HOW] How Do You Pack Your Images Together With Your Release .exe file? : SFML  (Read 3417 times)

0 Members and 1 Guest are viewing this topic.

Cook

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
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).

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
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?
« Last Edit: March 09, 2021, 09:12:28 pm by Stauricus »
Visit my game site (and hopefully help funding it? )
Website | IndieDB

Cook

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
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.

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
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. in Linux there is a simple program that does the 'conversion' from the file, called xxd.

Visit my game site (and hopefully help funding it? )
Website | IndieDB

Cook

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
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. 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

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
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.
Visit my game site (and hopefully help funding it? )
Website | IndieDB

Cook

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Hi Stauricus,
Like this?

https://installforge.net/

 

anything