function GetRoot: string;
var
Buf: array [1..256] of Char;
iLen, iPos: Integer;
s: string;
begin
iLen := GetModuleFileName(HINSTANCE, @Buf, SizeOf(Buf));
s := ExtractFilePath(Copy(string(Buf), 1, iLen));
if Copy(s, Length(s), 1) = '/' then
s := Copy(s, 1, Length(s) - 1);
iPos := LastPos('/', s);
Result := Copy(s, 1, iPos);
if Copy(Result, 1, 4) = '//?/' then
Result := Copy(Result, 5, MaxInt);
end;