Skip to content
Open
Show file tree
Hide file tree
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
Binary file modified Bin/MultiInstaller.exe
Binary file not shown.
73 changes: 73 additions & 0 deletions Bin/Setup-Demo-NS.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
; Download MultiInstaller From https://github.com/SilverpointDev/MultiInstaller
; The package order in the Ini file IS relevant.
; Packages format:
; [Package - packagename]
; Name = description
; Git = git_to_be_cloned
; Zip = zip file
; Folder = folder name
; SearchPath = directories in the zip folder structure to be added to the search paths.
; The strings must be enclosed by double quotes and separated by comma.
; If ommited the components root folder is used.
; Examples:
; SearchPath =
; SearchPath = Source
; SearchPath = "Source1", "Source2"
; SearchPath = "", "Source1", "Source2"
; Here the empty string represents the root folder.
; Includes = includes directories
; The strings must be enclosed by double quotes and separated by comma.
; For example: "c:\include1", "c:\include2"
; Can be omitted if no include files are used by the package.
; $BaseFolder can be used to represent the components destination folder.
; D* = packages in the zip folder structure, where * represents the IDE version.
; The strings must be enclosed by double quotes and separated by comma.
; The runtime packages must be placed before the designtime packages.
; For example: "Packages\MyCompos_d10.dpk", "Packages\MyComposDesign_d10.dpk"
; FYR: https://docwiki.embarcadero.com/RADStudio/Florence/en/Compiler_Versions
; https://delphidabbler.com/notes/version-numbers
; https://github.com/omonien/Delphi-Version-Information
; Installable = 0 if the package is not installable
; 1 if the package needs to be installed
; 2 if the package is not installable but needs to add the SearchPath
; to the registry, this is useful when installing utility libraries
; that doesn't have components to install, for example GraphicEx,
; GDI+, DirectX, etc
; If omitted the default value is 1
; LibSuffix = %s
; ActualLibSuffix is assumed to be Format(LibSuffix, [DelphiIDEVersion])
; Useful when LibSuffix is specified in package file using conditional directives
; GroupIndex = used to group the component packages, can be omitted
;
; ExecuteList entry format:
; ExecuteCount = number of execute entries
; Execute[index] = "Action", "Origin", "Destination"
; Commas are not optional
; Action can be "copy", "copyandrun" and "delete"
; Origin is the file or directory to copy or delete
; Destination is the destination folder
; When Action is "copyandrun" the file will be copied and run from the destination.
; $BaseFolder is the components destination folder

; Options format:
; [Options]
; MinimumIDEVersion = Minimum Delphi IDE version that is supported by the packages.
; DefaultInstallFolder = Default install folder that should be selected to install.
; DefaultInstallIDE = Default Delphi IDE version that should be selected to install.
;
; When both DefaultInstallIDE and DefaultInstallFolder are set the installer starts automatically.

[Package - TeeChart_Pro]
Name=TeeChart_Pro
Folder=TeeChart_Pro
SearchPath="Source\VCL"
NameSpaces=VclTee;FmxTee
LibSuffix=%s0
D27="Source\VCL\Tee927.dpk", "Source\VCL\TeeUI927.dpk", "Source\VCL\TeeDB927.dpk", "Source\VCL\TeePro927.dpk", "Source\VCL\TeeGL927.dpk", "Source\VCL\TeeImage927.dpk", "Source\VCL\TeeLanguage927.dpk", "Source\VCL\TeeWorld927.dpk", "Source\VCL\TeeImport927.dpk", "Source\VCL\DclTee927.dpk", "Source\VCL\DclTeePro927.dpk"
D28="Source\VCL\Tee928.dpk", "Source\VCL\TeeUI928.dpk", "Source\VCL\TeeDB928.dpk", "Source\VCL\TeePro928.dpk", "Source\VCL\TeeGL928.dpk", "Source\VCL\TeeImage928.dpk", "Source\VCL\TeeLanguage928.dpk", "Source\VCL\TeeWorld928.dpk", "Source\VCL\TeeImport928.dpk", "Source\VCL\DclTee928.dpk", "Source\VCL\DclTeePro928.dpk"
D29="Source\VCL\Tee929.dpk", "Source\VCL\TeeUI929.dpk", "Source\VCL\TeeDB929.dpk", "Source\VCL\TeePro929.dpk", "Source\VCL\TeeGL929.dpk", "Source\VCL\TeeImage929.dpk", "Source\VCL\TeeLanguage929.dpk", "Source\VCL\TeeWorld929.dpk", "Source\VCL\TeeImport929.dpk", "Source\VCL\DclTee929.dpk", "Source\VCL\DclTeePro929.dpk"
D37="Source\VCL\Tee937.dpk", "Source\VCL\TeeUI937.dpk", "Source\VCL\TeeDB937.dpk", "Source\VCL\TeePro937.dpk", "Source\VCL\TeeGL937.dpk", "Source\VCL\TeeImage937.dpk", "Source\VCL\TeeLanguage937.dpk", "Source\VCL\TeeWorld937.dpk", "Source\VCL\TeeImport937.dpk", "Source\VCL\DclTee937.dpk", "Source\VCL\DclTeePro937.dpk"


