简体   繁体   中英

How to add settings and make then be built into an existing exe file in Delphi

lets say that I have a program, that is modifying registry in Windows. User can chose what keys will be changed. After this he will click "generate" to create new exe file which will do its job depending on user choices. How can I achieve that "exe generating" by clicking generate?

First you need to have two EXEs. One is your main app, and the second is the app that changes the registry. Now you have to append some data to get a copy of your secondary app using your main app and append the data that specifies what keys to change. One way is to use resources. Use your main app to append required data as resources to your target exe (The compiled to-be-generated exe). Your target exe file should check and load data resource from its own executable file and retrieve the required data.

You might find these links useful: How to attach a resource file to an existing executable file?

And how to retrieve the resource in your target exe: http://delphi.about.com/od/objectpascalide/a/embed_resources_2.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM