johanfo
30th October 2007 22:19 UTC
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
kichik
30th October 2007 23:24 UTC
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.
Fightin_Foo
2nd November 2007 15:49 UTC
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