|
-
Apr 29th, 2002, 01:03 AM
#1
How to embed a file into a project?
Can I embed a file (e.g. text file) into a project? In fact, I want to create an application that will copy a certain text file into a location specified by the user. Something like an install shield. However, I don't want to first copy the text file into the harddisk and then move to the specified location. I hope the file can be embedded into the ".exe". How can I do this?
Regards,
Derek.
-
Apr 29th, 2002, 01:16 AM
#2
You can put things in a resource file and they will get compiled ('embedded') into the exe. If you mean to have something embedded after the program is compiled then I don't think that can be done (or is bound to be way more trouble than its worth).
-
Apr 29th, 2002, 01:18 AM
#3
PowerPoster
Well if the text file isn't going to be edited and isn't going to be shown in anything else other than in your app, I guess you could store the contents in a module. But thats abit over the top I guess....
-
Apr 29th, 2002, 01:27 AM
#4
I have tried adding the file as a module but seems it'll get compiled when the project is built. The text file cannot be compiled of course. In fact, I just want to embed the file into the form for copying it to a specific location later ...
Is it possible to do so?
Derek.
-
Apr 29th, 2002, 01:29 AM
#5
PowerPoster
Ok, so lets get this....
You have a Text File, you want to go with your app. Why not just add it when you package it?? It'll get distributed with the rest of your app.
-
Apr 29th, 2002, 01:42 AM
#6
The purpose of this program is to act like a program patch or something. And I don't want to user knows which file I have patched (though you may argued that by comparing the file timestamp he can check this out, anyway, just don't want to disclose the file at the very beginning.) If I use the package method, all files, including the text file, will be deployed into one directory first. So the user may notice the text file.
Regards,
Derek.
-
Apr 29th, 2002, 01:45 AM
#7
Originally posted by Edneeis
You can put things in a resource file and they will get compiled ('embedded') into the exe. If you mean to have something embedded after the program is compiled then I don't think that can be done (or is bound to be way more trouble than its worth).
-
Apr 29th, 2002, 01:45 AM
#8
Miss something. I just want this program patch to be one exe only so that when the user click the patch, all modifications will be made to the existing application. If I use the install package, you have to install the program patch as a windows program first and then the user have to click the program patch to do the patching .. looks like a bit clumsy ...
Correct me if I'm wrong.
Regards,
Derek.
-
Apr 29th, 2002, 01:48 AM
#9
If you are deploying the same exe only updated then you can probably just replace the old exe with the new one as long as there are no new dependencies. Then this new exe can check if the new text files is deployed yet and if not roll it out.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|