Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Portable Code::Blocks
mrTeoc:
This is great! I really needed this, because I get to work on random pcs very often.
Biplab:
--- Quote from: ollydbg on April 14, 2009, 03:36:35 am ---I think the CbLauncher.exe 0.11 version should be uploaded so the people don't need to download the whole package from:
http://files.filefront.com/Portable+CB+5526+bin7z/;13582845;/fileinfo.html
--- End quote ---
I've uploaded it to my blog. You can download it from the following link-
--- Quote ---http://biplab.in/2009/04/creating-portable-codeblocks-part-2/
--- End quote ---
I've also written steps to launch C::B nightlies (> rev 5534) in a portable manner using CbLauncher in the above post.
rokan1:
I made a small batch file which temporarily modifies essential environment variables to make "portable" version not only for codeblocks but also msys and mingw.
Assuming that you have copied the tools to /MingW and /msys and /codeblocks on your usb you can copy the following script to eg portable.bat on your usb.
After running this bat file, just type codeblocks and everything should work fine - if it touches configuration files, it uses the locations within USB.
Be sure you set $(CODEBLOCKS)/../Mingw as the location for the gcc toolchain.
You can also change cmd.exe to codeblocks.exe in the last line of this batch file to start codeblocks immediately.
--- Code: ---@echo off
echo Setting environment variables and checking for directories availability:
:: Get the current batch fille drive and set it as homedrive
for %%x in (%0) do set HOMEDRIVE=%%~dsx
set HOMEDRIVE
:: Set user as USERNAME
set USERNAME=user
set USERNAME
:: Set \home\%USERNAME% as HOMEPATH and assure the directory exists
mkdir %HOMEDRIVE%\home
set HOMEPATH=\home\%USERNAME%
set HOMEPATH
mkdir %HOMEDRIVE%%HOMEPATH%
mkdir "%HOMEDRIVE%%HOMEPATH%\Desktop
:: Set %HOMEDRIVE%%HOMEPATH% as USERPROFILE
set USERPROFILE=%HOMEDRIVE%%HOMEPATH%
set USERPROFILE
::set %HOMEDRIVE%%HOMEPATH%\ApplicationData as APPDATA
set APPDATA=%HOMEDRIVE%%HOMEPATH%\ApplicationData
set APPDATA
mkdir %APPDATA%
:: Set %HOMEDRIVE%\home\AllUsers as ALLUSERSPROFILE and assure it exists
set ALLUSERSPROFILE=%HOMEDRIVE%\home\AllUsers
set ALLUSERSPROFILE
mkdir %ALLUSERSPROFILE%
echo Adding %HOMEDRIVE%\MinGW\bin;%HOMEDRIVE%\msys\1.0\bin;%HOMEDRIVE%\codeblocks to the PATH
set PATH=%HOMEDRIVE%\MinGW\bin;%HOMEDRIVE%\msys\1.0\bin;%HOMEDRIVE%\codeblocks;%PATH%
set PATH
CALL cmd.exe
--- End code ---
ollydbg:
--- Quote from: rokan1 on April 16, 2009, 05:16:28 pm ---I made a small batch file which temporarily modifies essential environment variables to make "portable" version not only for codeblocks but also msys and mingw.
Assuming that you have copied the tools to /MingW and /msys and /codeblocks on your usb you can copy the following script to eg portable.bat on your usb.
After running this bat file, just type codeblocks and everything should work fine - if it touches configuration files, it uses the locations within USB.
Be sure you set $(CODEBLOCKS)/../Mingw as the location for the gcc toolchain.
You can also change cmd.exe to codeblocks.exe in the last line of this batch file to start codeblocks immediately.
--- Code: ---@echo off
echo Setting environment variables and checking for directories availability:
:: Get the current batch fille drive and set it as homedrive
for %%x in (%0) do set HOMEDRIVE=%%~dsx
set HOMEDRIVE
:: Set user as USERNAME
set USERNAME=user
set USERNAME
:: Set \home\%USERNAME% as HOMEPATH and assure the directory exists
mkdir %HOMEDRIVE%\home
set HOMEPATH=\home\%USERNAME%
set HOMEPATH
mkdir %HOMEDRIVE%%HOMEPATH%
mkdir "%HOMEDRIVE%%HOMEPATH%\Desktop
:: Set %HOMEDRIVE%%HOMEPATH% as USERPROFILE
set USERPROFILE=%HOMEDRIVE%%HOMEPATH%
set USERPROFILE
::set %HOMEDRIVE%%HOMEPATH%\ApplicationData as APPDATA
set APPDATA=%HOMEDRIVE%%HOMEPATH%\ApplicationData
set APPDATA
mkdir %APPDATA%
:: Set %HOMEDRIVE%\home\AllUsers as ALLUSERSPROFILE and assure it exists
set ALLUSERSPROFILE=%HOMEDRIVE%\home\AllUsers
set ALLUSERSPROFILE
mkdir %ALLUSERSPROFILE%
echo Adding %HOMEDRIVE%\MinGW\bin;%HOMEDRIVE%\msys\1.0\bin;%HOMEDRIVE%\codeblocks to the PATH
set PATH=%HOMEDRIVE%\MinGW\bin;%HOMEDRIVE%\msys\1.0\bin;%HOMEDRIVE%\codeblocks;%PATH%
set PATH
CALL cmd.exe
--- End code ---
--- End quote ---
Thanks.
My question is:
Do I need the "CBLuncher.exe" supplied by BipLab to run CB?
Or I just type codeblocks.exe as you said?
Thanks. :D
Biplab:
@Rokan,
I haven't tried this. But having a complete development environment should be nice to many users. Thanks for sharing this.
@OllyDbg,
So far CbLauncher does the similar thing before launching Code::Blocks. Assuming the batch file is error free, you do not need CbLauncher.exe v0.1.1 to make C::B portable. You can use this batch file.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version