Menu

#97 Setup doesn't work on Windows

open
nobody
None
5
2001-12-20
2001-12-20
Mr. Screeny
No

Hi!
The windows setup program doesn't work on
International systems (Hungarian), because of an
StrToFloat version number conver error. I corrected
the problem. Here is the solution:

procedure GetRegistryInfo;

procedure CantFindBCB;
begin
Writeln;
Writeln('Warning: C++Builder or bcc32.exe not
found. C++Builder is required');
Writeln('to build qtintf.dll.');
Write('Press <ENTER> to continue.');
Readln;
Writeln;
BCB := '';
end;

function GetLatestVersion(Reg: TRegistry): String;
var
Keys: TStringList;
I: Integer;
begin
Result := '0';
Keys := TStringList.Create;
try
Reg.GetKeyNames(Keys);
for I := 0 to Keys.Count - 1 do
if Keys[I] > Result then
Result := Keys[I];
finally
Keys.Free;
end;
end;

var
Reg: TRegistry;
Ver: string;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if PRODUCTDIR = '' then
begin
Writeln;
Writeln('Locating Delphi installation...');
if not Reg.OpenKeyReadOnly
('SOFTWARE\Borland\Delphi\') then
Bail('You don''t seem to have Delphi
installed')
else begin
// look for the correct (and latest) Delphi
Ver := GetLatestVersion(Reg);
if Ver < '6.0' then
Bail('You must have Delphi 6 or above to use
FreeCLX');
Reg.OpenKeyReadOnly(Version+'\');
DelphiVersion := Version;
PRODUCTDIR := Reg.ReadString('RootDir');
Reg.CloseKey;
if PRODUCTDIR = '' then
Bail('Could not locate Delphi '+Version+'
root directory')
else begin
Writeln('Delphi '+Version+' found
in "'+PRODUCTDIR+'"');
Writeln;
end;
Writeln('Checking dcc32...');
if not FileExists(PRODUCTDIR + '\bin\dcc32.exe')
then
Bail('dcc32.exe could not be located
in "'+PRODUCTDIR+'\bin\"')
else
Writeln('Found dcc32.exe.');
end;
//attempt to locate BCB.
end;
if BCB = '' then
begin
Writeln;
Writeln('Looking for C++ Builder...');
if Reg.OpenKeyReadOnly
('SOFTWARE\Borland\C++Builder\') then
begin
Ver := GetLatestVersion(Reg);
Reg.OpenKeyReadOnly(Version+'\');
BCB := Reg.ReadString('RootDir');
Writeln('C++Builder '+Version+' found
in '+BCB);
Writeln;
end
else
CantFindBCB;
end;
Writeln('Checking for bcc32...');
if not FileExists(BCB + '\bin\bcc32.exe') then
CantFindBCB
else begin
Writeln('Found bcc32.exe.');
Writeln;
end;
finally
Reg.Free;
end;
end;

Discussion

  • Mr. Screeny

    Mr. Screeny - 2001-12-20

    Logged In: YES
    user_id=401088

    Sorry for unreadable source code. I submit it as
    attachment. I atteched the setup.dpr. The modifications is
    in GetRegistryInfo procedure.

     
  • Mr. Screeny

    Mr. Screeny - 2001-12-20

    Modified setup.dpr

     

Log in to post a comment.