From bf2d5aa1be3f6ccc7fce272f7fd20a789e5219f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Mon, 12 Apr 2021 13:04:14 -0300 Subject: [PATCH 01/28] clean component folder on GitHub update --- UCommon.pas | 2 ++ UFrm.pas | 2 +- UGitHub.pas | 36 ++++++++++++++++++++++++++++++++++-- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/UCommon.pas b/UCommon.pas index f5a9a43..d0aa93b 100644 --- a/UCommon.pas +++ b/UCommon.pas @@ -4,6 +4,8 @@ interface const BDS_KEY = 'Software\Embarcadero\BDS'; +const INI_FILE_NAME = 'CompInstall.ini'; + var AppDir: string; function HasInList(const Item, List: string): Boolean; diff --git a/UFrm.pas b/UFrm.pas index 8c52482..be16212 100644 --- a/UFrm.pas +++ b/UFrm.pas @@ -86,7 +86,7 @@ procedure TFrm.LoadDefinitions; D := TDefinitions.Create; try - D.LoadIniFile(AppDir+'CompInstall.ini'); + D.LoadIniFile(AppDir+INI_FILE_NAME); EdCompName.Text := D.CompName; EdCompVersion.Text := D.CompVersion; diff --git a/UGitHub.pas b/UGitHub.pas index 59cdf20..54190bd 100644 --- a/UGitHub.pas +++ b/UGitHub.pas @@ -24,6 +24,7 @@ TThCheck = class(TThread) procedure Check; procedure Download(const URL: string); procedure Log(const A: string; bBold: Boolean = True; Color: TColor = clBlack); + procedure CleanFolder; end; procedure TThCheck.Execute; @@ -92,8 +93,9 @@ procedure TThCheck.Check; begin Confirm := MessageDlg(Format( 'There is a new version "%s" of the component available at GitHub.'+ - ' Do you want to update it automatically?', [tag_version]), - mtInformation, mbYesNo, 0) = mrYes; + ' Do you want to update it automatically?'+#13+#13+ + 'Warning: All content in the component''s folder and subfolders will be deleted.', + [tag_version]), mtInformation, mbYesNo, 0) = mrYes; end); if Confirm then @@ -109,6 +111,9 @@ procedure TThCheck.Download(const URL: string); Z: TZipFile; ZPath, ZFile, ZFileNormalized: string; begin + Log('Cleaning component folder...'); + CleanFolder; + Log('Downloading new version...'); TmpFile := TPath.GetTempFileName; @@ -152,6 +157,33 @@ procedure TThCheck.Download(const URL: string); Log('Update complete!', True, clGreen); end; +procedure TThCheck.CleanFolder; +var + Path, FileName: string; +begin + for Path in TDirectory.GetFiles(AppDir) do + begin + FileName := ExtractFileName(Path); + if SameText(FileName, ExtractFileName(ParamStr(0))) or + SameText(FileName, INI_FILE_NAME) then Continue; + + try + TFile.Delete(Path); + except + raise Exception.CreateFmt('Could not delete file %s', [Path]); + end; + end; + + for Path in TDirectory.GetDirectories(AppDir) do + begin + try + TDirectory.Delete(Path, True); + except + raise Exception.CreateFmt('Could not delete folder %s', [Path]); + end; + end; +end; + procedure CheckGitHubUpdate(const Repository, CurrentVersion: string); var C: TThCheck; From 7ab0ebd8126b844047cacf3d34fa0f017f7e1c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Wed, 24 Jan 2024 18:20:15 -0300 Subject: [PATCH 02/28] new output path --- UDefinitions.pas | 2 ++ UDelphiVersionCombo.pas | 1 + UFrm.dfm | 5 +---- UProcess.pas | 24 ++++++++++++++++++------ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/UDefinitions.pas b/UDefinitions.pas index d88d67e..b57849e 100644 --- a/UDefinitions.pas +++ b/UDefinitions.pas @@ -23,6 +23,7 @@ TDefinitions = class CompVersion: string; DelphiVersions: string; AddLibrary: Boolean; + OutputPath: string; Packages: TPackages; GitHubRepository: string; @@ -69,6 +70,7 @@ procedure TDefinitions.LoadIniFile(const aFile: string); raise Exception.Create('No Delphi version specifyed at ini file'); AddLibrary := Ini.ReadBool('General', 'AddLibrary', False); + OutputPath := Ini.ReadString('General', 'OutputPath', ''); S := TStringList.Create; try diff --git a/UDelphiVersionCombo.pas b/UDelphiVersionCombo.pas index e209703..50b319d 100644 --- a/UDelphiVersionCombo.pas +++ b/UDelphiVersionCombo.pas @@ -65,6 +65,7 @@ class procedure TDelphiVersionComboLoader.Load(Combo: TComboBox; Add('20.0', '10.3', 'Delphi 10.3 Rio'); Add('21.0', '10.4', 'Delphi 10.4 Sydney'); Add('22.0', '11', 'Delphi 11 Alexandria'); + Add('23.0', '12', 'Delphi 12 Athens'); end; finally R.Free; diff --git a/UFrm.dfm b/UFrm.dfm index 45c053c..646f00b 100644 --- a/UFrm.dfm +++ b/UFrm.dfm @@ -12,12 +12,10 @@ object Frm: TFrm Font.Height = -11 Font.Name = 'Segoe UI' Font.Style = [] - OldCreateOrder = False Position = poScreenCenter OnCreate = FormCreate OnDestroy = FormDestroy OnShow = FormShow - PixelsPerInch = 96 TextHeight = 13 object LbComponentName: TLabel Left = 16 @@ -45,7 +43,7 @@ object Frm: TFrm Top = 16 Width = 123 Height = 13 - Caption = 'Component Installer 2.5' + Caption = 'Component Installer 2.6' Font.Charset = ANSI_CHARSET Font.Color = clGreen Font.Height = -11 @@ -346,7 +344,6 @@ object Frm: TFrm ReadOnly = True ScrollBars = ssVertical TabOrder = 4 - Zoom = 100 end object LinkLabel1: TLinkLabel Left = 640 diff --git a/UProcess.pas b/UProcess.pas index 6355e3d..d3bd1cc 100644 --- a/UProcess.pas +++ b/UProcess.pas @@ -27,6 +27,8 @@ TProcess = class(TThread) procedure PublishFiles(P: TPackage; const aPlatform: string); procedure RegisterBPL(const aPackage: string); procedure OnLine(const Text: string); + + function GetOutputPath(const aPlatform: string): string; end; implementation @@ -160,14 +162,14 @@ procedure TProcess.OnLine(const Text: string); end; procedure TProcess.PublishFiles(P: TPackage; const aPlatform: string); -var A, aSource, aDest: string; +var RelativeFile, aSource, aDest: string; begin - for A in P.PublishFiles do + for RelativeFile in P.PublishFiles do begin - aSource := AppDir+A; - aDest := AppDir+aPlatform+'\Release\'+A; + aSource := AppDir+RelativeFile; + aDest := GetOutputPath(aPlatform)+'\'+ExtractFileName(RelativeFile); - Log(Format('Copy file %s to %s', [A{aSource}, aDest]), False, clPurple); + Log(Format('Copy file %s to %s', [RelativeFile{aSource}, aDest]), False, clPurple); TFile.Copy(aSource, aDest, True); end; end; @@ -182,7 +184,7 @@ procedure TProcess.AddLibrary; Log('Add library path to '+aPlatform); Key := BDS_KEY+'\'+InternalDelphiVersionKey+'\Library\'+aPlatform; - Dir := AppDir+aPlatform+'\Release'; + Dir := GetOutputPath(aPlatform); R := TRegistry.Create; try @@ -310,4 +312,14 @@ procedure TProcess.FindMSBuild; MSBuildExe := aFile; end; +function TProcess.GetOutputPath(const aPlatform: string): string; +begin + Result := D.OutputPath; + + Result := Result.Replace('{PLATFORM}', aPlatform); + Result := Result.Replace('{CONFIG}', 'Release'); + + Result := AppDir + Result; +end; + end. From eb020299d23f274231230928f6a99c3b677850d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Wed, 24 Jan 2024 18:22:00 -0300 Subject: [PATCH 03/28] allow empty output path --- UProcess.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UProcess.pas b/UProcess.pas index d3bd1cc..2bb9742 100644 --- a/UProcess.pas +++ b/UProcess.pas @@ -314,7 +314,10 @@ procedure TProcess.FindMSBuild; function TProcess.GetOutputPath(const aPlatform: string): string; begin - Result := D.OutputPath; + if D.OutputPath<>string.Empty then + Result := D.OutputPath + else + Result := '{PLATFORM}\{CONFIG}'; Result := Result.Replace('{PLATFORM}', aPlatform); Result := Result.Replace('{CONFIG}', 'Release'); From 78d02ce7b623f9c2993875d4a1be76efdb9fd84f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Wed, 24 Jan 2024 18:29:04 -0300 Subject: [PATCH 04/28] Update README.md --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6bdd47b..15bb097 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,19 @@ ## What's New -- 09/12/2021 (Version 2.5) +- 01/24/2024 (Version 2.6) - - Delphi 11 support. + - Delphi 12 support. + - New ini property: OutputPath + - PublishFiles now supports subfolder.
Click here to view the entire changelog +- 09/12/2021 (Version 2.5) + + - Delphi 11 support. + - 03/25/2021 (Version 2.4) - As it is not a good practice to embed the Component Installer EXE in the GitHub component sources, the update of the GitHub repository has been modified to not update the Component Installer EXE, but only the configured component sources. @@ -89,12 +95,14 @@ Then put the **CompInstall.exe** and **CompInstall.ini** into your component pac `DelphiVersions` (required) = It's a list splited by ";" with all Delphi versions supported by the component. According to Delphi versions installed in Windows and combining with this parameter, a combobox in the install form will list all possible Delphi versions. -> Supported values: 2005;2006;2007;2009;2010;XE;XE2;XE3;XE4;XE5;XE6;XE7;XE8;10;10.1;10.2;10.3;10.4 +> Supported values: 2005;2006;2007;2009;2010;XE;XE2;XE3;XE4;XE5;XE6;XE7;XE8;10;10.1;10.2;10.3;10.4;11;12 `Packages` (required) = It's a list splited by ";" with packages to be compiled, in correct order. Just type the package name without the file extension. `AddLibrary` (optional) = 0 or 1. When 1, the path of release folders of component will be registered into Delphi library path. +`OutputPath` (optional) = Relative folder where compiled files are stored (must be the same configured in package settings). You can use `{PLATFORM}` and `{CONFIG}` variables. Default value is: `{PLATFORM}\{CONFIG}` (By now, {CONFIG} is always "Release"). + **Package section** To specify package parameters, create a section with the name of the package with the `P_` prefix, like: From 30d5afee2250dfdfba01186e4bfa76639dec9cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Wed, 24 Jan 2024 18:30:26 -0300 Subject: [PATCH 05/28] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 15bb097..9b4b36b 100644 --- a/README.md +++ b/README.md @@ -93,11 +93,11 @@ Then put the **CompInstall.exe** and **CompInstall.ini** into your component pac `Version` (required) = Component version displayed at install form and used by GitHub auto-update control (if enabled). -`DelphiVersions` (required) = It's a list splited by ";" with all Delphi versions supported by the component. According to Delphi versions installed in Windows and combining with this parameter, a combobox in the install form will list all possible Delphi versions. +`DelphiVersions` (required) = It's a list splitted by ";" with all Delphi versions supported by the component. According to Delphi versions installed in Windows and combining with this parameter, a combobox in the install form will list all possible Delphi versions. > Supported values: 2005;2006;2007;2009;2010;XE;XE2;XE3;XE4;XE5;XE6;XE7;XE8;10;10.1;10.2;10.3;10.4;11;12 -`Packages` (required) = It's a list splited by ";" with packages to be compiled, in correct order. Just type the package name without the file extension. +`Packages` (required) = It's a list splitted by ";" with packages to be compiled, in correct order. Just type the package name without the file extension. `AddLibrary` (optional) = 0 or 1. When 1, the path of release folders of component will be registered into Delphi library path. @@ -113,7 +113,7 @@ To specify package parameters, create a section with the name of the package wit If any package has this option enabled, it will be display a checkbox allowing install 64-bit version of component (the checkbox starts checked by default). -`PublishFiles` (optional) = It's a list splited by ";" with all files you want to copy into release folders (usually DFM form files used at runtime and resource files). +`PublishFiles` (optional) = It's a list splitted by ";" with all files you want to copy into release folders (usually DFM form files used at runtime and resource files). `Install` (optional) = 0 or 1. When 1, this package will be installed into Delphi IDE. You need to set this option for design-time packages when you want to register components into Delphi IDE. From afa1d9d4a6485967f5aedcd6516d89077b26609d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Wed, 24 Jan 2024 18:33:24 -0300 Subject: [PATCH 06/28] Update UFrm.dfm --- UFrm.dfm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/UFrm.dfm b/UFrm.dfm index 646f00b..6527881 100644 --- a/UFrm.dfm +++ b/UFrm.dfm @@ -80,7 +80,7 @@ object Frm: TFrm Width = 201 Height = 21 Style = csDropDownList - TabOrder = 2 + TabOrder = 3 end object Ck64bit: TCheckBox Left = 248 @@ -90,7 +90,7 @@ object Frm: TFrm Caption = 'Install 64-bit support' Checked = True State = cbChecked - TabOrder = 3 + TabOrder = 4 end object BtnInstall: TBitBtn Left = 256 @@ -210,7 +210,7 @@ object Frm: TFrm FFC080FFC080FF929596899396819195788F95708C95708C95788F9581919589 9396929596C080FFC080FFC080FFC080FFC080FFC080FFC080FF} NumGlyphs = 2 - TabOrder = 5 + TabOrder = 6 OnClick = BtnInstallClick end object BtnExit: TBitBtn @@ -331,7 +331,7 @@ object Frm: TFrm 78807A78807A78807A78807A78807A78807A78807A78807A78807A78807A7888 8483C080FFC080FFC080FFC080FFC080FFC080FFC080FFC080FF} NumGlyphs = 2 - TabOrder = 6 + TabOrder = 7 OnClick = BtnExitClick end object M: TRichEdit @@ -343,7 +343,7 @@ object Frm: TFrm HideScrollBars = False ReadOnly = True ScrollBars = ssVertical - TabOrder = 4 + TabOrder = 5 end object LinkLabel1: TLinkLabel Left = 640 @@ -353,7 +353,7 @@ object Frm: TFrm Caption = 'Dig'#227'o Dal' + 'piaz' - TabOrder = 1 + TabOrder = 2 OnLinkClick = LinkLabel1LinkClick end object EdCompVersion: TEdit @@ -364,6 +364,6 @@ object Frm: TFrm TabStop = False Color = clBtnFace ReadOnly = True - TabOrder = 7 + TabOrder = 1 end end From 55cbf17ab71295f270ea97a309163770a997e3bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Wed, 24 Jan 2024 19:17:03 -0300 Subject: [PATCH 07/28] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b4b36b..5781a6a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ - 01/24/2024 (Version 2.6) - Delphi 12 support. - - New ini property: OutputPath + - New ini properties: OutputPath and Package\Path - PublishFiles now supports subfolder.
@@ -109,6 +109,8 @@ To specify package parameters, create a section with the name of the package wit `[P_MyPackage]` +`Path` (optional) = Relative folder where package file is. If blank, package must be at component root folder. + `Allow64bit` (optional) = 0 or 1. When 1, specify this package to be compiled twice, with 32-bit and 64-bit versions. Remember to create this platform at Delphi Project Manager, otherwise the 64-bit compilation will fail. If any package has this option enabled, it will be display a checkbox allowing install 64-bit version of component (the checkbox starts checked by default). From dd716eac4b4f8c1e0115007e1f3e8a4da35f5e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Wed, 24 Jan 2024 19:31:30 -0300 Subject: [PATCH 08/28] new Path property --- UDefinitions.pas | 2 ++ UFrm.dfm | 32 ++++++++++++++++---------------- UProcess.pas | 13 +++++++++---- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/UDefinitions.pas b/UDefinitions.pas index b57849e..8fe58e2 100644 --- a/UDefinitions.pas +++ b/UDefinitions.pas @@ -8,6 +8,7 @@ interface TPackage = class public Name: string; + Path: string; Allow64bit: Boolean; PublishFiles: TStringList; Install: Boolean; @@ -86,6 +87,7 @@ procedure TDefinitions.LoadIniFile(const aFile: string); Sec := 'P_'+A; P.Name := A; + P.Path := Ini.ReadString(Sec, 'Path', ''); P.Allow64bit := Ini.ReadBool(Sec, 'Allow64bit', False); P.PublishFiles.Text := PVToEnter( Ini.ReadString(Sec, 'PublishFiles', '') ); P.Install := Ini.ReadBool(Sec, 'Install', False); diff --git a/UFrm.dfm b/UFrm.dfm index 6527881..2f7bc5f 100644 --- a/UFrm.dfm +++ b/UFrm.dfm @@ -4,8 +4,8 @@ object Frm: TFrm BorderIcons = [biSystemMenu, biMinimize] BorderStyle = bsSingle Caption = 'Component Installer' - ClientHeight = 542 - ClientWidth = 729 + ClientHeight = 589 + ClientWidth = 874 Color = clBtnFace Font.Charset = ANSI_CHARSET Font.Color = clWindowText @@ -39,7 +39,7 @@ object Frm: TFrm Caption = 'Installation Log' end object LbVersion: TLabel - Left = 592 + Left = 726 Top = 16 Width = 123 Height = 13 @@ -52,7 +52,7 @@ object Frm: TFrm ParentFont = False end object LbComponentVersion: TLabel - Left = 456 + Left = 528 Top = 16 Width = 41 Height = 13 @@ -61,7 +61,7 @@ object Frm: TFrm object EdCompName: TEdit Left = 16 Top = 32 - Width = 433 + Width = 505 Height = 21 TabStop = False Color = clBtnFace @@ -77,13 +77,13 @@ object Frm: TFrm object EdDV: TComboBox Left = 16 Top = 80 - Width = 201 + Width = 225 Height = 21 Style = csDropDownList TabOrder = 3 end object Ck64bit: TCheckBox - Left = 248 + Left = 272 Top = 80 Width = 137 Height = 17 @@ -93,8 +93,8 @@ object Frm: TFrm TabOrder = 4 end object BtnInstall: TBitBtn - Left = 256 - Top = 496 + Left = 320 + Top = 544 Width = 105 Height = 33 Caption = 'Install' @@ -214,8 +214,8 @@ object Frm: TFrm OnClick = BtnInstallClick end object BtnExit: TBitBtn - Left = 368 - Top = 496 + Left = 432 + Top = 544 Width = 105 Height = 33 Caption = 'Exit' @@ -337,8 +337,8 @@ object Frm: TFrm object M: TRichEdit Left = 16 Top = 128 - Width = 697 - Height = 361 + Width = 841 + Height = 410 TabStop = False HideScrollBars = False ReadOnly = True @@ -346,7 +346,7 @@ object Frm: TFrm TabOrder = 5 end object LinkLabel1: TLinkLabel - Left = 640 + Left = 774 Top = 40 Width = 76 Height = 17 @@ -357,9 +357,9 @@ object Frm: TFrm OnLinkClick = LinkLabel1LinkClick end object EdCompVersion: TEdit - Left = 456 + Left = 528 Top = 32 - Width = 121 + Width = 161 Height = 21 TabStop = False Color = clBtnFace diff --git a/UProcess.pas b/UProcess.pas index 2bb9742..e0f269f 100644 --- a/UProcess.pas +++ b/UProcess.pas @@ -126,19 +126,24 @@ procedure TProcess.Compile; end; procedure TProcess.CompilePackage(P: TPackage; const aBat, aPlatform: string); -var C: TCmdExecBuffer; +var + C: TCmdExecBuffer; + aPath, aFile: string; begin Log('Compile package '+P.Name+' ('+aPlatform+')'); + aPath := TPath.Combine(AppDir, P.Path); //if PackagesPath blank, Combine ignores automatically + aFile := TPath.Combine(aPath, P.Name); + C := TCmdExecBuffer.Create; try C.OnLine := OnLine; C.CommandLine := Format('""%s" & "%s" "%s.dproj" /t:build /p:config=Release /p:platform=%s"', - [aBat, MSBuildExe, AppDir+P.Name, aPlatform]); + [aBat, MSBuildExe, aFile, aPlatform]); - C.WorkDir := AppDir; + C.WorkDir := aPath; if not C.Exec then raise Exception.Create('Could not execute MSBUILD'); @@ -314,7 +319,7 @@ procedure TProcess.FindMSBuild; function TProcess.GetOutputPath(const aPlatform: string): string; begin - if D.OutputPath<>string.Empty then + if not D.OutputPath.IsEmpty then Result := D.OutputPath else Result := '{PLATFORM}\{CONFIG}'; From 749ac8b868435c2bc2f148de60a7509af8f621c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Wed, 24 Jan 2024 19:32:23 -0300 Subject: [PATCH 09/28] Update UProcess.pas --- UProcess.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UProcess.pas b/UProcess.pas index e0f269f..8a70cd4 100644 --- a/UProcess.pas +++ b/UProcess.pas @@ -132,7 +132,7 @@ procedure TProcess.CompilePackage(P: TPackage; const aBat, aPlatform: string); begin Log('Compile package '+P.Name+' ('+aPlatform+')'); - aPath := TPath.Combine(AppDir, P.Path); //if PackagesPath blank, Combine ignores automatically + aPath := TPath.Combine(AppDir, P.Path); //if P.Path blank, Combine ignores automatically aFile := TPath.Combine(aPath, P.Name); C := TCmdExecBuffer.Create; From 0e32cbe0339ca236585d0a014a12ddd034017c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Thu, 25 Jan 2024 08:38:52 -0300 Subject: [PATCH 10/28] vars review --- UCommon.pas | 3 ++- UDefinitions.pas | 6 ++++-- UProcess.pas | 20 +++++++++++++------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/UCommon.pas b/UCommon.pas index f5a9a43..27cb07b 100644 --- a/UCommon.pas +++ b/UCommon.pas @@ -21,7 +21,8 @@ function HasInList(const Item, List: string): Boolean; end; function NormalizeAndRemoveFirstDir(Path: string): string; -var I: Integer; +var + I: Integer; begin Path := Path.Replace('/', '\'); diff --git a/UDefinitions.pas b/UDefinitions.pas index 8fe58e2..c887885 100644 --- a/UDefinitions.pas +++ b/UDefinitions.pas @@ -48,7 +48,8 @@ function PVToEnter(const A: string): string; end; procedure TDefinitions.LoadIniFile(const aFile: string); -var Ini: TIniFile; +var + Ini: TIniFile; A, Sec: string; S: TStringList; P: TPackage; @@ -119,7 +120,8 @@ destructor TDefinitions.Destroy; end; function TDefinitions.HasAny64bit: Boolean; -var P: TPackage; +var + P: TPackage; begin Result := False; diff --git a/UProcess.pas b/UProcess.pas index 8a70cd4..ae18798 100644 --- a/UProcess.pas +++ b/UProcess.pas @@ -82,7 +82,8 @@ procedure TProcess.Log(const A: string; bBold: Boolean = True; Color: TColor = c end; procedure TProcess.Compile; -var R: TRegistry; +var + R: TRegistry; aRootDir: string; aBat: string; @@ -167,7 +168,8 @@ procedure TProcess.OnLine(const Text: string); end; procedure TProcess.PublishFiles(P: TPackage; const aPlatform: string); -var RelativeFile, aSource, aDest: string; +var + RelativeFile, aSource, aDest: string; begin for RelativeFile in P.PublishFiles do begin @@ -182,7 +184,8 @@ procedure TProcess.PublishFiles(P: TPackage; const aPlatform: string); procedure TProcess.AddLibrary; procedure AddKey(const aPlatform: string); - var Key, A, Dir: string; + var + Key, A, Dir: string; R: TRegistry; const SEARCH_KEY = 'Search Path'; begin @@ -215,7 +218,8 @@ procedure TProcess.AddLibrary; end; function GetPublicDocs: string; -var Path: array[0..MAX_PATH] of Char; +var + Path: array[0..MAX_PATH] of Char; begin if not ShGetSpecialFolderPath(0, Path, CSIDL_COMMON_DOCUMENTS, False) then raise Exception.Create('Could not find Public Documents folder location') ; @@ -224,7 +228,8 @@ function GetPublicDocs: string; end; procedure TProcess.RegisterBPL(const aPackage: string); -var R: TRegistry; +var + R: TRegistry; BplDir, PublicPrefix: string; FS: TFormatSettings; begin @@ -257,12 +262,13 @@ procedure TProcess.RegisterBPL(const aPackage: string); end; procedure TProcess.FindMSBuild; -var R: TRegistry; +const TOOLS_KEY = 'Software\Microsoft\MSBUILD\ToolsVersions'; +var + R: TRegistry; S: TStringList; I: Integer; Dir, aFile: string; Found: Boolean; -const TOOLS_KEY = 'Software\Microsoft\MSBUILD\ToolsVersions'; begin R := TRegistry.Create; try From 2dccc33ececbebd3b306c0a5f0dbb2ab3e6504f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Thu, 25 Jan 2024 10:17:39 -0300 Subject: [PATCH 11/28] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5781a6a..52289f1 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ - Delphi 12 support. - New ini properties: OutputPath and Package\Path - - PublishFiles now supports subfolder. + - PublishFiles now supports sub-folder. + - Clear all files and sub-folders when updating from GitHub.
Click here to view the entire changelog From acb1f76e6a9beaf0cc98f311f67a758a34949d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Thu, 25 Jan 2024 10:19:38 -0300 Subject: [PATCH 12/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 52289f1..1b009d8 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ If any package has this option enabled, it will be display a checkbox allowing i `Install` (optional) = 0 or 1. When 1, this package will be installed into Delphi IDE. You need to set this option for design-time packages when you want to register components into Delphi IDE. ->Note: The app compiles your component using **Release** target. This means all packages need to be configured at default output folder (Win32\Release and Win64\Release). +>Note: The app compiles your component using always **Release** target. **GitHub section** From 7aaee8d72ace8abb3aa0a465706edfb866ce59b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Thu, 25 Jan 2024 10:22:09 -0300 Subject: [PATCH 13/28] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b009d8..72b2bc7 100644 --- a/README.md +++ b/README.md @@ -137,10 +137,12 @@ Version=1.0 DelphiVersions=XE2;XE3;XE4;XE5;XE6;XE7;XE8;10;10.1;10.2;10.3;10.4 Packages=DamPackage;DamDesignPackage AddLibrary=1 +OutputPath=Library\{PLATFORM}\{CONFIG} [P_DamPackage] +Path=Source\Code Allow64bit=1 -PublishFiles=DamDialog.dfm;Dam_Resource.res +PublishFiles=DamDialog.dfm;Resources\Dam_Resource.res [P_DamDesignPackage] Install=1 From 3117e194aebdc7b90f669b4d42b0639c48d80ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Thu, 25 Jan 2024 10:22:33 -0300 Subject: [PATCH 14/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 72b2bc7..c26b1f5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Component Installer -## Delphi VCL app utility to auto-install component packages into IDE. +## Delphi app utility to auto-install component packages into IDE. [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C53LVFN) From dd7a872d0b1aadfc5d1f21a00e9ef885fd5a8eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Thu, 25 Jan 2024 10:22:49 -0300 Subject: [PATCH 15/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c26b1f5..84fe116 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ## What's New -- 01/24/2024 (Version 2.6) +- 01/25/2024 (Version 2.6) - Delphi 12 support. - New ini properties: OutputPath and Package\Path From a41ab03fc0656e5300edfbab4c3ac8f73c204f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Thu, 25 Jan 2024 10:46:17 -0300 Subject: [PATCH 16/28] definitions version check --- UDefinitions.pas | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UDefinitions.pas b/UDefinitions.pas index c887885..1c5df30 100644 --- a/UDefinitions.pas +++ b/UDefinitions.pas @@ -4,6 +4,8 @@ interface uses System.Generics.Collections, System.Classes; +const DEFINITIONS_VERSION = 2; //current definitions template + type TPackage = class public @@ -20,6 +22,7 @@ TPackages = class(TObjectList); TDefinitions = class public + IniVersion: Integer; CompName: string; CompVersion: string; DelphiVersions: string; @@ -59,6 +62,10 @@ procedure TDefinitions.LoadIniFile(const aFile: string); Ini := TIniFile.Create(aFile); try + IniVersion := Ini.ReadInteger('Template', 'IniVersion', 1); + if IniVersion>DEFINITIONS_VERSION then + raise Exception.Create('Unsupported ini version. You probably need to update Component Installer!'); + CompName := Ini.ReadString('General', 'Name', ''); if CompName='' then raise Exception.Create('Component name not specifyed at ini file'); From 42b5de023a574bce47069ff22814a69021097f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Thu, 25 Jan 2024 10:52:46 -0300 Subject: [PATCH 17/28] Update README.md --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 84fe116..d1079ab 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ - 01/25/2024 (Version 2.6) - Delphi 12 support. - - New ini properties: OutputPath and Package\Path + - New ini properties: IniVersion, OutputPath and Package\Path - PublishFiles now supports sub-folder. - Clear all files and sub-folders when updating from GitHub. @@ -88,6 +88,12 @@ Then put the **CompInstall.exe** and **CompInstall.ini** into your component pac ## CompInstall.ini structure +**`[Template]` section** + +`IniVersion` (required) = Version of ini structure (**Current version = 2**) + +> If ini version is higher than current app supported version, the app will display an error message and block installation. + **`[General]` section** `Name` (required) = Component name displayed at install form and registered into Delphi Packages. @@ -120,9 +126,9 @@ If any package has this option enabled, it will be display a checkbox allowing i `Install` (optional) = 0 or 1. When 1, this package will be installed into Delphi IDE. You need to set this option for design-time packages when you want to register components into Delphi IDE. ->Note: The app compiles your component using always **Release** target. +> Note: The app compiles your component using always **Release** target. -**GitHub section** +**`[GitHub]` section** `Repository` (optional) = Allows you to specify a GitHub repository (syntax: `GitHub account`/`Repository name`), so when app starts, it will check for component update using GitHub API, reading the latest existing release and comparing its version with current version. If the versions don't match, a dialog will be displayed asking if you want to auto-update files. @@ -131,6 +137,9 @@ If any package has this option enabled, it will be display a checkbox allowing i In this example, there are two Delphi packages (DamPackage and DamDesignPackage). The design-time package (DamDesignPackage) is configured to install into Delphi IDE. The runtime package (DamPackage) is configured to copy dfm form file and resource file to release folder. ``` +[Template] +IniVersion=2 + [General] Name=Dam Component Version=1.0 From 40c665cd24d5b40a7226475a09c3019c49ee19d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Thu, 25 Jan 2024 11:19:59 -0300 Subject: [PATCH 18/28] ignore hidden folder when updating from GitHub --- UGitHub.pas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/UGitHub.pas b/UGitHub.pas index 54190bd..1582f49 100644 --- a/UGitHub.pas +++ b/UGitHub.pas @@ -176,6 +176,10 @@ procedure TThCheck.CleanFolder; for Path in TDirectory.GetDirectories(AppDir) do begin + {$WARN SYMBOL_PLATFORM OFF} + if TFileAttribute.faHidden in TDirectory.GetAttributes(Path) then Continue; //ignore hidden folders (like .git) + {$WARN SYMBOL_PLATFORM ON} + try TDirectory.Delete(Path, True); except From 9bf210f864db71e9ed745d1c0493738e7c0d924d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Sat, 27 Jan 2024 16:41:21 -0300 Subject: [PATCH 19/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d1079ab..51d3366 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ## What's New -- 01/25/2024 (Version 2.6) +- 01/27/2024 (Version 2.6) - Delphi 12 support. - New ini properties: IniVersion, OutputPath and Package\Path From e4931aa05bf64823c3fb239212a3d88f56c71905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Tue, 20 Feb 2024 21:05:11 -0300 Subject: [PATCH 20/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51d3366..a517909 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ## What's New -- 01/27/2024 (Version 2.6) +- 02/20/2024 (Version 2.6) - Delphi 12 support. - New ini properties: IniVersion, OutputPath and Package\Path From 523c8092757ae8ceb087fb39bda69f8b850c89c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Tue, 20 Feb 2024 21:15:38 -0300 Subject: [PATCH 21/28] Update CompInstall.dproj --- CompInstall.dproj | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/CompInstall.dproj b/CompInstall.dproj index a17983b..ace2ed8 100644 --- a/CompInstall.dproj +++ b/CompInstall.dproj @@ -1,7 +1,7 @@  {9FB451FF-56AD-4400-8229-E289EFFCD751} - 18.8 + 19.5 VCL CompInstall.dpr True @@ -18,6 +18,11 @@ Base true + + true + Base + true + true Base @@ -29,6 +34,12 @@ true true + + true + Cfg_1 + true + true + true Base @@ -40,6 +51,12 @@ true true + + true + Cfg_2 + true + true + .\$(Platform)\$(Config) .\$(Platform)\$(Config) @@ -65,6 +82,13 @@ 1033 $(BDS)\bin\default_app.manifest + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + 1033 + $(BDS)\bin\default_app.manifest + DEBUG;$(DCC_Define) true @@ -78,6 +102,9 @@ true PerMonitorV2 + + PerMonitorV2 + false RELEASE;$(DCC_Define) @@ -91,6 +118,9 @@ 1033 CompInstall_Icon.ico + + PerMonitorV2 + MainSource @@ -104,10 +134,6 @@ - - Cfg_2 - Base - Base @@ -115,6 +141,10 @@ Cfg_1 Base + + Cfg_2 + Base + Delphi.Personality.12 @@ -1015,6 +1045,7 @@ True + False 12 From 6410984c51442425f1ce7e8ff5c7aa3ebd7c05b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Tue, 20 Feb 2024 21:26:05 -0300 Subject: [PATCH 22/28] new dproj file --- .gitattributes | 2 - .gitignore | 3 - CompInstall.dpr | 9 +- CompInstall.dproj | 934 +--------------------------------------------- 4 files changed, 17 insertions(+), 931 deletions(-) delete mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index dfe0770..0000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto diff --git a/.gitignore b/.gitignore index 8c1b157..2330776 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,3 @@ *.local *.stat /Win32 -/Win64 -/Design -*/Win32 diff --git a/CompInstall.dpr b/CompInstall.dpr index 5ffbb44..0272785 100644 --- a/CompInstall.dpr +++ b/CompInstall.dpr @@ -2,14 +2,13 @@ program CompInstall; uses Vcl.Forms, - System.SysUtils, - UFrm in 'UFrm.pas' {Frm}, UCmdExecBuffer in 'UCmdExecBuffer.pas', + UCommon in 'UCommon.pas', UDefinitions in 'UDefinitions.pas', + UDelphiVersionCombo in 'UDelphiVersionCombo.pas', + UFrm in 'UFrm.pas' {Frm}, UGitHub in 'UGitHub.pas', - UProcess in 'UProcess.pas', - UCommon in 'UCommon.pas', - UDelphiVersionCombo in 'UDelphiVersionCombo.pas'; + UProcess in 'UProcess.pas'; {$R *.res} diff --git a/CompInstall.dproj b/CompInstall.dproj index ace2ed8..67527fc 100644 --- a/CompInstall.dproj +++ b/CompInstall.dproj @@ -1,14 +1,14 @@  - {9FB451FF-56AD-4400-8229-E289EFFCD751} + {95EB1B22-13DC-41E4-B3FB-05C3D40EEABB} 19.5 VCL - CompInstall.dpr True Release Win32 1 Application + CompInstall.dpr true @@ -34,12 +34,6 @@ true true - - true - Cfg_1 - true - true - true Base @@ -51,12 +45,6 @@ true true - - true - Cfg_2 - true - true - .\$(Platform)\$(Config) .\$(Platform)\$(Config) @@ -70,11 +58,9 @@ $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png CompInstall - 1046 - CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= - DBXSqliteDriver;IndyIPCommon;RESTComponents;bindcompdbx;DBXInterBaseDriver;vcl;IndyIPServer;vclactnband;vclFireDAC;IndySystem;tethering;svnui;dsnapcon;FireDACADSDriver;FireDACMSAccDriver;fmxFireDAC;vclimg;TeeDB;FireDAC;vcltouch;vcldb;bindcompfmx;svn;FireDACSqliteDriver;FireDACPgDriver;inetdb;FMXTee;soaprtl;DbxCommonDriver;FmxTeeUI;fmx;FireDACIBDriver;fmxdae;xmlrtl;soapmidas;Tee;fmxobj;vclwinx;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;dbexpress;IndyCore;vclx;bindcomp;appanalytics;dsnap;FireDACCommon;IndyIPClient;bindcompvcl;RESTBackendComponents;TeeUI;VCLRESTComponents;soapserver;dbxcds;VclSmp;adortl;vclie;bindengine;DBXMySQLDriver;CloudService;dsnapxml;FireDACMySQLDriver;dbrtl;IndyProtocols;inetdbxpress;FireDACCommonODBC;FireDACCommonDriver;inet;fmxase;$(DCC_UsePackage) + soapserver;IndySystem;vclwinx;fmx;vclie;DbxCommonDriver;bindengine;vcldb;IndyIPCommon;VCLRESTComponents;FireDACCommonODBC;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;IndyIPClient;dbxcds;vcledge;vclFireDAC;bindcompvclwinx;bindcomp;FireDACCommon;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;inetdb;rtl;FireDACMySQLDriver;FireDACSqliteDriver;DbxClientDriver;FireDACADSDriver;RESTComponents;soapmidas;DBXSqliteDriver;vcl;vclactnband;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;dsnapcon;adortl;DBXMySQLDriver;VclSmp;inet;vclimg;vcltouch;FireDACPgDriver;FireDAC;fmxase;inetdbxpress;xmlrtl;tethering;dbrtl;bindcompvcl;dsnap;fmxdae;CloudService;FireDACMSAccDriver;CustomIPTransport;fmxobj;bindcompvclsmp;soaprtl;vcldsnap;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage) Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) Debug true @@ -83,11 +69,7 @@ $(BDS)\bin\default_app.manifest - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) - Debug - true - 1033 - $(BDS)\bin\default_app.manifest + soapserver;IndySystem;vclwinx;fmx;vclie;DbxCommonDriver;bindengine;vcldb;IndyIPCommon;VCLRESTComponents;FireDACCommonODBC;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;IndyIPClient;dbxcds;vcledge;vclFireDAC;bindcompvclwinx;bindcomp;FireDACCommon;IndyCore;RESTBackendComponents;bindcompfmx;bindcompdbx;inetdb;rtl;FireDACMySQLDriver;FireDACSqliteDriver;DbxClientDriver;FireDACADSDriver;RESTComponents;soapmidas;DBXSqliteDriver;vcl;vclactnband;IndyIPServer;dsnapxml;fmxFireDAC;dbexpress;dsnapcon;adortl;DBXMySQLDriver;VclSmp;inet;vclimg;vcltouch;FireDACPgDriver;FireDAC;fmxase;inetdbxpress;xmlrtl;tethering;dbrtl;bindcompvcl;dsnap;fmxdae;CloudService;FireDACMSAccDriver;CustomIPTransport;fmxobj;bindcompvclsmp;soaprtl;vcldsnap;DBXInterBaseDriver;FireDACIBDriver;$(DCC_UsePackage) DEBUG;$(DCC_Define) @@ -96,13 +78,11 @@ true true true + true + true false - true - PerMonitorV2 - - PerMonitorV2 @@ -112,28 +92,25 @@ 0 - true PerMonitorV2 true 1033 CompInstall_Icon.ico - - PerMonitorV2 - MainSource + + + +
Frm
+ dfm
- - - - Base @@ -155,894 +132,10 @@ CompInstall.dpr - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components - - - - CompInstall.exe - true - - - - - CompInstall.exe - true - - - - - 1 - - - Contents\MacOS - 1 - - - 0 - - - - - classes - 1 - - - classes - 1 - - - - - res\xml - 1 - - - res\xml - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\armeabi - 1 - - - library\lib\armeabi - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\mips - 1 - - - library\lib\mips - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\values-v21 - 1 - - - res\values-v21 - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-ldpi - 1 - - - res\drawable-ldpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-xxxhdpi - 1 - - - res\drawable-xxxhdpi - 1 - - - - - res\drawable-small - 1 - - - res\drawable-small - 1 - - - - - res\drawable-normal - 1 - - - res\drawable-normal - 1 - - - - - res\drawable-large - 1 - - - res\drawable-large - 1 - - - - - res\drawable-xlarge - 1 - - - res\drawable-xlarge - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - 1 - - - Contents\MacOS - 1 - - - 0 - - - - - Contents\MacOS - 1 - .framework - - - Contents\MacOS - 1 - .framework - - - 0 - - - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - Contents\MacOS - 1 - .dylib - - - Contents\MacOS - 1 - .dylib - - - 0 - .dll;.bpl - - - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - Contents\MacOS - 1 - .dylib - - - Contents\MacOS - 1 - .dylib - - - 0 - .bpl - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - Contents\Resources\StartUp\ - 0 - - - Contents\Resources\StartUp\ - 0 - - - 0 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - - - 1 - - - 1 - - - - - ..\ - 1 - - - ..\ - 1 - - - - - 1 - - - 1 - - - 1 - - - - - 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - - - ..\ - 1 - - - ..\ - 1 - - - - - Contents - 1 - - - Contents - 1 - - - - - Contents\Resources - 1 - - - Contents\Resources - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - Contents\MacOS - 1 - - - Contents\MacOS - 1 - - - 0 - - - - - library\lib\armeabi-v7a - 1 - - - - - 1 - - - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - - - - - - - - - True False @@ -1052,5 +145,4 @@
-
From 784a62b6517fc6d894bf154cd907a933f794d351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Tue, 20 Feb 2024 21:28:34 -0300 Subject: [PATCH 23/28] Update CompInstall.dproj --- CompInstall.dproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CompInstall.dproj b/CompInstall.dproj index 67527fc..b25c16b 100644 --- a/CompInstall.dproj +++ b/CompInstall.dproj @@ -1,6 +1,6 @@  - {95EB1B22-13DC-41E4-B3FB-05C3D40EEABB} + {0CAD47BE-D260-46DE-8E70-0EB57D0E9BAD} 19.5 VCL True From 750a34ecb1734f15b1ca77ee39e5142a0aed4557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Tue, 20 Feb 2024 21:30:51 -0300 Subject: [PATCH 24/28] Update UGitHub.pas --- UGitHub.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UGitHub.pas b/UGitHub.pas index 1582f49..2608a42 100644 --- a/UGitHub.pas +++ b/UGitHub.pas @@ -94,7 +94,7 @@ procedure TThCheck.Check; Confirm := MessageDlg(Format( 'There is a new version "%s" of the component available at GitHub.'+ ' Do you want to update it automatically?'+#13+#13+ - 'Warning: All content in the component''s folder and subfolders will be deleted.', + '*** Warning: All content in the component''s folder and subfolders will be deleted.', [tag_version]), mtInformation, mbYesNo, 0) = mrYes; end); @@ -164,6 +164,7 @@ procedure TThCheck.CleanFolder; for Path in TDirectory.GetFiles(AppDir) do begin FileName := ExtractFileName(Path); + //skip self EXE and CompInstall.ini if SameText(FileName, ExtractFileName(ParamStr(0))) or SameText(FileName, INI_FILE_NAME) then Continue; From b6f0eac4bbc75c9c23cd5f4d3fbca10c5c30b851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Tue, 20 Feb 2024 21:35:47 -0300 Subject: [PATCH 25/28] named label for GitHub --- UFrm.dfm | 4 ++-- UFrm.pas | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/UFrm.dfm b/UFrm.dfm index 2f7bc5f..c28392f 100644 --- a/UFrm.dfm +++ b/UFrm.dfm @@ -345,7 +345,7 @@ object Frm: TFrm ScrollBars = ssVertical TabOrder = 5 end - object LinkLabel1: TLinkLabel + object LbDigaoDalpiaz: TLinkLabel Left = 774 Top = 40 Width = 76 @@ -354,7 +354,7 @@ object Frm: TFrm 'Dig'#227'o Dal' + 'piaz' TabOrder = 2 - OnLinkClick = LinkLabel1LinkClick + OnLinkClick = LbDigaoDalpiazLinkClick end object EdCompVersion: TEdit Left = 528 diff --git a/UFrm.pas b/UFrm.pas index be16212..a5a0775 100644 --- a/UFrm.pas +++ b/UFrm.pas @@ -29,14 +29,14 @@ TFrm = class(TForm) BtnExit: TBitBtn; M: TRichEdit; LbVersion: TLabel; - LinkLabel1: TLinkLabel; + LbDigaoDalpiaz: TLinkLabel; LbComponentVersion: TLabel; EdCompVersion: TEdit; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure BtnExitClick(Sender: TObject); procedure BtnInstallClick(Sender: TObject); - procedure LinkLabel1LinkClick(Sender: TObject; const Link: string; + procedure LbDigaoDalpiazLinkClick(Sender: TObject; const Link: string; LinkType: TSysLinkType); procedure FormShow(Sender: TObject); private @@ -123,7 +123,7 @@ procedure TFrm.FormShow(Sender: TObject); CheckGitHubUpdate(D.GitHubRepository, D.CompVersion); end; -procedure TFrm.LinkLabel1LinkClick(Sender: TObject; const Link: string; +procedure TFrm.LbDigaoDalpiazLinkClick(Sender: TObject; const Link: string; LinkType: TSysLinkType); begin ShellExecute(0, '', PChar(Link), '', '', SW_SHOWNORMAL); From 37273a464b7179ead908de93bb1909bcc006a58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Tue, 20 Feb 2024 21:37:12 -0300 Subject: [PATCH 26/28] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2330776..a1ddcfa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ *.identcache *.local -*.stat /Win32 From b9b89419ec512a12f96d5bd3775eae7aaae99bda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Tue, 20 Feb 2024 22:54:21 -0300 Subject: [PATCH 27/28] new form for list old files --- CompInstall.dpr | 3 +- CompInstall.dproj | 4 + UFrm.dfm | 2 +- UFrmOldFiles.dfm | 245 ++++++++++++++++++++++++++++++++++++++++++++++ UFrmOldFiles.pas | 34 +++++++ UGitHub.pas | 171 ++++++++++++++++++++++++-------- 6 files changed, 415 insertions(+), 44 deletions(-) create mode 100644 UFrmOldFiles.dfm create mode 100644 UFrmOldFiles.pas diff --git a/CompInstall.dpr b/CompInstall.dpr index 0272785..7c8410a 100644 --- a/CompInstall.dpr +++ b/CompInstall.dpr @@ -8,7 +8,8 @@ uses UDelphiVersionCombo in 'UDelphiVersionCombo.pas', UFrm in 'UFrm.pas' {Frm}, UGitHub in 'UGitHub.pas', - UProcess in 'UProcess.pas'; + UProcess in 'UProcess.pas', + UFrmOldFiles in 'UFrmOldFiles.pas' {FrmOldFiles}; {$R *.res} diff --git a/CompInstall.dproj b/CompInstall.dproj index b25c16b..a4a4167 100644 --- a/CompInstall.dproj +++ b/CompInstall.dproj @@ -111,6 +111,10 @@ + +
FrmOldFiles
+ dfm +
Base diff --git a/UFrm.dfm b/UFrm.dfm index c28392f..c517892 100644 --- a/UFrm.dfm +++ b/UFrm.dfm @@ -7,7 +7,7 @@ object Frm: TFrm ClientHeight = 589 ClientWidth = 874 Color = clBtnFace - Font.Charset = ANSI_CHARSET + Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Segoe UI' diff --git a/UFrmOldFiles.dfm b/UFrmOldFiles.dfm new file mode 100644 index 0000000..947c945 --- /dev/null +++ b/UFrmOldFiles.dfm @@ -0,0 +1,245 @@ +object FrmOldFiles: TFrmOldFiles + Left = 0 + Top = 0 + BorderStyle = bsDialog + Caption = 'Deleting old files' + ClientHeight = 558 + ClientWidth = 618 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Segoe UI' + Font.Style = [] + Position = poScreenCenter + TextHeight = 13 + object LbBig: TLabel + Left = 8 + Top = 8 + Width = 143 + Height = 45 + Caption = 'Warning!' + Font.Charset = DEFAULT_CHARSET + Font.Color = clRed + Font.Height = -33 + Font.Name = 'Segoe UI' + Font.Style = [fsBold] + ParentFont = False + end + object LbInfo: TLabel + Left = 8 + Top = 56 + Width = 376 + Height = 15 + Caption = + 'All files and folders below will be deleted to update the compon' + + 'ent.' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Segoe UI' + Font.Style = [fsBold] + ParentFont = False + end + object LbConfirm: TLabel + Left = 8 + Top = 456 + Width = 84 + Height = 13 + Caption = 'Type "CONFIRM"' + end + object BottomLine: TBevel + Left = 8 + Top = 504 + Width = 601 + Height = 9 + Shape = bsBottomLine + end + object LFiles: TListView + Left = 8 + Top = 80 + Width = 601 + Height = 369 + Columns = < + item + Caption = 'Name' + Width = 565 + end> + ReadOnly = True + SmallImages = IL + TabOrder = 0 + ViewStyle = vsReport + end + object BtnOK: TButton + Left = 208 + Top = 520 + Width = 97 + Height = 33 + Caption = 'OK' + Enabled = False + ModalResult = 1 + TabOrder = 2 + end + object BtnCancel: TButton + Left = 312 + Top = 520 + Width = 97 + Height = 33 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 3 + end + object EdConfirm: TEdit + Left = 8 + Top = 472 + Width = 601 + Height = 21 + CharCase = ecUpperCase + TabOrder = 1 + OnChange = EdConfirmChange + end + object IL: TImageList + Left = 392 + Top = 24 + Bitmap = { + 494C010102000800040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 00000000000000000000000000000000000000000000000000001F1F1FE00000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF202020DF0000000000000000D0EFFF4EB2E5FF80B2E5FF80B2E5 + FF80B2E5FF80B2E5FF80B2E5FF80B2E5FF80B2E5FF80B2E5FF80B2E5FF80B2E5 + FF80B2E5FF80B2E5FF80B2E5FF80D0EFFF4E0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000000000000069CDFFF966CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF69CDFFF90000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000000000000066CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000000000000066CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000000000000066CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000000000000066CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000000000000066CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000000000000066CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000000000000066CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000000000000066CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000000000000066CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FFDFDFDF20000000000000 + 00000000000000000000000000000000000066CBFEFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CCFFFF66CC + FFFF66CCFFFF66CCFFFF66CCFFFF66CBFEFF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF00000000000000FF0000 + 00FF000000FF232323DC000000000000000059B1DDFFC3E5FEFFC6E7FFFFC6E7 + FFFFC6E7FFFFC6E7FFFFC6E7FFFFC6E7FFFFC6E7FFFFC6E7FFFFC6E7FFFFC6E7 + FFFFC6E7FFFFC6E7FFFFC3E5FEFF59B1DDFF0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF00000000000000FF0000 + 00FF202020DFDFDFDF20000000000000000052A3CCFFA2C5DDFFC2D7E7FFC2D7 + E7FFC2D7E7FFC2D7E7FFC2D7E7FFC2D7E7FFC2D7E7FFC2D7E7FFC2D7E7FFC2D7 + E7FFC2D7E7FFC2D7E7FFA1C5DDFF56A5CDF90000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF00000000000000FF2020 + 20DFDFDFDF2000000000000000000000000056A5CDF952A3CCFF52A3CCFF52A3 + CCFF52A3CCFF56A5CDF9A8D0E580A8D0E580A8D0E580A8D0E580A8D0E580A8D0 + E580A8D0E580A8D0E580A8D0E580CAE2EF4E0000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000000000001F1F1FE00000 + 00FF000000FF000000FF000000FF000000FF000000FF00000000232323DCDFDF + DF2000000000000000000000000000000000CAE2EF4EA8D0E580A8D0E580A8D0 + E580A8D0E580CAE2EF4EFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00C003000000000000C003000000000000 + C003000000000000C003000000000000C003000000000000C003000000000000 + C003000000000000C003000000000000C003000000000000C003000000000000 + C003000000000000C03F000000000000C043000000000000C043000000000000 + C047000000000000C04F00000000000000000000000000000000000000000000 + 000000000000} + end +end diff --git a/UFrmOldFiles.pas b/UFrmOldFiles.pas new file mode 100644 index 0000000..b0cf460 --- /dev/null +++ b/UFrmOldFiles.pas @@ -0,0 +1,34 @@ +unit UFrmOldFiles; + +interface + +uses Vcl.Forms, Vcl.ExtCtrls, Vcl.StdCtrls, System.ImageList, Vcl.ImgList, + Vcl.Controls, Vcl.ComCtrls, System.Classes; + +type + TFrmOldFiles = class(TForm) + LbBig: TLabel; + LbInfo: TLabel; + LFiles: TListView; + IL: TImageList; + BtnOK: TButton; + BtnCancel: TButton; + LbConfirm: TLabel; + EdConfirm: TEdit; + BottomLine: TBevel; + procedure EdConfirmChange(Sender: TObject); + end; + +var + FrmOldFiles: TFrmOldFiles; + +implementation + +{$R *.dfm} + +procedure TFrmOldFiles.EdConfirmChange(Sender: TObject); +begin + BtnOK.Enabled := EdConfirm.Text = 'CONFIRM'; +end; + +end. diff --git a/UGitHub.pas b/UGitHub.pas index 2608a42..2866993 100644 --- a/UGitHub.pas +++ b/UGitHub.pas @@ -6,27 +6,57 @@ procedure CheckGitHubUpdate(const Repository, CurrentVersion: string); implementation -uses System.Classes, System.SysUtils, Vcl.Graphics, - Vcl.Dialogs, System.UITypes, System.IOUtils, +uses System.Classes, System.SysUtils, System.Generics.Collections, + Vcl.Forms, Vcl.Graphics, Vcl.Dialogs, + System.UITypes, System.IOUtils, System.StrUtils, System.Math, System.Net.HttpClient, System.JSON, Vcl.ExtActns, System.Zip, - UFrm, UCommon; + UFrm, UFrmOldFiles, UCommon; const URL_GITHUB = 'https://api.github.com/repos/%s/releases/latest'; type + TOldFile = class + private + Path: string; + Folder: Boolean; + end; + TOldFiles = class(TObjectList) + private + procedure Add(const Path: string; Folder: Boolean); + end; + TThCheck = class(TThread) + public + constructor Create(Suspended: Boolean); + destructor Destroy; override; protected procedure Execute; override; private Repository: string; CurrentVersion: string; + OldFiles: TOldFiles; + procedure Check; + function ConfirmOldFiles: Boolean; procedure Download(const URL: string); procedure Log(const A: string; bBold: Boolean = True; Color: TColor = clBlack); - procedure CleanFolder; + procedure GetOldFiles; + procedure DeleteOldFiles; end; +constructor TThCheck.Create(Suspended: Boolean); +begin + inherited; + OldFiles := TOldFiles.Create; +end; + +destructor TThCheck.Destroy; +begin + OldFiles.Free; + inherited; +end; + procedure TThCheck.Execute; begin FreeOnTerminate := True; @@ -93,17 +123,95 @@ procedure TThCheck.Check; begin Confirm := MessageDlg(Format( 'There is a new version "%s" of the component available at GitHub.'+ - ' Do you want to update it automatically?'+#13+#13+ - '*** Warning: All content in the component''s folder and subfolders will be deleted.', + ' Do you want to update it automatically?', [tag_version]), mtInformation, mbYesNo, 0) = mrYes; end); - if Confirm then + if Confirm and ConfirmOldFiles then Download(tag_zip); + end else Log('Your version is already updated.', True, clGreen); end; +function TThCheck.ConfirmOldFiles: Boolean; +var + Confirm: Boolean; +begin + GetOldFiles; + if OldFiles.Count=0 then Exit(True); //nothing to delete, auto confirm + + Synchronize( + procedure + var + OldFile: TOldFile; + begin + FrmOldFiles := TFrmOldFiles.Create(Application); + for OldFile in OldFiles do + with FrmOldFiles.LFiles.Items.Add do + begin + Caption := ExtractFileName(OldFile.Path); + ImageIndex := IfThen(OldFile.Folder, 1, 0); + end; + Confirm := FrmOldFiles.ShowModal = mrOk; + FrmOldFiles.Free; + end); + + if Confirm then + begin + DeleteOldFiles; + Result := True; + end else + Result := False; +end; + +procedure TThCheck.GetOldFiles; +var + Path, FileName: string; +begin + //directories + for Path in TDirectory.GetDirectories(AppDir) do + begin + {$WARN SYMBOL_PLATFORM OFF} + if TFileAttribute.faHidden in TDirectory.GetAttributes(Path) then Continue; //ignore hidden folders (like .git) + {$WARN SYMBOL_PLATFORM ON} + + OldFiles.Add(Path, True); + end; + + //files + for Path in TDirectory.GetFiles(AppDir) do + begin + FileName := ExtractFileName(Path); + //skip self EXE and CompInstall.ini + if SameText(FileName, ExtractFileName(ParamStr(0))) or + SameText(FileName, INI_FILE_NAME) then Continue; + + OldFiles.Add(Path, False); + end; +end; + +procedure TThCheck.DeleteOldFiles; +var + OldFile: TOldFile; +begin + Log('Cleaning component folder...'); + + for OldFile in OldFiles do + begin + try + if OldFile.Folder then + TDirectory.Delete(OldFile.Path, True) + else + TFile.Delete(OldFile.Path); + except + on E: Exception do + raise Exception.CreateFmt('Could not delete %s %s: %s', + [IfThen(OldFile.Folder, 'folder', 'file'), OldFile.Path, E.Message]); + end; + end; +end; + procedure TThCheck.Download(const URL: string); var Dw: TDownLoadURL; @@ -111,9 +219,6 @@ procedure TThCheck.Download(const URL: string); Z: TZipFile; ZPath, ZFile, ZFileNormalized: string; begin - Log('Cleaning component folder...'); - CleanFolder; - Log('Downloading new version...'); TmpFile := TPath.GetTempFileName; @@ -157,43 +262,13 @@ procedure TThCheck.Download(const URL: string); Log('Update complete!', True, clGreen); end; -procedure TThCheck.CleanFolder; -var - Path, FileName: string; -begin - for Path in TDirectory.GetFiles(AppDir) do - begin - FileName := ExtractFileName(Path); - //skip self EXE and CompInstall.ini - if SameText(FileName, ExtractFileName(ParamStr(0))) or - SameText(FileName, INI_FILE_NAME) then Continue; - - try - TFile.Delete(Path); - except - raise Exception.CreateFmt('Could not delete file %s', [Path]); - end; - end; - - for Path in TDirectory.GetDirectories(AppDir) do - begin - {$WARN SYMBOL_PLATFORM OFF} - if TFileAttribute.faHidden in TDirectory.GetAttributes(Path) then Continue; //ignore hidden folders (like .git) - {$WARN SYMBOL_PLATFORM ON} - - try - TDirectory.Delete(Path, True); - except - raise Exception.CreateFmt('Could not delete folder %s', [Path]); - end; - end; -end; +// procedure CheckGitHubUpdate(const Repository, CurrentVersion: string); var C: TThCheck; begin - if Repository.IsEmpty then Exit; + if Repository.IsEmpty then Exit; Frm.SetButtons(False); @@ -203,4 +278,16 @@ procedure CheckGitHubUpdate(const Repository, CurrentVersion: string); C.Start; end; +{ TOldFiles } + +procedure TOldFiles.Add(const Path: string; Folder: Boolean); +var + OldFile: TOldFile; +begin + OldFile := TOldFile.Create; + OldFile.Path := Path; + OldFile.Folder := Folder; + inherited Add(OldFile); +end; + end. From 3a1d111a7d48ca1c8f5e648bdcaa3eccb7676180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Depin=C3=A9=20Dalpiaz?= Date: Tue, 20 Feb 2024 23:58:06 -0300 Subject: [PATCH 28/28] detect unsupported compiler --- UProcess.pas | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/UProcess.pas b/UProcess.pas index ae18798..45db332 100644 --- a/UProcess.pas +++ b/UProcess.pas @@ -18,6 +18,8 @@ TProcess = class(TThread) MSBuildExe: string; + CompilerNotSupportBuilding: Boolean; + procedure Log(const A: string; bBold: Boolean = True; Color: TColor = clBlack); procedure FindMSBuild; @@ -29,6 +31,7 @@ TProcess = class(TThread) procedure OnLine(const Text: string); function GetOutputPath(const aPlatform: string): string; + function GetBplDirectory: string; end; implementation @@ -37,6 +40,9 @@ implementation UCommon, UCmdExecBuffer, System.IOUtils, Winapi.ShlObj, UFrm; +const + COMPILING_ERROR_VERSION_NOT_SUPORTED = 'This version of the product does not support command line compiling'; + constructor TProcess.Create(D: TDefinitions; const InternalDelphiVersionKey: string; Flag64bit: Boolean); begin @@ -151,6 +157,9 @@ procedure TProcess.CompilePackage(P: TPackage; const aBat, aPlatform: string); if C.ExitCode<>0 then raise Exception.CreateFmt('Error compiling package %s (Exit Code %d)', [P.Name, C.ExitCode]); + + if CompilerNotSupportBuilding then + raise Exception.Create(COMPILING_ERROR_VERSION_NOT_SUPORTED); finally C.Free; end; @@ -165,6 +174,8 @@ procedure TProcess.OnLine(const Text: string); begin //event for command line execution (line-by-line) Log(TrimRight(Text), False); + + if Text.Contains(COMPILING_ERROR_VERSION_NOT_SUPORTED) then CompilerNotSupportBuilding := True; end; procedure TProcess.PublishFiles(P: TPackage; const aPlatform: string); @@ -227,14 +238,11 @@ function GetPublicDocs: string; Result := Path; end; -procedure TProcess.RegisterBPL(const aPackage: string); +function TProcess.GetBplDirectory: string; var - R: TRegistry; BplDir, PublicPrefix: string; FS: TFormatSettings; begin - Log('Install BPL into IDE of '+aPackage); - FS := TFormatSettings.Create; FS.DecimalSeparator := '.'; if StrToFloat(InternalDelphiVersionKey, FS)<=12 then //Delphi XE5 or below @@ -247,6 +255,18 @@ procedure TProcess.RegisterBPL(const aPackage: string); if not DirectoryExists(BplDir) then raise Exception.CreateFmt('Public Delphi folder not found at: %s', [BplDir]); + Result := BplDir; +end; + +procedure TProcess.RegisterBPL(const aPackage: string); +var + R: TRegistry; + BplDir: string; +begin + Log('Install BPL into IDE of '+aPackage); + + BplDir := GetBplDirectory; + R := TRegistry.Create; try R.RootKey := HKEY_CURRENT_USER;