- NSIS Discussion
- Check filedate
Archive: Check filedate
RitchieRich
27th April 2006 08:08 UTC
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
Red Wine
27th April 2006 08:27 UTC
Do you want to extract the new file from the installer to the client or just copy it from one net location to another?
RitchieRich
27th April 2006 09:40 UTC
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
Red Wine
27th April 2006 09:58 UTC
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
RitchieRich
27th April 2006 10:02 UTC
Hey Red Wine,
The access db is a frontend only.. the data is stored on a SQL Server...
Red Wine
27th April 2006 10:12 UTC
So if you have access to client's registry I'd suggest a reg record check / compare /update.
RitchieRich
27th April 2006 10:14 UTC
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
Red Wine
27th April 2006 10:23 UTC
suggestion: use always numeric values, then IntCmp "value1" "value2" and select your action according to the result. See documentation for IntCmp :-)
RitchieRich
27th April 2006 10:27 UTC
Will do..
thanks!!
Rgds,
Richard
RitchieRich
27th April 2006 10:29 UTC
btw: any suggestions for a 'silent' abort?
So that the user wont have to click 'cancel' ?
Red Wine
27th April 2006 10:36 UTC
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.
RitchieRich
27th April 2006 12:06 UTC
Great tips!!
Thanx.. got it up and running now :-)
Richard
Red Wine
27th April 2006 12:33 UTC
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