[Lazarus] Extracting a resource from an exe file & adding it back in

Sven Barth pascaldragon at googlemail.com
Mon Oct 17 16:58:27 CEST 2011


Am 17.10.2011 16:28, schrieb waldo kitty:
> On 10/15/2011 10:48, Hans-Peter Diettrich wrote:
>> Reinier Olislagers schrieb:
>>> I want to give users an editor to edit a text file inside helped.zip &
>>> save the changes back to the executable.
>>
>> You'll run into a couple of problems:
>>
>> - An executable cannot update itself (at runtime).
>
> why not? i have several projects that are in line to be ported to
> FPC/Lazarus... they store certain config values within them which are
> read and altered on each execution... why can we not do this now? what
> is missing??

On Linux there should be no problem (don't know about other POSIX 
systems), but on Windows there is the problematic point that the binary 
is opened as "share deny write" from Windows (that's why Lazarus 
generates a "lazarus.new.exe" when compiling itself). It could be though 
that you can open the executable within itself as writeable, I have 
never tried this, so it should work.

In sum: the problem is not on FPC side, but on OS side.

Regards,
Sven





More information about the Lazarus mailing list