Results 1 to 9 of 9

Thread: How to embed a file into a project?

  1. #1
    dereklyw
    Guest

    Question 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.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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).

  3. #3
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    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....
    Don't Rate my posts.

  4. #4
    dereklyw
    Guest

    Question

    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.

  5. #5
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    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.
    Don't Rate my posts.

  6. #6
    dereklyw
    Guest

    Question

    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.

  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Talking

    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).

  8. #8
    dereklyw
    Guest

    Question

    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.

  9. #9
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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
  •  



Click Here to Expand Forum to Full Width