🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.opentoolsapi
11 messages
11 total messages Started by Aleksander Oven Thu, 13 Mar 2008 23:35
Manipulate Library and Browsing Path
#146
Author: Aleksander Oven
Date: Thu, 13 Mar 2008 23:35
7 lines
990 bytes
Anyone knows of a way to change the library and browsing paths from an
IDE wizard and have the changes immediately take effect (i.e. without
restarting the IDE)?

-- 
Regards,
Aleksander Oven
Re: Manipulate Library and Browsing Path
#147
Author: Dave Nottage [TeamB]
Date: Fri, 14 Mar 2008 00:35
15 lines
1395 bytes
Aleksander Oven wrote:

> Anyone knows of a way to change the library and browsing paths from an
> IDE wizard and have the changes immediately take effect (i.e. without
> restarting the IDE)?

If you find a way, make sure users can confirm the change (because they
might not want it).

There's nothing more annoying than having settings changed
'automatically' without being notified. Unfortunately, the IDE already
does it, and unnecessarily, in my case.

-- 
Dave Nottage [TeamB]
Re: Manipulate Library and Browsing Path
#148
Author: Aleksander Oven
Date: Fri, 14 Mar 2008 00:57
16 lines
1770 bytes
Dave Nottage [TeamB] wrote:
> If you find a way, make sure users can confirm the change (because they
> might not want it). There's nothing more annoying than having settings
> changed 'automatically' without being notified.

The change is destined to occur as a direct result of a user action -
selecting a profile from a dropdown list in the main window's toolbar.

It's a part of a bigger goal, which is an attempt at dynamically
adjusting the IDE to match project's vendor snapshot.
Basically, I want to extend Subversion's "vendor branches" concept to
include IDE-related settings (namely, design-time packages and paths).

-- 
Regards,
Aleksander Oven
Re: Manipulate Library and Browsing Path
#149
Author: Aleksander Oven
Date: Fri, 14 Mar 2008 01:37
14 lines
1290 bytes
Dave Nottage [TeamB] wrote:

> If you find a way

It seems IOTAEnvironmentOptions and IOTAProjectOptions may be that way,
as hinted in this QC entry:

http://qc.codegear.com/wc/qcmain.aspx?d=24177

I'll check tomorrow and report back with findings.

-- 
Regards,
Aleksander Oven
Re: Manipulate Library and Browsing Path
#152
Author: Sasan Adami
Date: Tue, 18 Mar 2008 15:25
22 lines
1721 bytes
Aleksander Oven wrote:
> It seems IOTAEnvironmentOptions and IOTAProjectOptions may be that way,
> as hinted in this QC entry:
> http://qc.codegear.com/wc/qcmain.aspx?d=24177

Here's an example. The procedure below updates the BDS library path. 
ANewPath is a string and should contain the directories for the new 
library path separated by semicolons.

Sasan.

-----

procedure UpdateIDELibraryPath(ANewPath: string);
var
   EnvOptions: IOTAEnvironmentOptions;
begin
   EnvOptions := (BorlandIDEServices as IOTAServices).GetEnvironmentOptions;
   if Assigned(EnvOptions) then
     EnvOptions.Values['LibraryPath'] := ANewPath;
end;
Re: Manipulate Library and Browsing Path
#158
Author: Aleksander Oven
Date: Wed, 09 Apr 2008 04:24
26 lines
1682 bytes
Sasan Adami wrote:
> procedure UpdateIDELibraryPath(ANewPath: string);
> var
>   EnvOptions: IOTAEnvironmentOptions;
> begin
>   EnvOptions := (BorlandIDEServices as IOTAServices).GetEnvironmentOptions;
>   if Assigned(EnvOptions) then
>     EnvOptions.Values['LibraryPath'] := ANewPath;
> end;

Thanks! It works. :)

As for the project options, it's a similar procedure:

procedure UpdateProjectLibraryPath(const aNewPath: AnsiString);
var
   Proj: IOTAProject;
begin
   Proj := (BorlandIDEServices as IOTAModuleServices).GetActiveProject();
   if (Proj <> nil) then
     Proj.ProjectOptions.Values['SrcPath'] := aNewPath;
end;

-- 
Regards,
Aleksander Oven
Re: Manipulate Library and Browsing Path
#159
Author: Aleksander Oven
Date: Wed, 09 Apr 2008 04:29
14 lines
1334 bytes
Aleksander Oven wrote:

