Board index » delphi » Windows Installation date

Windows Installation date

Hey
I want to know if it's possible to find out then date/time when windows was
installed.
Like if i installed the 15/4-99 then my program could get that date from
windows?
Thx in advance
Jens Andersen
 

Re:Windows Installation date


Look in the registry.
Regkey:
 HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
there will be a valuename "FirstInstallDateTime" which is a 4 byte value
which should stand for a datetime value how it is coded / encoded I do not
know
succes

Jens Andersen heeft geschreven in bericht
<8eh7ga$5...@bornews.borland.com>...

Quote
>Hey
>I want to know if it's possible to find out then date/time when windows was
>installed.
>Like if i installed the 15/4-99 then my program could get that date from
>windows?
>Thx in advance
>Jens Andersen

Re:Windows Installation date


What about checking the creation-date of shell32.dll and such?
They are created during installation and not very often changed by programs
:-)

Re:Windows Installation date


Adding to the post above, there are also a lot of files in the root
directory (C:\) which have the installation date, such as
netlog.txt
windows.GID
Setuplog.txt
System.1st
etc,

cheers,

--
-----------------------------------------------
Marcelo Montagna -  marcelo1 @ forum . nu
My website: The Kibbutz Volunteers Travel Guide
http://www.forum.nu

Re:Windows Installation date


But you have to remember that, most users (just like me) delete files like
setuplog.txt or *.1st. So I think it is better to check files which are more
important. (Nobody will delete shell32.dll unless he is 1. in DOS-Mode 2.
insane)

WebEmperor

Re:Windows Installation date


Hej Jens

Check this out in your registry!

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion]
"ProductName"="Microsoft Windows 95"
"FirstInstallDateTime"=hex:a1,9c,e6,24
"Version"="Windows 95"
"VersionNumber"="4.03.1214"

This is only a subset of the keys

FirstInstallDateTime could be what you are looking for???

Greeting
Henrik

Jens Andersen <saj.ander...@get2net.dk> skrev i en
nyhedsmeddelelse:8eh7ga$5...@bornews.borland.com...

Quote
> Hey
> I want to know if it's possible to find out then date/time when windows
was
> installed.
> Like if i installed the 15/4-99 then my program could get that date from
> windows?
> Thx in advance
> Jens Andersen

Re:Windows Installation date


    Actually, they are changed very often, like when installing IE???
    EVEN, the creation dates.
    There is not certain way to do so, but in most cases checking the time of
the Windows FOLDER will do. However, if the user has installed to an existing
folder (Like I often do), that would get incorrect results.

    Regards, Dejan.

Quote
WebEmperor wrote:
> What about checking the creation-date of shell32.dll and such?
> They are created during installation and not very often changed by programs
> :-)

--
Look forward to Your response.
Regards,  Dejan Maksimovic, CP Alfa Co.
E-mail :  alfaun...@ptt.yu
  dmaksimo...@alfaunits.co.yu
Development :  alfa...@alfaunits.co.yu
Member of ASP, since April 13th 2000.
ICQ# :   56570367 -> Requires authorization
Tel.  +381-18-363247
Fax :  1-435-4070614
Enterprise file&system components for Delphi, BCB,
MSVC++, MSVB etc.

Alfa File Monitor - The only Delphi/BCB real-time
file event notification component.
http://www.alfaunits.co.yu//afm.htm

Visit the Alfa Units home page :
http://www.alfaunits.co.yu/au.htm
The best in directory, over 2GB file, monitoring,
and registry handling. Also great in
large integer operations.
Please send me Your comments, ideas,
 requests, bug reports etc.

Re:Windows Installation date


Now tell me, how would you "decrypt" FirstInstallDateTime? I've got no idea.

Re:Windows Installation date


If you install IE don't you upgrade you system? If you install IE 4 you'll
get the new (but slow) Explorer interface -> so it is a upgrade of Windows
and you have some kind of NEW version.
Maybe the last thing could be the creation date of system.dat/user.dat. But
this is also not very accurate... (Backups, regedit.exe /C [file.reg])

Re:Windows Installation date


On Sun, 30 Apr 2000 14:17:38 +0200, "Jens Andersen"

Quote
<saj.ander...@get2net.dk> wrote:
>Hey
>I want to know if it's possible to find out then date/time when windows was
>installed.
>Like if i installed the 15/4-99 then my program could get that date from
>windows?

There a Registry key called...um...InstallDate  :>)

under HKLM\SOFTWARE\Microsoft\<your type of Windows>\CurrentVersion

I don't know what format it is in, but maybe someone else here knows.
Daniel J. Wojcik
****************
There is water at the bottom of the ocean.

http://www.genjerdan.com
programming, and other things best done in private

Re:Windows Installation date


Found this out on http://www.efg2.com/lab/library/Delphi/DatesAndTimes/

// Open the registry key
IF RegOpenKeyEx(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion', 0,0, Key) = 0
THEN BEGIN
  DataLength := SizeOf(Data);
  RegQueryValueEx(Key, 'FirstInstallDateTime', NIL, @ValueType, @Data[0],
@DataLength);
  MemoInfo.Lines.Add(' ' +
  FormatDateTime('mm/dd/yyyy hh:nn', FileDateToDateTime(DataValue)));

  // Close the registry key
  RegCloseKey(Key);
END;

Quote
"Jens Andersen" <saj.ander...@get2net.dk> wrote in message

news:8eh7ga$57f2@bornews.borland.com...
Quote
> Hey
> I want to know if it's possible to find out then date/time when windows
was
> installed.
> Like if i installed the 15/4-99 then my program could get that date from
> windows?
> Thx in advance
> Jens Andersen

Re:Windows Installation date


Look at it again came up with the following works at my place

function GetInstallDate: TDateTime;
var Reg : TRegistry;
    D   : integer;
begin
  Reg:= TRegistry.create;
  try
    Reg.RootKey:=HKEY_LOCAL_MACHINE ;
    if Reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion',false) then
      Reg.ReadBinaryData('FirstInstallDateTime',D,sizeof(D))
    else
      D:=0;
    Result:=FileDateToDatetime(D);
    Reg.CloseKey;
  finally
    Reg.free;
  end;
end;

Jens Andersen heeft geschreven in bericht
<8eh7ga$5...@bornews.borland.com>...

Quote
>Hey
>I want to know if it's possible to find out then date/time when windows was
>installed.

Re:Windows Installation date


On Mon, 1 May 2000 12:41:41 -0400, "Shannon Broskie"

Quote
<sbros...@tagfolio.com> wrote:
>Found this out on http://www.efg2.com/lab/library/Delphi/DatesAndTimes/

Not In NT4, though.  Different names of the keys.

Daniel J. Wojcik
****************
There is water at the bottom of the ocean.

http://www.genjerdan.com
programming, and other things best done in private

Re:Windows Installation date


It should be pretty easy to get to work on both nt and 95/98
If it's just another key then it's just a thing about getting windows ver
and using the proper key
GenJerDan <woj...@genjerdan.com> skrev i en
nyhedsmeddelelse:390ebfb6.145636...@forums.borland.com...
Quote
> On Mon, 1 May 2000 12:41:41 -0400, "Shannon Broskie"
> <sbros...@tagfolio.com> wrote:

> >Found this out on http://www.efg2.com/lab/library/Delphi/DatesAndTimes/

> Not In NT4, though.  Different names of the keys.

> Daniel J. Wojcik
> ****************
> There is water at the bottom of the ocean.

> http://www.genjerdan.com
> programming, and other things best done in private

Other Threads