Archive: How can I prompt a dialog box when file will be overwrited?


How can I prompt a dialog box when file will be overwrited?
As the title presented.

Or How can I notice the user when the files may be overwited?
Do I must check the file was exist one file by one?And if there are a lot of files.I thanks it is a hard work.Thank you for any advice.


You have to manually check for file existence. You can make a macro out of it for convenience.


The only 'problem' you'll run into is that you have to explicitly handle every file that you might add with a File command separately. I.e. you can't use File "somedir\*.*" to include multiple files as there's no way to get, from that, which files would be included.

You would have to compile the exact list of files to include - which you could do with another installer that you run before compiling the main installer.

If it were at all possible to get callback functions for SetOutPath, File and WriteReg* (and any other commands that may implicitly affect the file system/registry), so that you can do some per-item checking on folders and files, I would certainly jump on it ;)