Author Topic: UserTemplate  (Read 4631 times)

Offline Elmar

  • Single posting newcomer
  • *
  • Posts: 3
UserTemplate
« on: February 25, 2008, 07:19:50 am »
Hello everybody,
thx for this great IDE!!

Is it possible to store UserTemplates in the C::B installation directory?
Because normally they are stored in in %APPDATA%\codeblocks\UserTemplates (for Windows)
I just try if it is possible to get a portable Version of C::B

Thanks

Elmar

SVN build 4905 wx2.8.6 Windows XP 32

mariocup

  • Guest
Re: UserTemplate
« Reply #1 on: February 29, 2008, 01:48:53 pm »
Hi Elmar,

codeblocks saves its settings in %APPDATA%\codeblocks\default.conf. If you put this file default.conf in the installation directory of CB, then the settings are used from this file.

Now you could do the following steps:
Go in CB to settings->Environment->Environment variables and set the APPDATA environment variable to you needs, so the user templates are found. This will not modify the global windows env settings.

I did not tested this procedure, but I think it should work.

Offline Elmar

  • Single posting newcomer
  • *
  • Posts: 3
Re: UserTemplate
« Reply #2 on: March 02, 2008, 09:34:52 pm »
Hi mariocup,
thanks for answering, (default.conf in C:B directory works  :D)
i´ve also tried to set the enviroment variables but it has no affect.

C::B debug says:

EnvVars: Trying to set environment variable 'C:\Dokumente und Einstellungen\myuser\Anwendungsdaten' to value 'D:\codeblocks\test\Anwendungsdaten'...
EnvVars: 1/1 envvars applied within C::B focus.

So I think it works, then I tried to save a new Template but is was stored in 
C:\Dokumente und Einstellungen\user\Anwendungsdaten\codeblocks\UserTemplates\Projectname
and not in D:\codeblocks\test\Anwendungsdaten\codeblocks\UserTemplates


File->new->Project User templates also doesn`t show any of my Projects stored in D:\codeblocks\Anwendungsdaten\codeblocks\UserTemplates

do you have any other idea, or maybe someone else? or is this behavior a bug?

Thanks

Elmar

Using SVN build 4905 wx 2.8.6 Windows XP 32


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: UserTemplate
« Reply #3 on: March 03, 2008, 08:36:09 am »
EnvVars: Trying to set environment variable 'C:\Dokumente und Einstellungen\myuser\Anwendungsdaten' to value 'D:\codeblocks\test\Anwendungsdaten'...

do you have any other idea, or maybe someone else? or is this behavior a bug?
For sure not. What you are trying to do is simply not possible. Envvars are of type "variabe = value". You are trying to make a "directory = directory" and (even worse) the first directory contains spaces and illiegal variables characters (like the backslashes) which is not supported by envvars in general (a limitation of the OS). You cannot redirect directories at all like that.

I'd suggest you are using the OS functionality like setting up a link to a folder. But this hgas nothing to do with C::B then.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