HDClown
(Lurker)
2004-03-11 05:32 PM
Can I check the contents of a file?

I have an installer file that updates some files on a local computer that I want to run as part of a login script, however, I don't want it to run every timet he uesr logs in since it would be overwriting the same data all the time. One idea I have is to have my installer dumb a .txt file on the local HDD (say C:\) and have 1 line in there with a version number.

If Kix is capable, I'd have it check that version number inside the file and if it was not equal the version number coded in the Kix script, it would run the installer. If the version matched, it would install the script.

The installer itself would update that version # to be in line with the build revision I have packaged in the installer.

Is this something Kix can do?


Radimus
(KiX Supporter)
2004-03-11 05:39 PM
Re: Can I check the contents of a file?

kix can do anything (almost)

It is usually a matter of how clever you are... but look into getfileversion() or getfiletime() might be a simpler method for what you want to do...


Sealeopard
(KiX Master)
2004-03-11 05:48 PM
Re: Can I check the contents of a file?

You should rather check the registry whether the application has already been installed, either by checking a native regkey or specifically creating one whenever you run the installer.

Les
(KiX Master)
2004-03-11 07:06 PM
Re: Can I check the contents of a file?

Cookies on the hard drive have a habit of of disappearing. A version check or a reg read is better. If there is nothing by default to key on, you can create your own key/value in the reg and use that. Users are less likely to seek out and destroy reg keys/values than cookies.

HDClown
(Lurker)
2004-03-11 07:22 PM
Re: Can I check the contents of a file?

I didn't think of the registry, but I definately like that idea better. I knew Kix could do registry stuff, but wasn't sure on the file. The registry stuff should be much easier to do anyway.

Thanks.