Marus Gradinaru
Marus Gradinaru

Reputation: 3120

How to store a signature into the application file?

I want to sign the user application with the user name if he makes a donation. For that I need to write the user name into the exe file. But the file cannot change itself because it is in use at that time. Do you know if anything can be done ? Of course, I can store the signature in a separate file or in registry, but in this way the signature can be lost. I want the modification to be permanent and cannot be changed by the user. I will accept any idea that help me accomplish this...

Upvotes: 0

Views: 241

Answers (1)

Matthias B
Matthias B

Reputation: 1077

You can let the application make a copy of itself, then modify the copy, and then start the copy (with ShellExecute).

The modification could be inspired by the UpdateResource examples here: How to attach a resource file to an existing executable file?

The "signature" would be stored in a resource, so your application would have to read it from the resource, for example with Delphi's TResourceStream class.

Upvotes: 1

Related Questions