flaab
flaab

Reputation: 573

Can I edit a file before installing with Inno Setup?

I would like to make a simple windows installer to copy some files into the client's file system -that's all-. However, I would like to edit the main binary and insert the license code directly into it. Is there a way to do so from Innosetup? Sort like ....

sed -i 's/needle/replacement/g' targetfile

It is a Metatrader4 indicator.

Thank you!

Upvotes: 2

Views: 1336

Answers (1)

Deanna
Deanna

Reputation: 24273

You can do a simple string replace on the installed executable using LoadStringFromFile(), StringChange() and SaveStringToFile(). Note that your needle and the replacement have to be the exact same length otherwise the executable will be corrupted.

Upvotes: 2

Related Questions