Problem wth making a project portable.

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
paradoximo
Posts: 18
Joined: Sun Jan 24, 2010 6:13 pm

Problem wth making a project portable.

Post by paradoximo »

Hi

I have a simple game writed in Irrlicht.
I'm using Code::Blocks [it easier for me and etas less RAM than Visual Studio and i need C::B to work on Linux so...] and my projects runs only on my computer HOWEVER ir tuns only in 1 folder... nad can;t move it for ex. on Desktop because then it just appears and disappears in second....

I think it's problem in paths of folders with dll and metarials [like models textures etc] in game so it can't fin them and then it won't run.

I searched for tutorials but I found tutorial:

http://www.irrlicht3d.org/wiki/index.ph ... apter1-4-1

That tutorials tells how to solve my problem but in pictures. The pictures were deleted any time ago so i can;t see them and solve my problem. I want to go with my project to school. I can't do this ithout portbalng.


:(
So if you guys know how to do that. Plz reply ;) :D
Image
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

You have a lot of typos so I can't fully understand what you are saying but if you want to make it portable just copy the irrlicht folder, your project folder, and any other folders you are using in your project(models, textures, external libs, etc) to a flash drive(or whatever else you're storing them on). Then you just need to make sure your search directories are searching by relative path.
multum in parvo
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

1) Develop your app as usual, but keep all your resources inside a single folder, change the working directory to this folder before you load anything. Don't use subfolders.
2) When you're ready to make a release build, ZIP this folder file and mount it like in the Quake3 map tutorial. Rename the .zip to .dat or something, just for effect.
3) Edit IrrCompileConfig.h and get rid of all the stuff you don't need, specially the D3D drivers. The more you remove, the smaller the library will be.
4) Build Irrlicht as a static library in release mode using gcc. You've now got a static library that doesn't have any external dependencies, no D3D dependency, no MSVC redistributable dependency. It will take longer than usual to build this binary, so I don't recommend doing this during development.
5) Recompile your app in release mode with Irrlicht as a static library. You need to either edit IrrCompileConfig.h or add the IRR_STATIC_LIB define to each of your sources that includes irrlicht.h.

You now have your exe plus a single .dat file. You can distribute these together and they'll work on any machine as long as the .dat file is in the same dir as the exe.

For bonus points:
6) Write a program to convert the ZIP (or TAR) file into a string literal in a .cpp source file, then compile this source file into your app. Create a MemoryReadFile from it, and hack Irrlicht to mount the zip file.
7) Compress your exe with UPX, reducing the size by 50 to 80%!

If you did all of the above, you have a single executable file that is as small as possible and will run on any machine! :)

For Linux: same as above.
For OSX: put your resources inside the app's resource directory instead, and change directory there before loading anything.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
paradoximo
Posts: 18
Joined: Sun Jan 24, 2010 6:13 pm

Post by paradoximo »

whoa :O thanks :D i will try to do all before 18:00 [i have to learn physic for school ;)]

So thanks again... if they will be ANY problems with doing that i will post it here ;).
Image
dividenot
Posts: 2
Joined: Sun Aug 21, 2011 12:24 am

Re: Problem wth making a project portable.

Post by dividenot »

Sorry to bring up a dead and solved post but I've been having the same problem as paradoximo, the only difference is that I haven't even begun my project and am just now beginning with the tutorial and "setting up your first project" entry in the Irrlicht Manual. I also noticed that the images in the Making a Portable Folder instructions in section 1.4.1 of the manual are broken.

I read bitplane's instructions but unfortunately it doesn't make any sense to me. I suspect once I learn more about Irrlicht I will understand it better but I was also thinking that it is considerably simpler as all I have is a folder titled "Tutorial_1" on my desktop.

I have ideas for a project that I will post and link here that some people may be interested in.
Post Reply