Recent

Author Topic: [SOLVED] How to copy a .dll file near to an .exe file  (Read 1132 times)

YiannisKam

  • Full Member
  • ***
  • Posts: 119
[SOLVED] How to copy a .dll file near to an .exe file
« on: August 13, 2024, 02:31:55 pm »
Hello, I'm looking for an option to copy a .dll file near to where my .exe file goes, but I can't find any. I would like to be able to do this automatically during the build process and not copy the .dll everytime manually. Can it be done somehow?
« Last Edit: August 13, 2024, 04:07:49 pm by YiannisKam »
Windows 10 - 64bit
Lazarus version: 3.99
FPC       version: 3.3.1

Zvoni

  • Hero Member
  • *****
  • Posts: 2692
Re: How to copy a .dll file near to an .exe file
« Reply #1 on: August 13, 2024, 02:51:16 pm »
Hello, I'm looking for an option to copy a .dll file near to where my .exe file goes, but I can't find any. I would like to be able to do this automatically during the build process and not copy the .dll everytime manually. Can it be done somehow?
No.
The question is more: Why is your dll not in the Project-Folder (optionally SubFolder) in the first place?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

YiannisKam

  • Full Member
  • ***
  • Posts: 119
Re: How to copy a .dll file near to an .exe file
« Reply #2 on: August 13, 2024, 03:11:52 pm »
It can be done manually as I said, but not what I'm asking though.
Windows 10 - 64bit
Lazarus version: 3.99
FPC       version: 3.3.1

n7800

  • Full Member
  • ***
  • Posts: 138
Re: How to copy a .dll file near to an .exe file
« Reply #3 on: August 13, 2024, 03:16:01 pm »
You can configure any command to run after compilation: https://wiki.freepascal.org/IDE_Window:_Compiler_Options#Compilation.

To find out the location of the compiled application, use IDE macros: https://wiki.freepascal.org/IDE_Macros_in_paths_and_filenames#Paths_and_Parts.

Zvoni

  • Hero Member
  • *****
  • Posts: 2692
Re: How to copy a .dll file near to an .exe file
« Reply #4 on: August 13, 2024, 03:18:32 pm »
It can be done manually as I said, but not what I'm asking though.
And whatever 3rd-Party files your Program needs is your Job to provide in the correct place.
It's not the Job of the IDE.

Lazarus is not a "egg laying wool-milk-sow"
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

YiannisKam

  • Full Member
  • ***
  • Posts: 119
Re: How to copy a .dll file near to an .exe file
« Reply #5 on: August 13, 2024, 04:03:50 pm »
You can configure any command to run after compilation: https://wiki.freepascal.org/IDE_Window:_Compiler_Options#Compilation.

To find out the location of the compiled application, use IDE macros: https://wiki.freepascal.org/IDE_Macros_in_paths_and_filenames#Paths_and_Parts.
Thank you very much @n7800. I got it working just fine. I really appreciate it  :)
Windows 10 - 64bit
Lazarus version: 3.99
FPC       version: 3.3.1

 

TinyPortal © 2005-2018