Skip to content

Commit 6aa0d42

Browse files
author
Carlo Barazzetta
committed
27 Feb 2025: version 1.1.0
- Added support to build design-time 64bit Packages for Delphi 12.3 - Added support for Delphi 12.3
1 parent 2f42a04 commit 6aa0d42

File tree

12 files changed

+185
-90
lines changed

12 files changed

+185
-90
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# InnoSetup Builder Scripts for Embarcadero RAD Studio<sup>©</sup>
1+
# InnoSetup Scripts for Embarcadero RAD Studio<sup>©</sup> Components Installer
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44

55
## A collection of InnoSetup Scripts to build a RAD Studio Setup for Delphi Packages of Components and Libraries of any types.
66

7-
### Actual official version 1.0.0
7+
### Actual official version 1.1.0
88

99
Copyright <sup>©</sup> 2024-2025 Ethea S.r.l.
10-
Original Code is Copyright <sup>©</sup> 2021-2024 Skia4Delphi Project.
10+
Original Code is Copyright <sup>©</sup> 2021-2025 Skia4Delphi Project.
1111
Use of this source code is governed by the MIT license.
1212

1313
## Scope of this Scripts collection
@@ -105,7 +105,7 @@ This is an example of the "Build Groups Panel":
105105

106106
Check in your .dproj xml file, if contains the correct "ProjectVersion" number, because the scripts use it to known the correct Delphi Version.
107107

108-
for Example, for Delphi 12.2 ProjectVersion must be 20.2:
108+
for Example, for Delphi 12.3 ProjectVersion must be 20.3:
109109

