Как узнать, откуда была установлена Windows?
uses
..., Registry;
function GetWindowsSetupPath: string;
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
Reg.RootKey := HKEY_LOCAL_MACHINE;
Reg.OpenKey( 'Software\Microsoft\Windows\CurrentVersion\SETUP', false );
Result := Reg.ReadString( 'SourcePath' );
Reg.CloseKey;
Reg.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin ShowMessage( GetWindowsSetupPath );
end; |