Archive: Check filedate


Check filedate
Hey people,

I want to make an 'installer' for an database (access ADP)
I want the installer to check the date from the current ADP on the clients computer..
If this date is older than the date from the file in my 'update' directory (on the network) , I want the installer to copy it to the clients computer, else.. just start access with the given database..
Any sugegstions how to check?

Thanks

Richard


Do you want to extract the new file from the installer to the client or just copy it from one net location to another?


Hey Red Wine,

Thanks for ur reply.

From one location to another..
What I was thinking; one option is to read a value (version or something) from a INI file in my 'update' directory and compare it to the INI file on the clients PC...
If it matches.. the installer does 'not run' and if it does not match the installer copy's the ADP file from my network directory to the clients PC..
Perhaps anyone have a sample script how to perform this??

thanks

Richard


Hmm, while we're talking here for a db file, is it possible users update the db constantly? they'll loose their records if you're goin to update the file based on an ini string that you added once you've first installed that file. If the db is for read access only, then your thinking about ini should work unless the client for some reason had remove the ini. If you have access to registry will be better. Read the NSIS documentation on how you would manage the readini/writeini and readreg/writereg instructions.
regards


Hey Red Wine,

The access db is a frontend only.. the data is stored on a SQL Server...


So if you have access to client's registry I'd suggest a reg record check / compare /update.


Ok.. I have the following ;

ReadINIStr $1 "W:\DB Updates\Fieldservice.ini" "VERSIONCODE" "VERSION"
ReadINIStr $2 "C:\Program Files\fieldservice\Fieldservice.ini" "VERSIONCODE" "VERSION"

How can I compare the 2 values.. ?
If the values MATCH then the installer must quit silently and open a specific file (my database file) , if it DOES NOT MATCH, the installer needs to copy a file from one location to another...

Thanks

Richard


suggestion: use always numeric values, then IntCmp "value1" "value2" and select your action according to the result. See documentation for IntCmp :-)


Will do..
thanks!!

Rgds,
Richard


btw: any suggestions for a 'silent' abort?
So that the user wont have to click 'cancel' ?


when you get as comparison result that there is not need for any further action just Quit :-)
You can do the whole check .onInit and quit before gui comes up.


Great tips!!
Thanx.. got it up and running now :-)

Richard


now that you have figured the entire procedure allow me to say that for my opinion this solution is weak while everyone could edit or remove an ini even by accident. I think you sould try to transform the procedure in registry entries :-)
regards