Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: MVP on September 27, 2006, 09:30:15 pm

Title: cb nightly on flash drive
Post by: MVP on September 27, 2006, 09:30:15 pm
is there a way to change the path of cb's settings?

ie C:\Documents and Settings\mvp\Application Data\codeblocks
Title: Re: cb nightly on flash drive
Post by: TDragon on September 27, 2006, 09:35:50 pm
Move your .conf file from the default location to the same directory as codeblocks.exe. C::B looks for a .conf file (default.conf unless you tell it otherwise) in various places before creating a new one in the default place.

EDIT:
This will help you in running C::B from removable media such as flash drives. If you actually do want to change the paths being searched for the .conf file, you'll need to tinker around with the C::B source code.
Title: Re: cb nightly on flash drive
Post by: MVP on September 27, 2006, 09:39:25 pm
thank you

how do you tell it otherwise?
Title: Re: cb nightly on flash drive
Post by: TDragon on September 27, 2006, 09:42:17 pm
In the command line, you use the /p or --personality switch: for example, "codeblocks.exe /p myname". This will tell C::B to look for the file myname.conf.
Title: Re: cb nightly on flash drive
Post by: MVP on September 27, 2006, 10:14:05 pm
Do you know how to use relative file linking for includes, etc? I want to put my wxWidgets folder and MinGW inside of the Code Blocks folder.
Title: Re: cb nightly on flash drive
Post by: thomas on September 28, 2006, 01:06:03 pm
Move your .conf file from the default location to the same directory as codeblocks.exe. C::B looks for a .conf file (default.conf unless you tell it otherwise) in various places before creating a new one in the default place.
That is only 95% correct. Code::Blocks will use a configuration file from the same path where the executable is located if none can be found in the normal location, not by default.
This is to allow you to put Code::Blocks onto a CD-ROM or similar medium with a custom configuration, and yet users can have personalised settings on their indidvidual PCs (falling back to whatever the distribution packager deems a good default).

If you want to use the config file on a flash drive regardless of any other settings on the computer, then use a different profile (anything that's different from "default"). This profile will obviously not be found on the PC and the one on the flash drive will be used (and saved to).
In case you already have some settings saved as "default" profile, feel free to simply rename the file, Code::Blocks won't get angry about it.
Title: Re: cb nightly on flash drive
Post by: MortenMacFly on September 28, 2006, 03:54:06 pm
If you want to use the config file on a flash drive regardless of any other settings on the computer, then use a different profile (anything that's different from "default").
I was just about to ask to provide C::B with a command line parameter to set the config file but this is *much* better.  That idea didn't cross my mind.
Morten.
Title: Re: cb nightly on flash drive
Post by: TDragon on September 28, 2006, 04:32:05 pm
That is only 95% correct. Code::Blocks will use a configuration file from the same path where the executable is located if none can be found in the normal location, not by default.
... That's what I said. To rephrase it once more: if you move the .conf file from the default location to the same directory as codeblocks.exe on the removable media, C::B will look for the .conf in the default location and not find it, then find it on the removable media. If C::B can't find the .conf file, it will be created in the default location.
Title: Re: cb nightly on flash drive
Post by: MVP on October 06, 2006, 12:14:37 pm
Do you know how to use relative file linking for includes, etc? I want to put my wxWidgets folder and MinGW inside of the Code Blocks folder.

Im just bringing this back up in case it was missed, instead of using C:/Mingw, I want to have Mingw in the code blocks folder and no matter where i put that folder, code blocks should still be able to find mingw.
Title: Re: cb nightly on flash drive
Post by: thomas on October 06, 2006, 12:23:05 pm
That doesn't matter much, you can put it where you want.
You will only have to set the compiler path correctly after that (which will be saved with the settings).
Title: Re: cb nightly on flash drive
Post by: David Perfors on October 06, 2006, 12:27:13 pm
make sure you use relative paths. else on a diffrent computer it won't work...
Title: Re: cb nightly on flash drive
Post by: MVP on March 27, 2007, 02:26:43 am
I tried this again and it doesnt seem to work:
(http://armorycore.com/keep/codeblocksflash.png)

I guess it doesnt find it, im not sure.
Title: Re: cb nightly on flash drive
Post by: SquareHead on March 28, 2007, 01:12:42 pm
Edit: Heres a link to a thread that helped me get Code::Blocks set up on my usb drive.

Dang I guess I better post the link.

http://forums.codeblocks.org/index.php/topic,4475.0.html (http://forums.codeblocks.org/index.php/topic,4475.0.html)
Title: Re: cb nightly on flash drive
Post by: MVP on March 29, 2007, 12:59:59 am
Thanks, I tried some stuff from there but still having problems, could you send me your directory 7z'd or explain step by step how to do it?
Title: Re: cb nightly on flash drive
Post by: thatgui on March 29, 2007, 06:07:08 am
Is this working for anyone ?? Using $(codeblocks) does the trick for compiling, but not for debugging.
Title: Re: cb nightly on flash drive
Post by: MVP on March 29, 2007, 10:55:43 am
I got it to work, just had my slashes going the wrong way, thanks guys. :D
Title: Re: cb nightly on flash drive
Post by: SquareHead on March 30, 2007, 10:43:34 am
Glad to hear it. Anyone have any thoughts on making an entry in the wiki?
Title: Re: cb nightly on flash drive
Post by: code2008 on April 02, 2007, 12:39:51 pm
I just posted:

http://forums.codeblocks.org/index.php/topic,4475.msg43203.html#msg43203
Re: Can I make C::B portable? .. making codeblocks "portable"

Related to getting nightly build setup to be "portable".

Followups there would be appreciated.
Thanks.