Recent

Author Topic: where a package was installed ?  (Read 2101 times)

tintinux

  • Sr. Member
  • ****
  • Posts: 325
    • Gestinux
where a package was installed ?
« on: October 22, 2014, 02:28:14 pm »
Hi

I have made a package, and you know that it can be installed anywhere on the disk of those who want to use it. Fine.

Is there some way to make a function in the package, which returns, at runtime, only when running the executable in the EDI, the location where the package was installed ?

This is to be able to load, at run time, some datafile stored with the package. Not a resource file.

It is not needed outside the EDI, this is only useful during development.

Thanks for any idea !
Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: where a package was installed ?
« Reply #1 on: October 22, 2014, 07:47:15 pm »
There are some functions in the unit PackageIntf that might do what you need.

Just a guess, but PackageEditingInterface.FindPackageWithName returns a TIDEPackage, which has a Filename property and a DirectoryExpanded property.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

tintinux

  • Sr. Member
  • ****
  • Posts: 325
    • Gestinux
Re: where a package was installed ?
« Reply #2 on: October 23, 2014, 02:43:39 pm »
Thanks, the functions look interesting.

But In the program executing inside the IDE, is it possible to assign a value to PackageEditingInterface ??

Otherwise, I wonder whether it is correct to :

When installing the package : Find the directory and create a macro for the value found.
When running the project in the IDE : set a ParamStr with this macro value
When running from the system : do not set the ParamStr


Regards




Initiator of gestinux, open-source, multi-database and multilingual accounting and billing software made with LAZARUS.

You can help to develop, to make and improve translations, and to provide examples of legal charts and reports from more countries.

 

TinyPortal © 2005-2018