Code::Blocks Forums

User forums => Help => Topic started by: dave.berk on March 17, 2009, 06:18:44 pm

Title: Problem creating a portable version of the 14.02.09 nightly build
Post by: dave.berk on March 17, 2009, 06:18:44 pm
Hi

1. I'm trying to create a portable version of CodeBlocks (20091402 night build). Unfortunately the directives here (http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_make_Code::Blocks_portable.3F) do not work. Even though I copied the %APPDATA%\codeblocks folder content to the program directory, a folder named codeblocks is still created in the %APPDATA% directory on every run of the program :(...

2. I'm trying to create a folder inside the program directory that will serve as a default project folder. How do I go about making it the default folder inside codeblocks without hard coding its location?

Thanks a lot
Dave

EDIT: it also keep trying to save workspace changes to the config file in %APPDATA%\codeblocks which doesn't exist and not the config file in the program directory.
Title: Re: Problem creating a portable version of the 14.02.09 nightly build
Post by: zac on March 18, 2009, 01:25:32 am
Dear Dave,

I think there is some plugins within CB not honour for the portable settings and so, still leave info in the application folder. You may try the following batch file settings. Most times it works for me, but sometimes not.

You need to create a batch file, e.g. codeblocks.bat, paste the following contents into the file and save it under the application folder of CB, the one with codeblocks.exe.

:: codeblocks.bat - begin
@ECHO OFF
setlocal
set USERPROFILE=%~dp0settings
mkdir "%USERPROFILE%"

:: :: For Vista or above
:: mkdir %USERPROFILE%\AppData
:: For Windows 2000 and XP
mkdir %USERPROFILE%\"Application Data"

START /D"%~dp0" codeblocks.exe %*
endlocal
:: codeblocks.bat - end

zac
Title: Re: Problem creating a portable version of the 14.02.09 nightly build
Post by: dave.berk on March 18, 2009, 08:11:09 am
Thanks, zac.

Anything about point 2?

Dave
Title: Re: Problem creating a portable version of the 14.02.09 nightly build
Post by: zac on March 18, 2009, 07:06:46 pm
Sorry Dave,

I've no idea about this.

Regards,

zac