In this case, don't use the project.res, but use your own. You can include 
multiple resource files. So you can generate it before.

Marc

On May 23, 2024 1:32:06 PM GMT+02:00, Luca Olivetti via lazarus 
<lazarus@lists.lazarus-ide.org> wrote:
>El 23/5/24 a les 12:40, Mattias Gaertner via lazarus ha escrit:
>> 
>> 
>> On 5/22/24 15:03, Luca Olivetti via lazarus wrote:
>>> Hello,
>>> 
>>> I'm trying to use the "Compiler commands" -> "Execute before" to generate a 
>>> file that will be embedded as a resource in the executable, but it seems 
>>> the command is executed after the resources are compiled (there's a message 
>>> complaining that the file is not found and in fact when I execute the 
>>> program the resource is not available).
>>> Is there a way around it, other than executing the command manually?
>> 
>> If you mean the project .res file:
>> That is updated on save, which is independent of compile.
>
>Ouch, so my projects that embed files as resources (and I also added those 
>files to the project to be sure they're tracked by lazarus) are working by 
>pure luck.
>Or not, since a save happens anyway when the file is modified with the lazarus 
>editor and I use compile or build, right?
>What happens if I edit the file with an external editor, it's not currently 
>opened in lazarus (so it won't prompt me to reload it) and I press 
>compile/build/run? Will the .res be regenerated or not?
>As I said, for the problem at hand I changed the logic, but I'd like to be 
>sure that my project work by design and not by chance.
>
>Bye
>
-- 
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to