Skip to content

Commit

Permalink
- Added GIT installation checking
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverpointDev committed Sep 18, 2023
1 parent f8280bd commit 078e742
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 37 deletions.
31 changes: 14 additions & 17 deletions Readme.txt → Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
Silverpoint MultiInstaller
==========================

# Silverpoint MultiInstaller

Silverpoint MultiInstaller is a multi component package installer for Embarcadero Delphi and C++Builder.
It was created to ease the components installation on the IDE.
Expand All @@ -10,12 +8,11 @@ Just download the zips and select the destination folder, all the components wil
It can also install multiple packages directly from GIT repositories.


For more info go to:
http://www.silverpointdevelopment.com
For more info go to:
www.silverpointdevelopment.com


License
-------
## License

The contents of this package are licensed under a disjunctive tri-license giving you the choice of one of the three following sets of free software/open source licensing terms:

Expand All @@ -31,15 +28,13 @@ Software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, eithe
The initial developer of this package is Robert Lee.


Installation
------------
## Installation

Requirements:
- RAD Studio XE or newer


Getting Started
---------------
## Getting Started

To install a component pack with MultiInstaller you have to follow these steps:
1) Read the licenses of the component packs you want to install.
Expand All @@ -55,12 +50,14 @@ For example, if you want to install TB2K + SpTBXLib:

The installation folder will end up with this files:

C:\MyInstall
|- SpTBXLib.zip
|- tb2k-2.2.2.zip
|- TB2Kpatch-1.1.zip
|- MultiInstaller.exe
|- Setup.ini
```
C:\MyInstall
|- SpTBXLib.zip
|- tb2k-2.2.2.zip
|- TB2Kpatch-1.1.zip
|- MultiInstaller.exe
|- Setup.ini
```

You are ready to install the component packages, just run the MultiInstaller, select the destination folder, and all the components will be unziped, patched, compiled and installed on the Delphi IDE.

61 changes: 49 additions & 12 deletions Source/MultiInstaller.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<PropertyGroup>
<ProjectGuid>{EBF09947-4C9C-4019-AB2C-5AC10A4CEF07}</ProjectGuid>
<MainSource>MultiInstaller.dpr</MainSource>
<Config Condition="'$(Config)'==''">Release</Config>
<Config Condition="'$(Config)'==''">Debug</Config>
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
<ProjectVersion>19.0</ProjectVersion>
<ProjectVersion>19.5</ProjectVersion>
<Base>True</Base>
<AppType>Application</AppType>
<FrameworkType>VCL</FrameworkType>
Expand All @@ -19,6 +19,11 @@
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
Expand All @@ -30,6 +35,12 @@
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''">
<Cfg_1_Win64>true</Cfg_1_Win64>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
Expand All @@ -41,6 +52,12 @@
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''">
<Cfg_2_Win64>true</Cfg_2_Win64>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<SanitizedProjectName>MultiInstaller</SanitizedProjectName>
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
Expand All @@ -49,6 +66,9 @@
<DCC_DependencyCheckOutputName>MultiInstaller.exe</DCC_DependencyCheckOutputName>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_Platform>x86</DCC_Platform>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
Expand All @@ -62,6 +82,14 @@
<DCC_ExeOutput>..\Bin</DCC_ExeOutput>
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
Expand All @@ -74,15 +102,25 @@
<VerInfo_Locale>1033</VerInfo_Locale>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<BT_BuildType>Debug</BT_BuildType>
<AppDPIAwarenessMode>PerMonitor</AppDPIAwarenessMode>
<DCC_IntegerOverflowCheck>true</DCC_IntegerOverflowCheck>
<DCC_RangeChecking>true</DCC_RangeChecking>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<Icon_MainIcon>MultiInstaller_Icon.ico</Icon_MainIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
Expand All @@ -91,17 +129,17 @@
<DCCReference Include="unit1.pas">
<Form>Form1</Form>
</DCCReference>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
<ProjectExtensions>
Expand Down Expand Up @@ -141,14 +179,13 @@
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k250.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp250.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k250.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp250.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k280.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp280.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
<ModelSupport>False</ModelSupport>
</BorlandProject>
Expand Down
23 changes: 22 additions & 1 deletion Source/SpComponentInstaller.pas
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ interface
SLogNotAGit = 'Error: %s is not a Git repository.';
SLogNotInstallable = '%s is not installable. Proceeding without unzipping/cloning';
SLogCorruptedZip = 'Error: %s is corrupted.';
SLogGitCloneFailed = 'Error: in git clone %s';
SLogGitCloneFailed = 'Error: in Git clone %s';
SLogGitNotInstalled = 'Error: Git not installed';

SLogErrorCopying = 'Error copying %s to %s';
SLogErrorDeleting = 'Error deleting %s';
Expand All @@ -79,6 +80,7 @@ interface
SLogFinished = 'All the component packages have been successfully installed.' + #13#10 + 'Elapsed time: %f secs.';

