Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions jcl/source/common/JclIDEUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,9 @@ TJclBorRADToolInstallation = class(TObject)
function GetMake: IJclCommandLineTool;
function GetDescription: string;
function GetEditionAsText: string;
function GetIdeExeFileName: string;
function GetIdeExeFileName(x64: Boolean): string;
function GetGlobals: TStrings;
function GetIdeExeBuildNumber: string;
function GetIdeExeBuildNumber(x64: Boolean): string;
function GetIdePackages: TJclBorRADToolIdePackages;
function GetIsTurboExplorer: Boolean;
function GetLatestUpdatePack: Integer;
Expand Down Expand Up @@ -561,8 +561,8 @@ TJclBorRADToolInstallation = class(TObject)
property EnvironmentVariables: TStrings read GetEnvironmentVariables;
property IdePackages: TJclBorRADToolIdePackages read GetIdePackages;
property IdeTools: TJclBorRADToolIdeTool read FIdeTools;
property IdeExeBuildNumber: string read GetIdeExeBuildNumber;
property IdeExeFileName: string read GetIdeExeFileName;
property IdeExeBuildNumber[x64: Boolean]: string read GetIdeExeBuildNumber;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that the Exe file will be different depending on the platform, but I don't expect the version info inside it to be different.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A large number of properties and methods related to the 64-bit IDE in JclIDEUtils use the parameter form x64: Boolean, which can maintain consistency. The getter of this property also simply retrieves the file version information of IdeExeFileName[x64: Boolean].
Additionally, some of Embarcadero's newer features now only support the 64-bit IDE, and it is entirely possible that the 32-bit IDE will be deprecated or made an optional installation in the future.

property IdeExeFileName[x64: Boolean]: string read GetIdeExeFileName;
property InstalledUpdatePack: Integer read FInstalledUpdatePack;
property LatestUpdatePack: Integer read GetLatestUpdatePack;
property LibrarySearchPath[APlatform: TJclBDSPlatform]: TJclBorRADToolPath read GetLibrarySearchPath {$IFDEF KEEP_DEPRECATED}write SetRawLibrarySearchPath{$ENDIF};
Expand Down Expand Up @@ -1633,7 +1633,7 @@ procedure TJclBorRADToolIdePackages.ReadPackages;
if FDisabledPackages32.IndexOfName(FKnownPackages32.Names[I]) <> -1 then
FKnownPackages32.Objects[I] := Pointer(True);

if Installation.IDEVersionNumber >= 23 then
if FileExists(Installation.IdeExeFileName[True]) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The x64 IDE could be unselected during installation but registry entries be there, so I believe this test should not be changed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 64-bit IDE was introduced in version 12.3, but the test IDEVersionNumber >= 23 covers the entire version 12 series, so this test is inaccurate.
Checking whether the file bin64\bds.exe exists works correctly regardless of whether the 64-bit IDE is installed or whether the registry key value exists.

begin
ReadPackageList(GetKnownIDEPackagesKeyName(True), FKnownIDEPackages64);
ReadPackageList(GetKnownPackagesKeyName(True), FKnownPackages64);
Expand Down Expand Up @@ -2139,7 +2139,7 @@ function TJclBorRADToolInstallation.AnyInstanceRunning: Boolean;
if RunningProcessesList(Processes) then
begin
for I := 0 to Processes.Count - 1 do
if AnsiSameText(IdeExeFileName, Processes[I]) then
if StrIsOneOf(Processes[I], [IdeExeFileName[False], IdeExeFileName[True]]) then
begin
Result := True;
Break;
Expand Down Expand Up @@ -2542,14 +2542,14 @@ function TJclBorRADToolInstallation.GetGlobals: TStrings;
Result := FGlobals;
end;

function TJclBorRADToolInstallation.GetIdeExeFileName: string;
function TJclBorRADToolInstallation.GetIdeExeFileName(x64: Boolean): string;
begin
Result := Globals.Values['App'];
Result := Globals.Values[Iff(x64, 'App x64', 'App')];
end;

function TJclBorRADToolInstallation.GetIdeExeBuildNumber: string;
function TJclBorRADToolInstallation.GetIdeExeBuildNumber(x64: Boolean): string;
begin
Result := VersionFixedFileInfoString(IdeExeFileName, vfFull);
Result := VersionFixedFileInfoString(IdeExeFileName[x64], vfFull);
end;

function TJclBorRADToolInstallation.GetIdePackages: TJclBorRADToolIdePackages;
Expand Down Expand Up @@ -2716,7 +2716,8 @@ function TJclBorRADToolInstallation.GetUpdateNeeded: Boolean;

function TJclBorRADToolInstallation.GetValid: Boolean;
begin
Result := (ConfigData.FileName <> '') and (RootDir <> '') and FileExists(IdeExeFileName);
Result := (ConfigData.FileName <> '') and (RootDir <> '') and
(FileExists(IdeExeFileName[False]) or FileExists(IdeExeFileName[True]));
end;

function TJclBorRADToolInstallation.GetVclIncludeDir(APlatform: TJclBDSPlatform): string;
Expand Down