Jump to content

Want an option dialog box when quitting an application


chikky

Recommended Posts

I have modified some applications to make them ready to use without installing. I have used rar sfx, which extracts files to temporary or a specified folder before launching the applications.

I want to incorporate an optional question so that when I exit the application I am running, it should ask that whether I want to delete the files or the folder I extracted to. Is it possible with a batch file?

Can somebody help me, if I am clear enough.

Link to comment
Share on other sites


Well, WinRAR supports a temporary extraction mode, which you can configure in the SFX options. This does the trick nicely, but it's an all-or-nothing approach. Eg, you have to specify this when creating the archive, so it'll either always delete itself after execution, or it never will.

There isn't really any clean/easy way to do what you asked. It's possible to write a batch file that can delete the extracted files, but given that RAR SFX can only execute programs before or after extraction, you can't tell it to wait until after the program has completed execution before running the cleanup script. I guess you could work around that by having WinRAR launch the cleanup script first, then having it run the application and wait until execution has completed before prompting you and deleting the files, but like I said, it's not very clean.

Another issue is that you're talking about deleting groups of files without any real interation (other than simply clicking Yes). I trust WinRAR to do stuff like this in temporary extraction mode because it's specifically written to create unique directories and ensure it doesn't delete any other files, but I'd be a heck of a lot less willing to run a custom written script on my system that's going to do the equivalent of deltree on any directory. Call me paranoid. :)

Link to comment
Share on other sites

i dont know why would you want to keep temp files of those setups.

the main problem here is that sfx archives use folder names somewhat extrange and you can never know for sure what their names are in order to delete them.

tha only think i can think of is that you can use a custom folder to extract your sfx archives and use names that are familiar to you. then you can use a script or a cmd file that deletes the ones you want. but you cant have a Y/N question before this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...