Archive: nsisunz plugin and file dates


nsisunz plugin and file dates
Hi.

It seems the nsisunz plugin doesn't restore file dates when extracting them. They all contains the extraction date. Does anybody have the same problem ? Any idea ?

Sebastien


4.8.2.7 SetDateSave This command sets the file date/time saving flag which is used by the File command to determine whether or not to save the last write date and time of the file, so that it can be restored on installation. Valid flags are 'on' and 'off'. 'on' is the default.

It sounds like your script contains the statement SetDateSave off. Remove that statement and see what happens.

If the plugin is doing it, and you don't have a SetDateSave statement, maybe you need to look for options in that plugin, or change to another unzip plugin?

Don


Hi and thanks for your answer.

In fact, my script does not include that statement and it should not have any effect to have it or not. In fact, I don't call the File command in my script but I call the following :
nsisunz::Unzip "file.zip" "c:\dest_dir"

It extract the content of a zip file and put it in the "c:\dest_dir" directory. When it extracts the content of the zip archive it sets the date of these files to the extraction date/time and not to the original date/time.

Sebastien


I don't think I can help you. I tried to look at the nsisunz plugin code, but the download links are broken. I think the plugin is writing the file and not setting the stored date, but I'm only guessing.

Don


Yeah, thanks anyway for looking at it. I just wanted to warn people and maybe reach the author of the plugin.

I didn't have time to look to modify the plugin so I searched for other alternatives. In the zlib distribution, there is a small utility called "minizip" which produces 2 executables "minizip.exe" and "miniunz.exe". I use the later to extract my zip files with the correct date. nsisunz is a bit easier but it is only a matter of copying the exe to a temp place, extracting the zip and deleting the exe.

Sebastien


it is only a matter of copying the exe to a temp place, extracting the zip and deleting the exe
The $PLUGINSDIR is a good temp directory that gets deleted (along with its contents) when the installer finishes.

Don

Is this filedate issue resolvable by using either

nsis7z
http://forums.winamp.com/showthread.php?postid=2471397

or

ZipDLL
http://nsis.sourceforge.net/ZipDLL

?
Not sure if 7z handles regular zips and not sure if either of above preserve filedates correctly?

Note also, filedate issue when unpacking NSIS in multiple timezones... see separate discussion at
https://sourceforge.net/tracker/inde...49&atid=373085


Further... just tried ZipDLL and it works fine, preserves dates. Just grab the dll, add to plugins folder, and call the extractall method.

Here's a little sample download and unpack...

InitPluginsDir
NSISdl::download ftp://ftp.somewhere.com/myfile.zip "$PLUGINSDIR\myfile.zip"
ZipDLL::extractall "$PLUGINSDIR\myfile.zip" "$INSTDIR"

If myfile.zip has subfolders inside the zip, they all unpack correctly to a little tree at wherever (eg above to $INSTDIR)