Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

logout

self`_extrating

This topic is 5194 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can I put a exe file(file1) into exe file(file2). For then to extract it when the file2 gets run. and then I want file2 to run file1, and then I want file1 to delete file2. Can this be done ? If it can, then how ?

Share this post


Link to post
Share on other sites
Advertisement
You could put file1 into file2 as a resource, then when file2 is run, obtain the raw resource data and write it to file, then call create process on file1 with file2''s full path as an argument, then make file2''s process exit, then in file1 have it sleep for a second or 2 to ensure file2''s process terminates, then have file1''s process remove the file which was passed as an arg.

Share this post


Link to post
Share on other sites
You can actualy append anything you like to the end of an exe file once its compiled. (If say, your making a setup program)

File 1 is appended to file 2 with a signature to mark the end of the original file.
When file 2 runs it opens itself for reading and finds the signature and copies the remaining part of the file to a new file.(file 1)
Call ShellExecute to run the new filw

File 1 then deletes file 2.

Share this post


Link to post
Share on other sites
Check out zlib or something similar and resources files, especially the functions to update a resource. If you do, it should be quite obvious that you can write one generalized program to "self-extract" a file and another interface program to put the file in there (possibly holding the self-extracter in a resource). The code practically writes itself.

______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
MySite
______________________________________________________________

Share this post


Link to post
Share on other sites
Zip offers (for $50) a self extracting installer wizard, which will allow you to make all those fancy installers... i was considering it, i dont think its worth 50 bucks atthis point though... just a thought...
-Dan

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!