I want to distribute only a single .exe, however, at runtime I would like it to extract some embedded image resources to the users hard disk drive.
Can I, and if so, how?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use Delphi’s TResourceStream. It’s constructor will find and load the resource into memory, and it’s SaveToFile method will do the disk write.
Something similar to this should work:
If you can use the resource ID instead of name, it’s a little less memory. In that case, you’d resplace Create with CreateFromID, and supply the numeric ID rather than the string name.