You are here

Code::Blocks Portable - %PAL:CurrentDrive% Variable

5 posts / 0 new
Last post
Ephesian
Ephesian's picture
Offline
Last seen: 12 years 6 months ago
Joined: 2011-09-24 18:14
Code::Blocks Portable - %PAL:CurrentDrive% Variable

Since I didn't see a forum dedicated to using Code Blocks Portable, I figured I'd come here instead.

Code::Blocks is a free C++ Programming IDE and has been Portified. It works great with one issue that I've been trying to figure out a solution for. In code blocks, in order to set up the compiler, one must click:

Settings menu -> Compiler and Debugger... -> Toolchain Executable Tab

Under this tab on top is the directory where the Compiler is installed, "Compiler's Installation Directory". On my machine, the value in this box says, "%PAL:CurrentDrive%\Cpp\MingW". The actual location of the compiler on my system is C:\Cpp\MingW. I'm guessing that that "%PAL:CurrentDrive%" is a PortableApps.com environment variable which should hold the drive letter in which Code Blocks Portable is running on currently. However I can't tell. I don't know how to see what the current value would be.

The problem is that when I run CodeBlocks, I must manually replace %PAL:CurrentDrive% with C:\ in order to compile anything. This variable does not seem to work as when I try to compile my program, nothing happens, until I make the change. And I have to change this every single time I start the program, which gets annoying after awhile.

So I guess my question are:
1) How can I see what %PAL:CurrenltDrive% is set to when I open Code Blocks
2) How can I get Code Blocks to keep my change to this setting without having to change it every time it opens?
3) How can I get the variable to work so I can just leave it there. I'd like to keep the variable there so when I put it on my flash drive, it will work when using it on other computers.

Any help would be appreciated. Thank you. Melvin.

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 months 6 days ago
DeveloperModerator
Joined: 2008-07-24 18:46
Outdated variable, Easy fix

The issue there is that there is an old variable in place.

What you need to do is this: (temporary fix until it gets fixed by the PA.c developer)

NB - please do this only after having done the manual change you've mentioned above, and quitting Code::Blocks
1. Open CodeBlocksPortable\App\Appinfo\Launcher\CodeBlocksPortable.ini in your favourite text editor.
2. Change %PAL:CurrentDrive% to %PAL:Drive% and save the file.
4. Run CodeBlocks, and it should work properly now. If it doesn't, please comment again!

Ephesian
Ephesian's picture
Offline
Last seen: 12 years 6 months ago
Joined: 2011-09-24 18:14
Awesome! It worked, My "C:"

Awesome! It worked, My "C:" change remained. I also tried this temporary fix by making the compiler's directory as %PAL:Drive%\Cpp\MingW. This also stayed after restarting the program, but still won't compile, even though it stayed. It only seems to work when the compiler's path is explicitly stated (with C:). Please shoot me an email when this has been resolved. I'll keep my eyes open. Thank you for your speedy response. Melvin.

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 months 6 days ago
DeveloperModerator
Joined: 2008-07-24 18:46
Launcher variable

%PAL:???% variables are internal launcher variables that are replaced by the laauncher prior to program execution. See here for a better explanation: https://portableapps.com/manuals/PortableApps.comLauncher/ref/envsub/#re...

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 8 years 9 months ago
Joined: 2007-04-15 21:08
Wrong place

Code::Blocks is an app in development, so all requests should go in its thread in the Beta Testing forum. Show you care enough about it and I might get round to releasing a fixed version (the issue is known about but I haven't gotten round to fixing it...)

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Log in or register to post comments