I am developing client-server application based on .NET. Server side runs on Windows XP, client side runs on Windows CE device (Motorola Symbol 3100, this might be relevant).
Client side needs auto-update feature, that I decided to implement on my own due to several topics prevented me from using any ready-to-use auto-update solutions. My application checks for updates every time it starts, comparing files on remote site by LastModificationTime. If there are any, it downloads files from a remote server to temp dir, then it stops and runs another application that replaces updated files and runs main application.
Files are being downloaded through socket, thus after file has been downloaded, my application sets LastModificationTime on every file to the value remote site had provided. I am using a time change solution from this topic, and it works well, i.e. file modification time is updated perfectly well, though comparison fails for some of these files. It may be relevant, that those files for which my solution fails to compare, are Motorola Symbol DLLs.
The problem is that despite all my work, those Symbol files have different modifiction timestamp every time I compare them. It is always differs by 1 hour. E.g. remote site says that file time is 1/24/2012 5:13:08, while on my application side it is 1/24/2012 6:13:08. There are no problems at all with ANY other file. Those "any" are my application exe, my DLLs, DLLs provided by third party components (like OpenNETCF), MS .NET related files and so on. Neither of them troubles me - if they are updated, this is only one time, then no updates if they were not changed really. During compare I always use ToUniversalTime() so that no timezone related differencies occur (and, as I mentioned, this works for other files). So I always get situation like this:
- remote site provides a number of files, and there are really changed files within it (my application, my DLLs, etc) along with those Symbol DLLs (always!)
- files are downloaded and updated
- my application runs again and checks for updates again
- now only Symbol DLLs are reported as changed
- application falls into an endless loop, as Symbol DLLs are always have modification time different by 1 hour
I tried to create an additional application that reads file timestamp on Symbol files, then sets it again. I thought that original Symbol files could have some "wrong" datetime or something. This didn't give any improvement, even when I set new time increased by 1 second: during compare in update code it is again 1 hour difference.
Finally, I have decided to remove those Symbol files from my updates. They are not changed frequently, so I have some time to discover on this problem, yet if Motorola will roll out next update - I will fall in my problem again.
I don't know where the problem source lays and I would be grateful for any tip on this. I think my source is irrelevant as this problem occurs just for some files, and anyway modification time is always changed correctly: I checked it on my device, in the server deployment folder (from where updates are being downloaded), everywhere. May be this is timezone-related problem, but how it affects only some files, not everyone of them?
I will explain further. My server in its updates folder contains exactly following files:
FliteDevice.dll
fliteDLL.dll
OpenNETCF.dll
OpenNETCF.AppSettings.dll
OpenNETCF.Configuration.dll
pdt.exe
PdtComm.dll
Symbol.dll
Symbol.xml
Symbol.Audio.dll
Symbol.Audio.xml
Symbol.Barcode2.dll
Symbol.Barcode2.xml
Symbol.StandardForms.dll
Symbol.StandardForms.xml
System.Data.OracleClient.dll
System.EnterpriseServices.dll
System.EnterpriseServices.Wrapper.dll
System.Transactions.dll
System.Web.dll
update.exe
Considering it is first time I'm running an update, my server sends all of these files to client. My client (pdt.exe) receives them all, runs update.exe (and exists so updater could replace app files with newer ones) which replaces changed files (all files in this first-run case).
Then updater runs my application (pdt.exe), and my application again checks its files with those on server side. And now files to update are:
Symbol.dll
Symbol.xml
Symbol.Audio.dll
Symbol.Audio.xml
Symbol.Barcode2.dll
Symbol.Barcode2.xml
Symbol.StandardForms.dll
Symbol.StandardForms.xml
And again updater replaces files, and again it runs main application. And yet again the same files (those Symbol.*) are considered as changed and downloaded and replaced. Only those, no other file exists in further update check request. Never. Something is wrong with exactly those files, not my code, nor other files.