Archive: Overwrite confirmation


Overwrite confirmation
Hi,
I'm writing a really simple installer. Basically, its purpose is to copy a few files to different locations on the drive. I could of course do this by batch scripting, but I want it to look nice.

One thing I haven't figured out is, how do I make the installer prompt the user to "OK" an overwrite. The way I see it, you have either a overwrite mode or a no-overwritemode, but both are without user interaction.

Any help or hits here would be appreciated.

JF


Either check if the file exists with IfFileExists or ${If} ${FileExists} or wrap it with SetOverwrite try and IfErrors. In both cases, you can put the code in a macro for simpler usage.


How about using a message box? Turn the overwriting on and then make the box pop up asking if the user wants to overwrite the files. Then if the user says yes overwrite, and if not skip that section.

Something kinda like this:

MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to overwrite the files" IDYES overwrite IDNO skipoverwrite

overwrite:
; overwrite all the files
skipoverwrite
; proceed with install without overwriting files

Hope it helps