File modification date comparison fail

35 views
Skip to first unread message

Pete Boyd

unread,
Jun 12, 2014, 6:37:10 AM6/12/14
to wpk...@googlegroups.com
Hi. Using WPKG-GP 0.17 on Windows 7 (and WPKG 1.3.1 on the Debian 7.5 Samba server), I have a package that just deploys the WPKG-GP config file. I do a modification date comparison of the config file between the version in the Program Files directory and the version I deploy, using:

<check type="file" condition="datemodifyequalto" path="%PROGRAMFILES%\Wpkg-GP\Wpkg-GP.ini" value="@%SOFTWARE%\wpkg-gp\Wpkg-GP.ini"/>

I do this the same way for Firefox and Thunderbird config files and they work fine. However WPKG-GP's doesn't work because of the following:

"Reading last modification date of 'C:\Program Files\Wpkg-GP\Wpkg-GP.ini'.
Reading file modification date of reference file '\\server\windows-admin\wpkg\packages\wpkg-gp\Wpkg-GP.ini'.
Reading last modification date of '\\server\windows-admin\wpkg\packages\wpkg-gp\Wpkg-GP.ini'.
Modification date of file 'C:\Program Files\Wpkg-GP\Wpkg-GP.ini' is Tue Jun 10 16:16:24 UTC+0100 2014 which isn't equal to the comparison date Thu May 15 11:25:20 UTC+0100 2014 check failed."

It is getting the modification date of the present moment at which it has just copied the file, which surely is wrong? When I look on disk, both files have the same last modification date and creation date. The file in Program Files does not have this modification date of the present moment.
Has anyone any idea what's going on please?

Thanks

Oliver Sauder

unread,
Jul 17, 2014, 6:43:30 AM7/17/14
to wpk...@googlegroups.com
Wpkg-GP.ini has the modification date of the present because Wpkg-GP when loading the ini file will always rewrite it to make sure that certain settings are set correctly (e.g. it encrypts the password).

I guess there are several ways around this. But what I usually do is when I adjust Wpkg-GP.ini in the repository I increase the revision number of the wpkg-gp package. This way wpkg will install wpkg-gp again with the new Wpkg-GP.ini file.

Hope this helps,
Oliver
Reply all
Reply to author
Forward
0 new messages