SGitCloneCommand = 'GIT.EXE clone --verbose --progress %s %s';
SGitIsInstalledCommand = 'GIT.EXE --version';

type
TSpIDEType = ( // [IDE-Change-Update]
Expand Down Expand Up @@ -270,6 +272,7 @@ function SpExtractZip(ZipFilename, DestinationPath: string): Boolean;

{ Git }
function SpGitClone(AGit, DestinationPath: string; Log: TStrings): Boolean;
function SpIsGitInstalled(Log: TStrings): Boolean;

{ Ini and Registry }
function SpReadRegValue(Key, Name: string; out Value: string): Boolean;
Expand Down Expand Up @@ -537,6 +540,15 @@ function SpGitClone(AGit, DestinationPath: string; Log: TStrings): Boolean;
Log.Text := Log.Text + DosOutput + #13#10;
end;

function SpIsGitInstalled(Log: TStrings): Boolean;
var
DosOutput: string;
begin
Result := SpExecuteDosCommand(SGitIsInstalledCommand, '', DosOutput) = 0;
if Assigned(Log) then
Log.Text := Log.Text + DosOutput + #13#10;
end;

//WMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWM
{ Ini and Registry }

Expand Down Expand Up @@ -1357,9 +1369,11 @@ procedure TSpComponentPackageList.LoadFromIni(Filename: string);
function TSpComponentPackageList.ExtractAllZips(Source, Destination: string;
Log: TStrings): Boolean;
var
GitChecked: Boolean;
I: integer;
Item: TSpComponentPackage;
begin
GitChecked := False;
Result := False;
SpWriteLog(Log, SLogStartUnzip, '');

Expand Down Expand Up @@ -1404,6 +1418,13 @@ function TSpComponentPackageList.ExtractAllZips(Source, Destination: string;
end
else
if Item.Git <> '' then begin
if not GitChecked then begin
GitChecked := True;
if not SpIsGitInstalled(Log) then begin
SpWriteLog(Log, SLogGitCloneFailed, '');
Exit;
end;
end;
SpWriteLog(Log, SLogGitCloning, Item.Git, Item.Destination);
if not SpGitClone(Item.Git, Item.Destination, Log) then begin
SpWriteLog(Log, SLogGitCloneFailed, Item.Git);
Expand Down
9 changes: 7 additions & 2 deletions Source/unit1.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ object Form1: TForm1
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object PageControl1: TPageControl
Left = 0
Expand All @@ -26,6 +25,8 @@ object Form1: TForm1
Align = alClient
Style = tsFlatButtons
TabOrder = 0
ExplicitWidth = 491
ExplicitHeight = 264
object TabSheet1: TTabSheet
Caption = 'TabSheet1'
TabVisible = False
Expand Down Expand Up @@ -148,6 +149,8 @@ object Form1: TForm1
ParentBackground = False
ParentColor = True
TabOrder = 1
ExplicitTop = 324
ExplicitWidth = 491
DesignSize = (
495
53)
Expand Down Expand Up @@ -183,13 +186,14 @@ object Form1: TForm1
TabOrder = 3
end
object ButtonNext: TButton
Left = 315
Left = 311
Top = 18
Width = 75
Height = 25
Action = aNext
Anchors = [akRight, akBottom]
TabOrder = 0
ExplicitLeft = 307
end
object ButtonBack: TButton
Left = 235
Expand Down Expand Up @@ -219,6 +223,7 @@ object Form1: TForm1
Color = clWhite
ParentBackground = False
TabOrder = 2
ExplicitWidth = 491
object LabelTitle: TLabel
Left = 8
Top = 15
Expand Down
6 changes: 1 addition & 5 deletions Source/unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface
IniFiles, Actions, SpComponentInstaller;

const
rvMultiInstallerVersion = 'Silverpoint MultiInstaller 3.5.8';
rvMultiInstallerVersion = 'Silverpoint MultiInstaller 3.5.9';
rvMultiInstallerLink = 'http://www.silverpointdevelopment.com';

resourcestring
Expand All @@ -27,10 +27,6 @@ interface
SErrorLabel = 'There were errors found in the setup, check the log.';
SErrorInvalidBasePath = 'The directory doesn''t exist.';

SErrorDetectingBDSPROJECTSDIR = 'Silverpoint MultiInstaller couldn''t detect the $(BDSPROJECTSDIR) directory.' + #13#10 +
'You are probably using the Japanese version of Delphi 2009.' + #13#10 +
'Please, send a bug report to the author: ' + rvMultiInstallerLink;

type
TForm1 = class(TForm)
PageControl1: TPageControl;
Expand Down

0 comments on commit 078e742

Please sign in to comment.