12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- {
- sdkutil.pas
- SDK utility methods
- Copyright (C) 2006-2007 Felipe Monteiro de Carvalho
- This file is part of MkSymbian build tool.
- MkSymbian is free software;
- you can redistribute it and/or modify it under the
- terms of the GNU General Public License version 2
- as published by the Free Software Foundation.
- MkSymbian is distributed in the hope
- that it will be useful, but WITHOUT ANY WARRANTY; without even
- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE. See the GNU General Public License for more details.
- Please note that the General Public License version 2 does not permit
- incorporating MkSymbian into proprietary programs.
- }
- unit sdkutil;
- {$ifdef fpc}
- {$mode delphi}{$H+}
- {$endif}
- interface
- uses
- Classes, SysUtils, registry;
- type
- { TSDKUtil }
- TSDKUtil = class(TObject)
- private
- vSDKFolder, vSDKPartialFolder: string;
- public
- constructor Create;
- procedure LocateSDK;
- property SDKFolder: string read vSDKFolder;
- property SDKPartialFolder: string read vSDKPartialFolder;
- end;
- var
- vSDKUtil: TSDKUtil;
- implementation
- { TSDKUtil }
- procedure TSDKUtil.LocateSDK;
- var
- Reg: TRegistry;
- BufferStr: string;
- begin
- Reg := TRegistry.Create;
-
- try
- Reg.RootKey := HKEY_LOCAL_MACHINE;
- if Reg.OpenKey('\SOFTWARE\Symbian\UIQ\SDK\UIQ3SDK', False) then
- begin
- BufferStr := Reg.ReadString('InstallPath');
- vSDKFolder := IncludeTrailingBackslash(BufferStr);
- vSDKPartialFolder := Copy(vSDKFolder, 3, Length(vSDKFolder) - 2);
- end
- else
- begin
- WriteLn(' ERROR: Could not locate the SDK, using default values');
- vSDKPartialFolder := '\Symbian\UIQ3SDK\';
- vSDKFolder := 'C:' + vSDKPartialFolder;
- end;
- finally
- Reg.Free;
- end;
- end;
- constructor TSDKUtil.Create;
- begin
- LocateSDK;
- end;
- end.
|