[RESOLVED] Changing the date of copied files

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
Erousseau
Messages: 5
Registration: January 28, 2022 - 1:33 PM

January 28, 2022 - 4:38 PM

Hello,

I'm trying to create a package for installing a "portable" software application (internal development).

However, when installing files (using CopyTree2), the modification date of these files changes to the installation date.

I find this annoying (especially for EXEs, DLLs, etc.). Is there a way to prevent this?

Thanks,

Etienne

- WAPT version installed: 2.1.2
- Server OS: Linux
- Administration/package creation machine OS: Windows 10
Last edited by erousseau on 04 Feb 2022 - 11:12, edited 1 time.
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

February 1, 2022 - 3:32 PM

Hi Etienne,

indeed, Python's Zip library doesn't restore timestamps; it's a bug/limitation/feature of Python.
That said, the data is present in the archive, and the API is available to retrieve the timestamp from the zip file. So we should be able to do something, but it needs to be done at the time of unzipping. However, this implies accessing the unzipped files twice, so we need to consider the impact.
For now, you can correct the timestamps with the Python function `os.utime(...)`, noting the timestamps you need to restore.
I'll create an internal ticket before zipping.

Best regards,

Denis Cardon
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Erousseau
Messages: 5
Registration: January 28, 2022 - 1:33 PM

February 2, 2022 - 12:44

Hello Denis,

Thank you for your reply.

It seems to me that, in most cases, when you unzip a file, you expect the modification date to remain unchanged. The way Python's Zip library works seems strange to me...

If it were possible to do something similar in WAPT, that would be fantastic!

In the meantime, is there a way to read the WAPT archive during installation (from the "install" procedure) to retrieve the file dates?

Etienne
User avatar
dcardon
WAPT Expert
Messages: 1932
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

February 3, 2022 - 10:37

Hello Etienne,
erousseau wrote: Feb 2, 2022 - 12:44 It seems to me that, in most cases, when you unzip a file, you expect the modification date to remain unchanged. The way Python's Zip library works seems strange to me...
Yes, I admit that I also found it quite curious.
erousseau wrote: Feb 2, 2022 - 12:44 If it were possible to do something in WAPT, that would be fantastic!
The ticket has been submitted, but it probably won't be included in the upcoming version 2.2, which should be released very soon. We'll have to wait for version 2.3.
erousseau wrote: Feb 2, 2022 - 12:44 In the meantime, is there a way to read the WAPT archive at the time of installation (from the "install" procedure) to retrieve the file dates?
If I remember correctly, the package is only removed from the WAPT cache once it's properly installed. You should therefore be able to find it in $WAPT_HOME\cache (please verify).

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
Erousseau
Messages: 5
Registration: January 28, 2022 - 1:33 PM

February 4, 2022 - 11:11

Hello Denis,

Thank you for your replies.

While waiting for version 2.3 (which would simplify things considerably), I'll try to retrieve the dates from the archive; otherwise, I'll create an installer for my application (in addition to the WAPT package).

Etienne
Locked