Question:
I am using the Chilkat .NET zip component and have noticed that when I create a password protected zip file using the WriteZipandClose method the inherited windows security settings are not applied to the file. On Windows 2000 the “allow inheritable permissions from the parent…” option is checked but the inheritable permissions are not propagated to the zip file being created. On Windows 2003 the “allow inheritable permissions from the parent…” is not selected. Have you ever encountered this? Any settings I can change to correct it?
Answer:
Set the zip.TempDir property equal to this string: ".".
When the Zip component writes a Zip, it does so in a temporary directory and then moves the Zip to its final destination. If the temp directory is something other than the current working directory, the permissions will be relative to where it was created. If you change the TempDir to ".", it fixes the problem because the temp Zip is created in the same directory as the final target directory.