110110
```xml
111111
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
@@ -129,7 +129,7 @@ Use this table for the correct "ProjectVersion" of every Delphi versions:
129129
| RAD Studio 10.3 Rio | 18.5 | 18.8 | 260 |
130130
| RAD Studio 10.4 Sydney | 19.0 | 19.2 | 270 or $(Auto) |
131131
| RAD Studio 11 Alexandria | 19.3 | 19.5 | 280 or $(Auto) |
132-
| RAD Studio 12 Athens | 20.1 | 20.2 | 290 or $(Auto) |
132+
| RAD Studio 12 Athens | 20.1 | 20.3 | 290 or $(Auto) |
133133

134134
\*In case of conflict the script searches for Package Version\*\* (LibSuffix), so it is recommended to use "standard" Lib Suffix values.
135135

@@ -163,5 +163,13 @@ After the installation check your Evironment Variable in Delphi IDE and Search P
163163

164164
License [MIT-License](https://github.com/skia4delphi/skia4delphi?tab=MIT-1-ov-file)
165165

166+
### RELEASE NOTES
167+
27 Feb 2025: version 1.1.0
168+
- Added support to build design-time 64bit Packages for Delphi 12.3
169+
- Added support for Delphi 12.3
166170

171+
2 Jan 2025: version 1.0.0
172+
- Added support for bpl packages built in RAD Studio Common Bpl Folders
173+
- Added various Styles form customization of Setup
174+
- Added Italian language translation
167175

Scripts/Setup.Preprocessor.ClearFiles.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22

33
rem #
4-
rem # Copyright (c) 2024 (Ethea S.r.l.)
4+
rem # Copyright (c) 2024-2025 (Ethea S.r.l.)
55
rem #
66
rem # Original code is Copyright (c) 2021-2024 Skia4Delphi Project.
77
rem #

Source/IO.Utils.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
{ }
77
{ InnoSetup Tools Library for Delphi Components }
88
{ }
9-
{ Copyright (c) 2024 Ethea S.r.l. }
9+
{ Copyright (c) 2024-2025 Ethea S.r.l. }
1010
{ }
11-
{ Original Code is Copyright (c) 2021-2024 Skia4Delphi Project. }
11+
{ Original Code is Copyright (c) 2021-2025 Skia4Delphi Project. }
1212
{ }
1313
{ Use of this source code is governed by the MIT license that can be }
1414
{ found in the LICENSE file. }

Source/RADStudio.Build.inc

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
{ }
77
{ InnoSetup Tools Library for Delphi Components }
88
{ }
9-
{ Copyright (c) 2024 Ethea S.r.l. }
9+
{ Copyright (c) 2024-2025 Ethea S.r.l. }
1010
{ }
11-
{ Original Code is Copyright (c) 2021-2024 Skia4Delphi Project. }
11+
{ Original Code is Copyright (c) 2021-2025 Skia4Delphi Project. }
1212
{ }
1313
{ Use of this source code is governed by the MIT license that can be }
1414
{ found in the LICENSE file. }
@@ -23,15 +23,15 @@
2323
#include ".\RADStudio.Project.inc"
2424

2525
type
26-
TBeforeProjectBuildProc = procedure(const AProject: TRADStudioProject; const APlatform: TProjectPlatform; const AInfo: TRADStudioInfo);
26+
TBeforeProjectBuildFunc = function(const AProject: TRADStudioProject; const APlatform: TProjectPlatform; const AInfo: TRADStudioInfo): Boolean;
2727
TTryExtractPreBuildObjectsProc = function(const AInfo: TRADStudioInfo): Boolean;
2828

2929
/// <summary> Get platforms that are allowed to build in specific platform. Current, allowed only windows platforms to avoid problems with sdk. </summary>
3030
function GetPlatformsAllowedToBuild(const ARADStudioInfo: TRADStudioInfo): TProjectPlatforms; forward;
3131
/// <summary> Get steps of TryBuildRADStudioPackages used in WizardForm.ProgressGauge.Position. Use this to set WizardForm.ProgressGauge.Max before call the TryBuildRADStudioPackages. </summary>
3232
function GetTryBuildRADStudioPackagesSteps(const ARADStudioInfos: TRADStudioInfos; const AGroupProjects: TRADStudioGroupProjects): Integer; forward;
3333
/// <summary> Try to build RAD Studio packages, but only in allowed platforms. </summary>
34-
function TryBuildRADStudioPackages(const ARADStudioInfos: TRADStudioInfos; const AGroupProjects: TRADStudioGroupProjects; const ACustomParameter: string; const ABeforeProjectBuild: TBeforeProjectBuildProc; const ATryExtractPreBuildObjects: TTryExtractPreBuildObjectsProc): Boolean; forward;
34+
function TryBuildRADStudioPackages(const ARADStudioInfos: TRADStudioInfos; const AGroupProjects: TRADStudioGroupProjects; const ACustomParameter: string; const ABeforeProjectBuild: TBeforeProjectBuildFunc; const ATryExtractPreBuildObjects: TTryExtractPreBuildObjectsProc): Boolean; forward;
3535

3636
// implementation
3737

@@ -45,7 +45,7 @@ const
4545
/// <summary> Get the MSBuild parameters. The custom parameter is optionally. </summary>
4646
function _GetMSBuildParams(const AConfig: TProjectConfig; const APlatform: TProjectPlatform; const ACustomParameter: string): string; forward;
4747
/// <summary> Try to get the comand to build a project. The custom parameter is optionally. </summary>
48-
function _TryBuildRADStudioProject(const ARADStudioInfo: TRADStudioInfo; const AConfig: TProjectConfig; const APlatform: TProjectPlatform; const AProject: TRADStudioProject; const ACustomParameter, ALogFileName: string; const ABeforeProjectBuild: TBeforeProjectBuildProc; out AResultCode: Integer): Boolean; forward;
48+
function _TryBuildRADStudioProject(const ARADStudioInfo: TRADStudioInfo; const AConfig: TProjectConfig; const APlatform: TProjectPlatform; const AProject: TRADStudioProject; const ACustomParameter, ALogFileName: string; const ABeforeProjectBuild: TBeforeProjectBuildFunc; out AResultCode: Integer): Boolean; forward;
4949
/// <summary> Try to get the comand to build a project. The custom parameter is optionally. </summary>
5050
function _TryGetBuildCommand(const ARADStudioInfo: TRADStudioInfo; const AConfig: TProjectConfig; const APlatform: TProjectPlatform; const AProjectFileName, ACustomParameter, ALogFileName: string; out ACommand: string): Boolean; forward;
5151

@@ -93,7 +93,7 @@ begin
9393
end;
9494

9595
function TryBuildRADStudioPackages(const ARADStudioInfos: TRADStudioInfos; const AGroupProjects: TRADStudioGroupProjects; const ACustomParameter: string;
96-
const ABeforeProjectBuild: TBeforeProjectBuildProc; const ATryExtractPreBuildObjects: TTryExtractPreBuildObjectsProc): Boolean;
96+
const ABeforeProjectBuild: TBeforeProjectBuildFunc; const ATryExtractPreBuildObjects: TTryExtractPreBuildObjectsProc): Boolean;
9797
var
9898
I, J, K: Integer;
9999
LInfo: TRADStudioInfo;
@@ -153,25 +153,39 @@ begin
153153
end;
154154

155155
function _TryBuildRADStudioProject(const ARADStudioInfo: TRADStudioInfo; const AConfig: TProjectConfig; const APlatform: TProjectPlatform;
156-
const AProject: TRADStudioProject; const ACustomParameter, ALogFileName: string; const ABeforeProjectBuild: TBeforeProjectBuildProc; out AResultCode: Integer): Boolean;
156+
const AProject: TRADStudioProject; const ACustomParameter, ALogFileName: string; const ABeforeProjectBuild: TBeforeProjectBuildFunc; out AResultCode: Integer): Boolean;
157157
var
158-
LProjectDir: string;
158+
LProjectDir, LVersion: string;
159159
LCommand: string;
160+
LBuild: Boolean;
160161
begin
161162
DeleteFile(ALogFileName);
162163
Result := _TryGetBuildCommand(ARADStudioInfo, AConfig, APlatform, AProject.FileName, ACustomParameter, ALogFileName, LCommand);
163164
if Result then
164165
begin
165166
AResultCode := 0;
166167
LProjectDir := ExtractFilePath(AProject.FileName);
168+
LBuild := True;
167169
if ABeforeProjectBuild <> nil then
168-
ABeforeProjectBuild(AProject, APlatform, ARADStudioInfo);
169-
Result := Exec(ExpandConstant('{cmd}'), '/C ' + LCommand, LProjectDir, SW_HIDE, ewWaitUntilTerminated, AResultCode) and (AResultCode = 0);
170-
end;
171-
if Result then
172-
DeleteFile(ALogFileName)
173-
else
174-
Log(Format('RADStudio.Build._TryBuildRADStudioProject: Failed executing command "%s"', [LCommand]));
170+
LBuild := ABeforeProjectBuild(AProject, APlatform, ARADStudioInfo);
171+
if LBuild then
172+
begin
173+
Result := Exec(ExpandConstant('{cmd}'), '/C ' + LCommand, LProjectDir, SW_HIDE, ewWaitUntilTerminated, AResultCode) and (AResultCode = 0)
174+
if Result then
175+
DeleteFile(ALogFileName)
176+
else
177+
begin
178+
LVersion := ARADStudioInfo.Version.RegVersion;
179+
//Check if we are building a 64Bit Design-Time Package: do not stop process, for backward compatibility with Delphi 12.2
180+
if (APlatform = pfWin64) and AProject.IsDesignOnly and (LVersion = '23.0') then
181+
Result := True
182+
else
183+
Log(Format('RADStudio.Build._TryBuildRADStudioProject: Failed executing command "%s"', [LCommand]));
184+
end;
185+
end
186+
else
187+
Log(Format('RADStudio.Build._TryBuildRADStudioProject: Skipped Build of Package "%s"', [AProject.FileName]));
188+
end;
175189
end;
176190

177191
function _TryGetBuildCommand(const ARADStudioInfo: TRADStudioInfo; const AConfig: TProjectConfig; const APlatform: TProjectPlatform; const AProjectFileName, ACustomParameter, ALogFileName: string; out ACommand: string): Boolean;

Source/RADStudio.Project.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
{ }
77
{ InnoSetup Tools Library for Delphi Components }
88
{ }
9-
{ Copyright (c) 2024 Ethea S.r.l. }
9+
{ Copyright (c) 2024-2025 Ethea S.r.l. }
1010
{ }
11-
{ Original Code is Copyright (c) 2021-2024 Skia4Delphi Project. }
11+
{ Original Code is Copyright (c) 2021-2025 Skia4Delphi Project. }
1212
{ }
1313
{ Use of this source code is governed by the MIT license that can be }
1414
{ found in the LICENSE file. }

Source/RADStudio.inc

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
{ }
77
{ InnoSetup Tools Library for Delphi Components }
88
{ }
9-
{ Copyright (c) 2024 Ethea S.r.l. }
9+
{ Copyright (c) 2024-2025 Ethea S.r.l. }
1010
{ }
11-
{ Original Code is Copyright (c) 2021-2024 Skia4Delphi Project. }
11+
{ Original Code is Copyright (c) 2021-2025 Skia4Delphi Project. }
1212
{ }
1313
{ Use of this source code is governed by the MIT license that can be }
1414
{ found in the LICENSE file. }
@@ -95,8 +95,10 @@ function TryGetRADStudioRSVarsBatchFileName(const ARADStudioInfo: TRADStudioInfo
9595
function TryGetRADStudioVersionByRegVersion(const ARegVersion: string; out ARADStudioVersion: TRADStudioVersion): Boolean; forward;
9696
/// <summary> Try to get the RAD Studio version of a project </summary>
9797
function TryGetRADStudioVersionOfProject(const AProject: TRADStudioProject; out ARADStudioVersion: TRADStudioVersion): Boolean; forward;
98+
/// <summary> Calculate Registry Node Name for KnownPackages</summary>
99+
function GetKnownPackagesNodeName(const APlatform: TProjectPlatform): string; forward;
98100
/// <summary> Try to register a Bpl in RAD Studio </summary>
99-
function TryRegisterRADStudioBpl(const ARADStudioVersion: TRADStudioVersion; const ABplFileName, ADescription: string): Boolean; forward;
101+
function TryRegisterRADStudioBpl(const ARADStudioVersion: TRADStudioVersion; const APlatform: TProjectPlatform; const ABplFileName, ADescription: string): Boolean; forward;
100102
/// <summary> Try to remove a library instaled using the GetIt </summary>
101103
function TryRemoveFromGetIt(const AInfos: TRADStudioInfos; const ALibraryName: string): Boolean; forward;
102104
/// <summary> Try to remove an environment variable exclusive of RAD Studio application </summary>
@@ -110,7 +112,7 @@ function TryRemoveRADStudioLibrarySearchPath(const ARADStudioVersion: TRADStudio
110112
/// <summary> Try to remove a path to the PATH environment variable exclusive of RAD Studio application </summary>
111113
function TryRemoveRADStudioPathEnvVariable(const ARADStudioVersion: TRADStudioVersion; const APath: string): Boolean; forward;
112114
/// <summary> Try to unregister a Bpl in RAD Studio </summary>
113-
function TryUnregisterRADStudioBpl(const ARADStudioVersion: TRADStudioVersion; const ABplFileName: string): Boolean; forward;
115+
function TryUnregisterRADStudioBpl(const ARADStudioVersion: TRADStudioVersion; const APlatform: TProjectPlatform; const ABplFileName: string): Boolean; forward;
114116

115117
// implementation
116118

@@ -496,7 +498,7 @@ begin
496498
_FRADStudioVersions[GetArrayLength(_FRADStudioVersions) - 1] := LRADStudioVersion;
497499

498500
// RAD Studio 10.0 Seattle
499-
LRADStudioVersion.Name := 'RAD Studio 10.0 Seattle';
501+
LRADStudioVersion.Name := 'RAD Studio 10 Seattle';
500502
LRADStudioVersion.RegVersion := '17.0';
501503
LRADStudioVersion.SupportedPlatformsDelphi := [pfWin32, pfWin64, pfAndroid, pfiOSDevice32, pfiOSDevice64, pfiOSSimulator, pfOSX32];
502504
LRADStudioVersion.SupportedPlatforms := LRADStudioVersion.SupportedPlatformsDelphi;
@@ -602,7 +604,7 @@ begin
602604
LRADStudioVersion.RegVersion := '23.0';
603605
LRADStudioVersion.SupportedPlatformsDelphi := [pfWin32, pfWin64, pfAndroid, pfAndroid64, pfiOSDevice64, pfiOSSimARM64, pfiOSSimulator, pfOSX64, pfOSXARM64, pfLinux64];
604606
LRADStudioVersion.SupportedPlatforms := LRADStudioVersion.SupportedPlatformsDelphi;
605-
LRADStudioVersion.MaxDprojVersion := '20.2';
607+
LRADStudioVersion.MaxDprojVersion := '20.3';
606608
LRADStudioVersion.MinDprojVersion := '20.1';
607609
LRADStudioVersion.PackageVersion := '290';
608610
LRADStudioVersion.OldLibSuffix := 'D12';
@@ -951,10 +953,21 @@ begin
951953
Log(Format('RADStudio.TryGetRADStudioVersionOfProject: Failed to get the RAD Studio version of the project "%s" with project version "%s".', [AProject.FileName, AProject.ProjectVersion]));
952954
end;
953955

954-
function TryRegisterRADStudioBpl(const ARADStudioVersion: TRADStudioVersion; const ABplFileName, ADescription: string): Boolean;
956+
function GetKnownPackagesNodeName(const APlatform: TProjectPlatform): String;
955957
begin
956-
Result := TryUnregisterRADStudioBpl(ARADStudioVersion, ABplFileName) and
957-
RegWriteStringValue(HKEY_CURRENT_USER, GetRADStudioRegKey(ARADStudioVersion) + '\Known Packages', ABplFileName, ADescription);
958+
if APlatform = pfWin64 then
959+
Result := '\Known Packages x64'
960+
else
961+
Result := '\Known Packages';
962+
end;
963+
964+
function TryRegisterRADStudioBpl(const ARADStudioVersion: TRADStudioVersion; const APlatform: TProjectPlatform; const ABplFileName, ADescription: string): Boolean;
965+
var
966+
LNode: string;
967+
begin
968+
LNode := GetKnownPackagesNodeName(APlatform);
969+
Result := TryUnregisterRADStudioBpl(ARADStudioVersion, APlatform, ABplFileName) and
970+
RegWriteStringValue(HKEY_CURRENT_USER, GetRADStudioRegKey(ARADStudioVersion) + LNode, ABplFileName, ADescription);
958971
if not Result then
959972
Log(Format('RADStudio.TryRegisterRADStudioBpl: Failed to register the RAD Studio bpl "%s".', [ABplFileName]));
960973
end;
@@ -1111,30 +1124,33 @@ begin
11111124
end;
11121125
end;
11131126

1114-
function TryUnregisterRADStudioBpl(const ARADStudioVersion: TRADStudioVersion; const ABplFileName: string): Boolean;
1127+
function TryUnregisterRADStudioBpl(const ARADStudioVersion: TRADStudioVersion; const APlatform: TProjectPlatform; const ABplFileName: string): Boolean;
11151128
var
11161129
LRegisteredBpls: TArrayOfString;
11171130
LBplName: string;
11181131
I: Integer;
1132+
var
1133+
LNode: string;
11191134
begin
1120-
Result := RegGetValueNames(HKEY_CURRENT_USER, GetRADStudioRegKey(ARADStudioVersion) + '\Known Packages', LRegisteredBpls);
1135+
LNode := GetKnownPackagesNodeName(APlatform);
1136+
Result := RegGetValueNames(HKEY_CURRENT_USER, GetRADStudioRegKey(ARADStudioVersion) + LNode, LRegisteredBpls);
11211137
if Result then
11221138
begin
11231139
LBplName := ExtractFileName(ABplFileName);
11241140
for I := 0 to GetArrayLength(LRegisteredBpls) - 1 do
11251141
begin
11261142
if SameText(LBplName, ExtractFileName(LRegisteredBpls[I])) then
11271143
begin
1128-
if not RegDeleteValue(HKEY_CURRENT_USER, GetRADStudioRegKey(ARADStudioVersion) + '\Known Packages', LRegisteredBpls[I]) then
1144+
if not RegDeleteValue(HKEY_CURRENT_USER, GetRADStudioRegKey(ARADStudioVersion) + LNode, LRegisteredBpls[I]) then
11291145
begin
11301146
Result := False;
1131-
Log(Format('RADStudio.TryUnregisterRADStudioBpl: Failed to unregister the bpl "%s". Cannot possible to delete the value "%s" from registry "%s"', [ABplFileName, LRegisteredBpls[I], 'HKEY_CURRENT_USER' + GetRADStudioRegKey(ARADStudioVersion) + '\Known Packages']));
1147+
Log(Format('RADStudio.TryUnregisterRADStudioBpl: Failed to unregister the bpl "%s". Cannot delete the value "%s" from registry "%s"', [ABplFileName, LRegisteredBpls[I], 'HKEY_CURRENT_USER' + GetRADStudioRegKey(ARADStudioVersion) + LNode]));
11321148
end;
11331149
end;
11341150
end;
11351151
end
11361152
else
1137-
Log(Format('RADStudio.TryUnregisterRADStudioBpl: Failed to unregister the bpl "%s". Cannot possible to get the list of Known Packages from registry "%s"', [ABplFileName, 'HKEY_CURRENT_USER' + GetRADStudioRegKey(ARADStudioVersion) + '\Known Packages']));
1153+
Log(Format('RADStudio.TryUnregisterRADStudioBpl: Failed to unregister the bpl "%s". Cannot possible to get the list of Known Packages from registry "%s"', [ABplFileName, 'HKEY_CURRENT_USER' + GetRADStudioRegKey(ARADStudioVersion) + LNode]));
11381154
Result := _TryRemoveRADStudioBplFromDisabledPackages(ARADStudioVersion, ABplFileName) and Result;
11391155
end;
11401156

0 commit comments

Comments
 (0)