DelphiPackageManager / DPM

A Package Manager for Delphi
Apache License 2.0
96 stars 21 forks source link

Add Environment Variables options #26

Open viniciusfbb opened 2 years ago

viniciusfbb commented 2 years ago

Hi Vincent!

First, I would like to thank you for the beautiful project!

It would be great if you added the option to change and add Environment Variables from the IDE (registry HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\22.0\Environment Variables). It's something that other package managers don't have and essential in some cases. For example, Skia4Delphi needs to add the variable SKIADIR and also add some directories in the PATH:

image

vincentparrett commented 2 years ago

I'm guessing this is so the apps can find the dll's? In that case a better option would be to copy the dll's to the output folder - like we do with runtime packages. Right now there isn't a feature for that (there is for runtime packages) however that would be pretty easy to add.

The reason I'm hesitant to add to the PATH is that if I install 3 versions of Skia4Delphi in 3 different projects, all 3 would end up on the path, which would cause problems.

What is the SKIADIR used for?

viniciusfbb commented 2 years ago

Vicent, the SKIADIR is essential, because our plugin set automatically the deployment files in all platforms of the project:

image

and as you can see in the image, we use the $(SKIADIR) variable. We also use SKIADIR to copy the dll to the application output when compiled, as deployment windows only works for remote builds.

The PATH is used to add the win32 dll path so that the package loads the dll at designtime when the package is loaded by IDE. In this case, copy the dll to the delphi's bpl folder would solve it, but I still think the best practice would be to add it to the PATH.

vincentparrett commented 2 years ago

If a design time package needs a dll, having the dll in the same folder as the bpl would be enough to find it.

I'll look at the env variable option when I get a chance.