Jump to content
  • Advertisement

Archived

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

TheGriz42

Install program

This topic is 6602 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

My question pertains to deleting the installation file of a game. I wrote my own install program, but I would like to know how, in Windows 9x/NT, to delete the install program (Install.exe) once it has completed running?

Share this post


Link to post
Share on other sites
Advertisement
I guess I didn''t quite explain myself properly. I wrote a game and my own custom install program (called Install.exe). After it finishes installing the files to their new location, I would like the Install.exe program to close and somehow delete itself. (The install program is located on the user''s local drive and should be deleted once it is done running, it''s not on a CD or anything, where this question wouldn''t even be pertinent.)

Share this post


Link to post
Share on other sites
If you could get to ring 0 of the Windows OS, you got it. First use VxdBootRingLevel() to go to OS_RING0 and then use the UseDebugEventEx() to wait for the code EXIT_PROCESS and check that the process id is the same as your install program''s process id. Then if it is, use GetModuleFileName() to get the file path and name, then its simply deleting the file.

THEN, you have to use ResetOSSystemTables() to remove any changes you''ve done, then use VxdBootRingLevel() to OS_RING3 (where programs run) and then use ExitProcess() to exit out... your file is deleted before your program ended, in a sense.

Enjoy!
- OldManDave.

Share this post


Link to post
Share on other sites
Where are all those functions declared? I can''t find them, or how to use them anywhere? Do you have a short example of how to use them?

Share this post


Link to post
Share on other sites
I don''t think you want to get into ring zero, for one thing that''s internal stuff and programs normally shouldn''t do that. Also, it would only work for Win9x, not NT, and it''s really complicated (or it seems).

Anyway, here''s a pretty informative article:
click here

If you want to know how I do it, I just use Windows Installer. That way I don''t even have to write my own installation programs, but it is hard and complicated to use.

Share this post


Link to post
Share on other sites
Why not to create yet another exe that is started when install is about to close itself and which will ONLY wait for ten seconds or so and delete the install files...
Or simply, have your main program to delete unnecessary install files.

Share this post


Link to post
Share on other sites
Why would you want to delete the install executable. Perhaps the user wants to keep it.

-Andreas

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!