> I'll check tomorrow and report back with findings.

Wow, this took longer than I expected! :/

In the end, it wasn't setting the path that was tricky, but rather
programmatically uninstalling and installing design-time packages.

Luckily, I have it all working now, so it was worth the effort. :)

-- 
Regards,
Aleksander Oven
Re: Manipulate Library and Browsing Path
#169
Author: David Novo
Date: Sun, 04 May 2008 23:51
22 lines
1747 bytes
Hello,

If you can share how you programatically installed/uninstalled design
time IDE packages, that would be great. We were going to try to go that
route, but there did not seem to be a way to do it. So instead, we
wrote an external script that we run to set up the IDe the way we want
for different projects. If we could do load certain IDE packages
automatically when loading a particular project, and unload then done,
that would be awesome.



Aleksander Oven wrote:

> 
> In the end, it wasn't setting the path that was tricky, but rather
> programmatically uninstalling and installing design-time packages.
> 



-- 
Re: Manipulate Library and Browsing Path
#172
Author: Erik Berry
Date: Mon, 05 May 2008 13:44
12 lines
1708 bytes
David Novo wrote:
> If you can share how you programatically installed/uninstalled design
> time IDE packages, that would be great. We were going to try to go that
> route, but there did not seem to be a way to do it. So instead, we
> wrote an external script that we run to set up the IDe the way we want
> for different projects. If we could do load certain IDE packages
> automatically when loading a particular project, and unload then done,

Call LoadPackage.  Depending on the IDE package type, you may also need to 
manually call the Register/IDERegister exported procedure on the package.

Erik
Re: Manipulate Library and Browsing Path
#175
Author: Aleksander Oven
Date: Tue, 06 May 2008 08:43
57 lines
3623 bytes
David Novo wrote:

> If you can share how you programatically installed/uninstalled design
> time IDE packages, that would be great.

Sharing the code is not something I can do, sorry. I can share the idea
behind the code, though.

As many people before me have already determined, there's currently no
official way of installing and uninstalling the packages from within an
IDE expert. So after careful consideration I decided to embark on a
difficult, trial-and-error-ridden path of simulating user input.

In a nutshell, this is what's required:

- Locate the action object that belongs to the "Component|Install
packages" menu item, and execute it
- Locate the list box component on the form that opens
- Locate the "Add", "Remove" and "OK" buttons on that same form
- Loop the list box items, calling "Remove" button's OnClick event
handler for each item
- Execute the "Add" button's OnClick event handler for every new package
to install
- Confirm the changes by executing "OK" button's OnClick handler

In reality, it was much more complicated, because initial action can
open different forms with different control structure and layout,
depending on whether there is a project open or not, and the type of the
active project (package/exe/dll).

Additionally, IDE pops up a dialog for every package about to be
removed. In order to hide that dialog, I had to figure out which API
was called (different on XP/Vista) and patch it with my own, which only
returned IDYES. Similar thing when installing packages - I had to patch
the TOpenDialog.Execute() so that it didn't really open the dialog, but
simply filled in the FileName property.

Oh, and that whole library path manipulation thing I initially asked
about? It turned out modifying paths through the official interfaces
didn't persist the changes. So I had to go through the UI for this,
too.

All in all, it took me 2 months or so of work, and I still have some
quirks to iron out (e.g. all other expert's shortcut key overrides stop
working after I run the expert). But it works pretty well in the end,
and that's what matters to me. :)

I'm aware I'll have to redo some of the UI-dependent things for Delphi
2008, but that's ok, since my users won't be switching to that version
for some months after it becomes available, so there'll be plenty time.

I probably haven't made anyone reading this too happy, but I still hope
it was helpful in some way. :)

-- 
Regards,
Aleksander Oven
Re: Manipulate Library and Browsing Path
#174
Author: Aleksander Oven
Date: Tue, 06 May 2008 08:45
15 lines
1596 bytes
Erik Berry wrote:

> Call LoadPackage.  Depending on the IDE package type, you may also need 
> to manually call the Register/IDERegister exported procedure on the 
> package.

Unfortunately, that's not going to work. IDE does a LOT of additional
stuff when you install/uninstall packages via IDE dialogs, like updating
the component palette and various internal structures.

See my reply to David.

-- 
Regards,
Aleksander Oven
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads