User forums > Help
Indefinite Paths in Compiler Installation Directory
joat:
Is there any way to use indefinite paths for the compiler's installation directory setting? I tried using ./MinGW but that didn't work. I'm wondering because I put MinGW's folder inside my codeblocks folder. The reasoning behind this is that I would like to set up a portable copy of CB with MinGW. What I basically want is a version of CB and MinGW inside a self-extracting 7-zip archive. That way I can just put it on my flash drive and run it to extract it to whatever computer I'm using. I can then just open up the project files on my flash drive and work on them. Once I'm finished working I can just save everything and delete the folder that was created by extracting the archive. I need indefinite paths because the path to MinGW will be different depending on the username since I usually extract to the desktop. I do realize that I could just make two separate archives and have the MinGW one extract to C:\MinGW, but that just wouldn't be as much fun :)
By the way, awesome project you guys got going here.
MortenMacFly:
--- Quote from: joat on July 19, 2006, 07:59:20 pm ---Is there any way to use indefinite paths for the compiler's installation directory setting?
--- End quote ---
You can use global variables for the drive. Thus you would only have to change one global variable (the drive letter) and you can run C::B from a memory stick. How is this?
MortenMacFly:
--- Quote from: joat on July 19, 2006, 07:59:20 pm ---I tried using ./MinGW but that didn't work.
--- End quote ---
Did you ever try to implement a methodology on Linux to get the full path of the application you are running currently? This isn't possible under certain circumstances - and I know no fail-safe way to do so. The usual way is to setup an env var pointing to the installation path. you cannot use argv[0] because this is mostly relative.
Thus how to obtain the full base path of C::B under such OS'es? If this would be possible a relative path to the compiler directory would be possible. But this isn't.
joat:
Take a look at http://autopackage.org/docs/binreloc/
MortenMacFly:
--- Quote from: joat on July 19, 2006, 09:27:27 pm ---Take a look at http://autopackage.org/docs/binreloc/
--- End quote ---
...that's a good one I didn't know to be honest. Anyway, for this minor purpose I read:
--- Code: ---It's small, only about 20 KB of C source code (I suspect it's only about 10 KB if you remove all the inline documentation comments).
--- End code ---
I wouldn't say for a self-allocation 10KB is small. Did you try the global variable hint? This works on all platforms and you have a minimalistic setup of 1 setting.
Navigation
[0] Message Index
[#] Next page
Go to full version