Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: luoyonggang on March 21, 2008, 10:42:52 am

Title: I apply for a new feature
Post by: luoyonggang on March 21, 2008, 10:42:52 am
I need a feature that codeblocks can import configure file in the folder that conation codeblocks.exe . Then we can place codeblocks on usb and running it everywhere. I think it would be good !!!!!!
And we just need to adjust a parameter to determine whether the configure files is place on the computer or the usb drivers.
Title: Re: I apply for a new feature
Post by: dje on March 21, 2008, 11:40:20 am
Hi !

You should search the forum and the wiki.
C::B is already able to do that.

Dje
Title: Re: I apply for a new feature
Post by: luoyonggang on March 23, 2008, 10:38:11 am
I'm so sorry that i can't find that. I get a method but it doesn't work very well.
I created a automate bat file to running the codeblocks. even though it can specify the environment varibale USERPROFILE,
but in Windows Vista and Windows XP the APPDATA is different , so it's can't share the same configure file .
So can you tell me how to solve this problem.
If you have, please give me the answer.
Than you.
Title: Re: I apply for a new feature
Post by: thomas on March 23, 2008, 02:57:12 pm
Code::Blocks will use a config file located in its installation directory if none is present in the current user's profile folder.

So, to put Code::Blocks onto an USB stick, simply move (not copy) the config file there.
Title: Re: I apply for a new feature
Post by: Seronis on March 23, 2008, 06:17:55 pm
Code::Blocks will use a config file located in its installation directory if none is present in the current user's profile folder.

So, to put Code::Blocks onto an USB stick, simply move (not copy) the config file there.

Just to clarify this..  does that mean that if i have codeblocks on my usb drive.. it will ignore my preferences if i use it on a computer that already has C::B?  Shouldnt any config file located in the installation override the generic 'global' config thats in the user profile?
Title: Re: I apply for a new feature
Post by: Calexus on March 23, 2008, 07:37:37 pm
This seems to be a frequently returning question.
Maybe someone that knows how to get CB portable could write some lines in the Wiki?
Under Installing Code::Blocks for example...
Title: Re: I apply for a new feature
Post by: PsYhLo on March 23, 2008, 07:47:49 pm
good idea i'm interest in such thinks :)
Title: Re: I apply for a new feature
Post by: thomas on March 23, 2008, 10:53:38 pm
Just to clarify this..  [...]
No, that's not how it works. Read what I wrote above.
Title: Re: I apply for a new feature
Post by: luoyonggang on March 25, 2008, 11:45:58 am
Please specify the relative path to the directory of CodeBlokcs.
If the CodeBlocks is $(CodeBlocks), then where I need to place the codeblocks' config files.
In the current time
I put these files in $(CodeBlocks)/AppData/Roaming/codeblocks when i'm using CodeBlocks under Windows Vista
and I put these files in $(CodeBlokcs/Application Data/codeblokcs when i'm using CodeBlocks under Windows XP

Then I generated a bat file whoes name is $(CodeBlokcs)/codeblocks.cmd
with the content that follow:

Code
echo off
set USERPROFILE=%~dp0Settings
START /D "%~dp0" CodeBlocks.exe %

The the problem was happend I have to use different Config File Under Different Operating System.
So can you help me to solve this problem?
Thanks.
Title: Re: I apply for a new feature
Post by: MortenMacFly on March 27, 2008, 04:51:38 pm
If the CodeBlocks is $(CodeBlocks), then where I need to place the codeblocks' config files.
Make sure:
- place the default.conf file into the directory where  codeblocks.exe (or the C::B binary in general) is
- remove any default.conf file from APPDATA or USERPROFILE or wherever you have this now
- remove all bad hacks to modify USERPROFILE and/or APPDATA before C::B
- just run C::B from within the C::B path

A minor note: If C::B does not find default.conf (it's config) within the APPDATA/USERPROFILE path it looks within the C::B directory (the one where the C:B executable is) next. If there is no config file, too it will be created in APPDATA/USERPROFILE. So just make sure you are doing the right thing and C::B is portable just fine.

BTW: This does probably *not* apply for any other config file(s) where not C::B is the stakeholder but e.g. plugins. The main config file just works like that.
Title: Re: I apply for a new feature
Post by: Jenna on March 27, 2008, 05:15:45 pm
You can even use the config-file from the C::B directory on a stick if C::B is installed on the computer.
Rename the "default.conf" on the stick to (for example) "stick.conf" and start C::B from a batch file with the parameter "--personality=stick".
If no "stick.conf" exists in APPDATA/USERPROFILE C::B will use the one from the stick.