Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Check filedate (http://forums.winamp.com/showthread.php?t=244731)

RitchieRich 27th April 2006 07:08

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 07:27

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 08:40

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 08:58

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 09:02

Hey Red Wine,

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

Red Wine 27th April 2006 09:12

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

RitchieRich 27th April 2006 09:14

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 09:23

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 09:27

Will do..
thanks!!

Rgds,
Richard

RitchieRich 27th April 2006 09:29

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

Red Wine 27th April 2006 09:36

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 11:06

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

Richard

Red Wine 27th April 2006 11:33

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


All times are GMT. The time now is 04:35.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.