User forums > Using Code::Blocks

How to modify default.conf with a script

(1/2) > >>

mariocup:
Hi,

I would like to modify the default.conf with a startup script to add new tools. The default.conf is a xml based file. How can I read and write into this xml configuration.

Thx,

Mario

killerbot:
well our advice is off course, don't mess with the default.conf file.

If you want to manipulate it yourself, be sure you know what you are doing. Since it is an xml file, you can study it and manipulate it with TinxyXml. Just make sure all fields you didn't touch remain the same. If you burn yourself don't blame us ;-)

Cheers.

mariocup:
Hi killerbot,

perhaps it exists  a better solution than modifying the default.conf. For embedded Targets like MSP430, TriCore etc. I want to use an external debugger like insight.
I tried to write a script that is loaded at startup. But the script is not trusted, therefore a  popup ask for trusting it. If a terminate the external application (insight), CB returns an error.
Is it possible to trust a script on startup and give the ability to start external applications. The strange thing if I replace msp430-insight with explorer.exe and IO.Execute(executing) no application is started.


--- Code: ---function OnMenuClicked(index)
    {
                switch (index)
                {
                case 0:
                        local activetarget = GetProjectManager().GetActiveProject().GetActiveBuildTarget();
                        if (!IsNull(activetarget))
                        {
                            local outputfile = GetProjectManager().GetActiveProject().GetBuildTarget(activetarget).GetOutputFilename();
                            local basepath = GetProjectManager().GetActiveProject().GetBasePath();
                            local executing = _T("msp430-insight ") + basepath  + outputfile;
                            local retval = IO.ExecuteAndGetOutput(executing);
                        }
                break;
                }
    }

--- End code ---

Thx,

Mario

killerbot:
I am not into scripting (yet), I think the you will have to ask the big boss (Mandrav) ;-)

Biplab:

--- Quote from: mariocup on March 22, 2007, 04:54:17 pm ---Is it possible to trust a script on startup and give the ability to start external applications. The strange thing if I replace msp430-insight with explorer.exe and IO.Execute(executing) no application is started.

--- End quote ---

Yes! It is possible to load a script at startup. Click Settings > Scripting menu and a new window will pop-up. There you can specify scripts to load at start-up. On the Security tab of the pop-up window, check Launch executables to launch any external executables at start-up.

But if you want to add the script to menu, then it won't be loaded at start-up. :)

Navigation

[0] Message Index

[#] Next page

Go to full version