0

I'm using VCLZip 2.21 to unzip a zip file. I can make TVCLUnzip overwrite readonly files by setting ReplaceReadOnly to True. But how do I implement a confirmation by the user? I already added an OnSkippingFile handler setting Retry to True but this doesn't result in an additional try. (AFAICT the Retry variable is never read.) Do you have any advice?

Uli Gerhardt
  • 13,748
  • 1
  • 45
  • 83
  • BTW: Does anybody still use VCLZip? The [forum](http://vclzip.proboards.com/index.cgi) seems dead. – Uli Gerhardt Jul 23 '12 at 14:05
  • No, we switched to Abbrevia Zip some time ago. Main Reason for us, its not dead and works with 64-Bit – Lars Jul 23 '12 at 16:54

1 Answers1

2

It seems to me that you shouldn't change ReplaceReadOnly. Instead, set OverwriteMode to Prompt, and then handle the OnPromptForOverwrite event. In that event, check whether the file is read-only, and only prompt if it is.

Otherwise, you could try changing the read-only flag of a file in the OnSkippingFile event handler before setting Retry, but the documentation doesn't say the Retry parameter is used in that situation. It only talks about retrying during zipping operations where it couldn't open the to-be-zipped file, not during unzipping operations.

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
  • Unfortunately the documentation for `OnSkippingFile` isn't up to date - e.g. it doesn't even mention `srCreateError` which is the `Reason` I get in the discussed situation. – Uli Gerhardt Jul 23 '12 at 13:39