[Options]
MinimumIDEVersion=D27
2 changes: 1 addition & 1 deletion Source/MultiInstaller.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Base>True</Base>
<AppType>Application</AppType>
<Config Condition="'$(Config)'==''">Debug</Config>
<Config Condition="'$(Config)'==''">Release</Config>
<FrameworkType>VCL</FrameworkType>
<MainSource>MultiInstaller.dpr</MainSource>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
Expand Down
37 changes: 29 additions & 8 deletions Source/SpComponentInstaller.pas
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ TSpComponentPackage = class
Destination: string;
SearchPath: string;
Includes: string;
NameSpaces: string; // -NS
Installable: TSpInstallType;
LibSuffix : string;
GroupIndex: Integer;
Expand Down Expand Up @@ -321,7 +322,7 @@ function SpIDEExpandMacros(S: string; IDE: TSpIDEType;
{ Delphi Packages }
function SpGetPackageOptions(PackageFilename, LibSuffix, BPLDir: string; out RunTime, DesignTime: Boolean; out BPLFilename, Description: string): Boolean;
function SpCompilePackage(PackageFilename: string; IDE: TSpIDEType; SourcesL,
IncludesL, Log: TStrings; LibSuffix: string; TempDir: string = '';
IncludesL, NameSpacesL, Log: TStrings; LibSuffix: string; TempDir: string = '';
APlatform: TSpPlatform = pltWin32): Boolean;
function SpRegisterPackage(PackageFilename, LibSuffix, BPLDir: string; IDE:
TSpIDEType; Log: TStrings; APlatform: TSpPlatform = pltWin32): Boolean;
Expand All @@ -343,6 +344,7 @@ implementation
rvSearchPath = 'SearchPath';
rvGroupIndex = 'GroupIndex';
rvIncludes = 'Includes';
rvNameSpaces = 'NameSpaces';
rvInstallable = 'Installable';
rvLibSuffix = 'LibSuffix';
rvExecuteIniPrefix = 'Execute';
Expand Down Expand Up @@ -1218,7 +1220,7 @@ function SpIsDesignTimePackage(PackageFilename: string): Boolean;
end;

function SpCompilePackage(PackageFilename: string; IDE: TSpIDEType;
SourcesL, IncludesL, Log: TStrings; LibSuffix: string; TempDir: string =
SourcesL, IncludesL, NameSpacesL, Log: TStrings; LibSuffix: string; TempDir: string =
''; APlatform: TSpPlatform = pltWin32): Boolean;
// PackageFilename = full path of the package, e.g. 'C:\MyCompos\Compo\Packages\D7Runtime.dpk
// IDE = IDE version to compile with
Expand All @@ -1230,9 +1232,9 @@ function SpCompilePackage(PackageFilename: string; IDE: TSpIDEType;

var
CommandLine, WorkDir, BPLDir, DOSOutput, DCCConfig: string;
L: TStringList;
L, T: TStringList;
I: Integer;
DCC, S, R: string; // Auxiliary strings
DCC, S, R, S1: string; // Auxiliary strings
EmptyRes, ResFile : string;
begin
Result := False;
Expand Down Expand Up @@ -1294,8 +1296,23 @@ function SpCompilePackage(PackageFilename: string; IDE: TSpIDEType;
L.Add('-LN"' + S + '"');
// BPI Output for the compiled packages, required for C++Builder 2006 and above
L.Add('-NB"' + S + '"');

// Unit namespaces for Delphi XE2:
L.Add('-NSSystem.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi');
T:= TStringList.Create(#0,';');
try
T.DelimitedText := 'System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi';
for I := 0 to NameSpacesL.Count-1 do begin
S1 := Trim(NameSpacesL[i]);
if S1='' then Continue;
if T.IndexOf(S1) < 0 then begin
T.Add(S1);
end;
end;
L.Add('-NS' + T.DelimitedText);
finally
T.Free;
end;

// Includes, dcc32.exe accepts Includes as a semicolon separated string
// enclosed by double quotes, e.g. "C:\dir1;C:\dir2;C:\dir3"
S := '';
Expand Down Expand Up @@ -1450,6 +1467,7 @@ procedure TSpComponentPackageList.LoadFromIni(Filename: string);
if Aux > Ord(High(TSpInstallType)) then Aux := 1;
Entry.Installable := TSpInstallType(Aux);
Entry.Includes := F.ReadString(L[I], rvIncludes, '');
Entry.NameSpaces := F.ReadString(L[I], rvNameSpaces, '');

// [IDE-Change]
if Entry.Installable = sitInstallable then begin
Expand Down Expand Up @@ -1558,7 +1576,7 @@ function TSpComponentPackageList.CompileAll(BaseFolder: string; IDE: TSpIDEType;
TempDir: string;
I, J: integer;
Item: TSpComponentPackage;
SourcesL, CompileL, IncludesL: TStringList;
SourcesL, CompileL, IncludesL, NameSpacesL: TStringList;
Aux1, Aux2: string; // Auxiliary strings
LibSuffix : string;
begin
Expand All @@ -1580,6 +1598,7 @@ function TSpComponentPackageList.CompileAll(BaseFolder: string; IDE: TSpIDEType;

CompileL := TStringList.Create;
IncludesL := TStringList.Create;
NameSpacesL := TStringList.Create;
SourcesL := TStringList.Create;
try
for I := 0 to Count - 1 do begin
Expand Down Expand Up @@ -1621,6 +1640,7 @@ function TSpComponentPackageList.CompileAll(BaseFolder: string; IDE: TSpIDEType;

// Expand Includes
IncludesL.CommaText := StringReplace(Item.Includes, rvBaseFolder, ExcludeTrailingPathDelimiter(BaseFolder), [rfReplaceAll, rfIgnoreCase]);
NameSpacesL.CommaText := StringReplace(Item.NameSpaces, ';', ',', [rfReplaceAll]);

if Item.LibSuffix <> '' then
LibSuffix := Format(Item.LibSuffix, [Copy(IDETypes[IDE].IDEVersion,2,3)])
Expand All @@ -1630,7 +1650,7 @@ function TSpComponentPackageList.CompileAll(BaseFolder: string; IDE: TSpIDEType;
// Compile and Install
for J := 0 to CompileL.Count - 1 do
begin
if not SpCompilePackage(CompileL[J], IDE, SourcesL, IncludesL, Log,
if not SpCompilePackage(CompileL[J], IDE, SourcesL, IncludesL, NameSpacesL, Log,
LibSuffix, TempDir, pltWin32)
then
Exit;
Expand All @@ -1639,7 +1659,7 @@ function TSpComponentPackageList.CompileAll(BaseFolder: string; IDE: TSpIDEType;
// Starting from Delphi 13 compile also design packages
if not SpIsDesignTimePackage(CompileL[J]) or (IDE >= ideDelphiFlorence) then
begin
if not SpCompilePackage(CompileL[J], IDE, SourcesL, IncludesL, Log,
if not SpCompilePackage(CompileL[J], IDE, SourcesL, IncludesL, NameSpacesL, Log,
LibSuffix, TempDir, pltWin64)
then
Exit;
Expand All @@ -1659,6 +1679,7 @@ function TSpComponentPackageList.CompileAll(BaseFolder: string; IDE: TSpIDEType;
finally
CompileL.Free;
IncludesL.Free;
NameSpacesL.Free;
SourcesL.Free;
SpFileOperation(TempDir, '', FO_DELETE);
end;
Expand Down