From: Andreas H. <ah...@us...> - 2004-04-09 22:36:02
|
Update of /cvsroot/jvcl/dev/JVCL3/install/JVCLInstall In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31647/install/JVCLInstall Modified Files: Compile.pas Compiler5MissingPropertyFix.pas Core.pas DelphiData.pas Intf.pas JVCL3Install.pas JVCLData.pas JVCLInstall.dof JVCLInstall.dpr Main.dfm Main.pas PackageUtils.pas PageBuilder.pas Utils.pas Added Files: CmdLineUtils.pas InstallerConsts.pas Log Message: obj files are now deleted before the BCB compile process starts extracted strings to InstallerConsts.pas better CJcl.dcp compile detection more commandline options (see JVCLInstall.exe --help) temporary files are deleted even if the compile process failed (controllable by cmd-param: --keep-files) AutoUpdate function implemented (cmd-param: --autoupdate) dxgettext support finished Uninstall function implemented new JCL-source directory detection added "edit jvcl.inc" dialog Index: JVCLInstall.dof =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/install/JVCLInstall/JVCLInstall.dof,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JVCLInstall.dof 7 Apr 2004 16:29:36 -0000 1.2 --- JVCLInstall.dof 9 Apr 2004 22:22:31 -0000 1.3 *************** *** 101,105 **** UsePackages=0 [Parameters] ! RunParams=--ignore-ide HostApplication= Launcher= --- 101,105 ---- UsePackages=0 [Parameters] ! RunParams=--ignore-ide --ignore-delphi2 --autoupdat2e HostApplication= Launcher= Index: JVCL3Install.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/install/JVCLInstall/JVCL3Install.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JVCL3Install.pas 8 Apr 2004 17:14:38 -0000 1.3 --- JVCL3Install.pas 9 Apr 2004 22:22:31 -0000 1.4 *************** *** 18,23 **** Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL home page, ! located at http://jvcl.sourceforge.net Known Issues: --- 18,23 ---- Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL ! home page, located at http://jvcl.sourceforge.net Known Issues: *************** *** 39,51 **** TInstallType = (itFreshInstall, itUpdate, itUninstall); - TInstallerOptions = class(TObject) - private - FIgnoreIDE: Boolean; - public - constructor Create; - - property IgnoreIDE: Boolean read FIgnoreIDE; - end; - TInstaller = class(TInterfacedObject, IInstaller) private --- 39,42 ---- *************** *** 56,60 **** FData: TJVCLData; FSelTargets: TList; - FInstallerOptions: TInstallerOptions; function GetJclDir: string; --- 47,50 ---- *************** *** 70,73 **** --- 60,64 ---- function InstallerName: WideString; function FirstPage: IInstallerPage; + function AutoInstall: Boolean; function CanInstall: Boolean; *************** *** 86,90 **** property Data: TJVCLData read FData; - property InstallerOptions: TInstallerOptions read FInstallerOptions; public procedure DoHomepageClick(Sender: TObject); --- 77,80 ---- *************** *** 127,157 **** uses ! PgIDESelection; ! ! resourcestring ! SWelcomeText = ! 'The JEDI Visual Component Library (JVCL) consists of a large collection (currently ca. 500)'#10 + ! 'visual and non-visual components which can be instantly reused in your Delphi, Kylix and'#10 + ! 'C++ Builder projects.'#10 + ! ''#10 + ! 'The library is built upon code donated from the JEDI community. It is reformatted to achieve'#10 + ! 'a common look-and-feel, tested, documented and merged into the library. The library is grouped'#10 + ! 'into several categories such as Enhanced Standard, Visual, Non-Visual, Data Aware and many,'#10 + ! 'many more. The library is released to the public under the terms of the Mozilla Public License'#10 + ! '(MPL) and as such can be freely used in both freeware, shareware, open source and commercial'#10 + ! 'projects.'#10 + ! ''#10 + ! 'Source code files included in the JVCL have a header which explicitly states the license (as'#10 + ! 'is required). However, unless noted otherwise, all files, including those without an MPL'#10 + ! 'header, are subject to the MPL license.'; var WelcomeText: string; ! { TInstaller } function TInstaller.InstallerName: WideString; begin ! Result := 'JVCL 3 Installation'; end; --- 117,130 ---- uses ! PgIDESelection, CmdLineUtils, InstallerConsts; var WelcomeText: string; ! { TInstaller } function TInstaller.InstallerName: WideString; begin ! Result := RsInstallerName; end; *************** *** 169,173 **** InstallType := itFreshInstall; if Data.IsJVCLInstalledAnywhere(3) then ! InstallType := itUpdate; end; --- 142,148 ---- InstallType := itFreshInstall; if Data.IsJVCLInstalledAnywhere(3) then ! InstallType := itUpdate ! else ! CmdOptions.AutoUpdate := False; // auto update not possible end; *************** *** 177,181 **** FData := TJVCLData.Create; FSelTargets := TList.Create; - FInstallerOptions := TInstallerOptions.Create; end; --- 152,155 ---- *************** *** 183,187 **** begin FSelTargets.Free; - FInstallerOptions.Free; FData.Free; inherited Destroy; --- 157,160 ---- *************** *** 204,212 **** Exit; end; ! Result := ExtractFilePath(JVCLDir) + 'Jcl\Source\Common'; if not DirectoryExists(Result) then Result := '' else ! Result := ExtractFilePath(JVCLDir) + 'Jcl'; end; --- 177,185 ---- Exit; end; ! Result := Format(sJclRootDirFromJVCLDir, [ExtractFileDir(JVCLDir)]); if not DirectoryExists(Result) then Result := '' else ! Result := Format(sJclRootDirName, [ExtractFileDir(JVCLDir)]); end; *************** *** 228,234 **** Result := False; if Data.Targets.Count = 0 then ! MessageDlg('No Delphi or BCB is installed. The installer terminates.', mtInformation, [mbOk], 0) ! else if (FindWindow('TAppBuilder', nil) <> 0) and (not InstallerOptions.IgnoreIDE) then ! MessageDlg('Delphi or BCB is running. Terminate the IDE and restart the installer.', mtInformation, [mbOk], 0) else Result := True; --- 201,207 ---- Result := False; if Data.Targets.Count = 0 then ! MessageDlg(RsNoDelphiBcbInstalled, mtInformation, [mbOk], 0) ! else if (FindWindow('TAppBuilder', nil) <> 0) and (not CmdOptions.IgnoreIDE) then // do not localize ! MessageDlg(RsDelphiBcbRunning, mtInformation, [mbOk], 0) else Result := True; *************** *** 244,248 **** if ps <> 0 then Delete(S, 1, ps); ! ShellExecute(Application.Handle, 'open', PChar(S), nil, nil, SW_SHOWNORMAL); end; --- 217,221 ---- if ps <> 0 then Delete(S, 1, ps); ! ShellExecute(Application.Handle, 'open', PChar(S), nil, nil, SW_SHOWNORMAL); // do not localize end; *************** *** 267,270 **** --- 240,248 ---- end; + function TInstaller.AutoInstall: Boolean; + begin + Result := CmdOptions.AutoUpdate; + end; + { TInstallerPage } *************** *** 288,292 **** procedure TInstallerPage.Title(var Title, SubTitle: WideString); begin ! Title := 'JVCL 3 Installation'; SubTitle := ''; end; --- 266,270 ---- procedure TInstallerPage.Title(var Title, SubTitle: WideString); begin ! Title := RsInstallerTitle; SubTitle := ''; end; *************** *** 318,333 **** procedure TWelcomePage.Options(Options: TStrings; var HorzOrientation: THorzOrientation); begin ! Options.Add('New installation / Upgrade from an older version|'); if Installer.Data.IsJVCLInstalledAnywhere(3) then ! Options.Add('Compile already installed packages / Update IDE|') else Options.Add(''); - Options.Add(''); ! { if Installer.Data.IsJVCLInstalledAnywhere(1) then ! Options.Add('Uninstall JVCL 3') ! else} Options.Add(''); end; --- 296,311 ---- procedure TWelcomePage.Options(Options: TStrings; var HorzOrientation: THorzOrientation); begin ! Options.Add(RsInstallMode); if Installer.Data.IsJVCLInstalledAnywhere(3) then ! Options.Add(RsUpdateMode) else Options.Add(''); ! Options.Add(''); ! if Installer.Data.IsJVCLInstalledAnywhere(1) then ! Options.Add(RsUninstallMode) ! else Options.Add(''); end; *************** *** 350,353 **** --- 328,332 ---- var Lines: TStrings; + Filename: string; begin if WelcomeText = '' then *************** *** 355,365 **** Lines := TStringList.Create; try ! if FileExists(Installer.JVCLDir + '\Install\JVCLInstall\welcome.txt') then begin ! Lines.LoadFromFile(Installer.JVCLDir + '\Install\JVCLInstall\welcome.txt'); ! WelcomeText := Lines.Text; Delete(WelcomeText, Length(WelcomeText) - 1, 2); ! end ! else WelcomeText := SWelcomeText; finally --- 334,345 ---- Lines := TStringList.Create; try ! Filename := Format(sWelcomeFilename, [Installer.JVCLDir]); ! if FileExists(Filename) then begin ! Lines.LoadFromFile(Filename); ! WelcomeText := Trim(Lines.Text); Delete(WelcomeText, Length(WelcomeText) - 1, 2); ! end; ! if WelcomeText = '' then WelcomeText := SWelcomeText; finally *************** *** 367,371 **** end; end; ! Result := SWelcomeText; end; --- 347,351 ---- end; end; ! Result := WelcomeText; end; *************** *** 373,395 **** begin inherited Title(Title, SubTitle); ! SubTitle := 'Welcome to the JVCL 3 installation program.'; ! end; ! ! { TInstallerOptions } ! ! constructor TInstallerOptions.Create; ! var ! i: Integer; ! S: string; ! begin ! for i := 1 to ParamCount do ! begin ! S := ParamStr(I); ! if S[1] = '-' then ! begin ! if StartsWith('--ignore-ide', S, True) then ! FIgnoreIDE := True; ! end; ! end; end; --- 353,357 ---- begin inherited Title(Title, SubTitle); ! SubTitle := RsWelcomePageSubTitle; end; Index: Utils.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/install/JVCLInstall/Utils.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Utils.pas 7 Apr 2004 20:13:48 -0000 1.2 --- Utils.pas 9 Apr 2004 22:22:32 -0000 1.3 *************** *** 18,23 **** Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL home page, ! located at http://jvcl.sourceforge.net Known Issues: --- 18,23 ---- Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL ! home page, located at http://jvcl.sourceforge.net Known Issues: *************** *** 50,53 **** --- 50,56 ---- function OpenAtAnchor(const FileName, Anchor: string): Boolean; + procedure FindFiles(const Dir, Mask: string; SubDirs: Boolean; List: TStrings; + const FileExtensions: array of string); + {$IFDEF COMPILER5} type *************** *** 199,211 **** for j := 0 to High(Paths) do for i := List.Count - 1 downto 0 do ! if EndsWith(List[i], Paths[j], True) then ! List.Delete(i); if Add then // add new paths for j := 0 to High(Paths) do ! if Pos(':', Paths[j]) = 0 then ! List.Add(Dir + '\' + Paths[j]) ! else ! List.Add(Paths[j]) end; --- 202,217 ---- for j := 0 to High(Paths) do for i := List.Count - 1 downto 0 do ! if Paths[j] <> '' then ! if EndsWith(List[i], Paths[j], True) then ! List.Delete(i); ! if Add then // add new paths for j := 0 to High(Paths) do ! if Paths[j] <> '' then ! if (Pos(':', Paths[j]) = 0) and (Paths[j][1] <> '$') then ! List.Add(Dir + '\' + Paths[j]) ! else ! List.Add(Paths[j]) end; *************** *** 231,233 **** --- 237,272 ---- {$ENDIF COMPILER5} + function IsInArray(const Value: string; const Args: array of string): Integer; + begin + for Result := 0 to High(Args) do + if CompareText(Value, Args[Result]) = 0 then + Exit; + Result := -1; + end; + + procedure FindFiles(const Dir, Mask: string; SubDirs: Boolean; List: TStrings; + const FileExtensions: array of string); + var + sr: TSearchRec; + begin + if FindFirst(Dir + '\' + Mask, faAnyFile or faDirectory, sr) = 0 then + try + repeat + if sr.Attr and faDirectory <> 0 then + begin + if (sr.Name <> '.') and (sr.Name <> '..') then + if SubDirs then + FindFiles(Dir + '\' + sr.Name, Mask, SubDirs, List, FileExtensions); + end + else + begin + if IsInArray(ExtractFileExt(sr.Name), FileExtensions) <> -1 then + List.Add(Dir + '\' + sr.Name); + end; + until FindNext(sr) <> 0; + finally + FindClose(sr); + end; + end; + end. Index: JVCLData.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/install/JVCLInstall/JVCLData.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JVCLData.pas 7 Apr 2004 20:13:48 -0000 1.3 --- JVCLData.pas 9 Apr 2004 22:22:31 -0000 1.4 *************** *** 18,23 **** Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL home page, ! located at http://jvcl.sourceforge.net Known Issues: --- 18,23 ---- Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL ! home page, located at http://jvcl.sourceforge.net Known Issues: *************** *** 41,47 **** --- 41,51 ---- type TJVCLData = class; + TTargetConfig = class; + TInstallMode = set of TPackageGroupKind; + TDeinstallProgressEvent = procedure(Sender: TObject; const Text: string; Position, Max: Integer) of object; + TDeleteFilesEvent = procedure(TargetConfig: TTargetConfig) of object; TTargetConfig = class(TComponent, ITargetConfig) // TComponent <-> TInterfacedObject *************** *** 53,57 **** FMissingJCL: Boolean; FCompiledJCL: Boolean; - FInstallJCL: Boolean; FInstallJVCL: Boolean; FHppDir: string; --- 57,60 ---- *************** *** 71,74 **** --- 74,78 ---- procedure SetInstallMode(const Value: TInstallMode); function GetFrameworkCount: Integer; + function GetDxgettextDir: string; private { ITargetConfig } *************** *** 94,97 **** --- 98,102 ---- procedure DoCleanPalette(reg: TRegistry; const Name: string; RemoveEmptyPalettes: Boolean); + function RegisterProjectGroupToIDE(ProjectGroup: TProjectGroup): Boolean; public property Target: TCompileTarget read GetTarget; *************** *** 103,107 **** procedure Save; procedure CleanJVCLPalette(RemoveEmptyPalettes: Boolean); ! procedure DeinstallJVCL(Progress: TDeinstallProgressEvent); function CanInstallJVCL: Boolean; --- 108,114 ---- procedure Save; procedure CleanJVCLPalette(RemoveEmptyPalettes: Boolean); ! procedure DeinstallJVCL(Progress: TDeinstallProgressEvent; ! DeleteFiles: TDeleteFilesEvent); ! function RegisterToIDE: Boolean; function CanInstallJVCL: Boolean; *************** *** 133,137 **** --- 140,149 ---- // UnitOutDir specifies the JVCL directory where the .dcu should go. property BplDir: string read GetBplDir write FBplDir; + // BPL directory for this target property DcpDir: string read GetDcpDir write FDcpDir; + // DCP directory for this target + + property DxgettextDir: string read GetDxgettextDir; + // Directory where dxgettext is installed or ''. (special handling for Delphi/BCb 5) property InstalledJVCLVersion: Integer read FInstalledJVCLVersion; *************** *** 143,147 **** property CompiledJCL: Boolean read FCompiledJCL; ! // CompiledJCL is True when CJcl.dcp and CJclVcl.dcp exist for this // target. --- 155,159 ---- property CompiledJCL: Boolean read FCompiledJCL; ! // CompiledJCL is True when D/CJcl.dcp and D/CJclVcl.dcp exist for this // target. *************** *** 153,160 **** // target. public - property InstallJCL: Boolean read FInstallJCL write FInstallJCL; - // InstallJCL specifies if the required JCL should be installed on this - // target. - property InstallJVCL: Boolean read FInstallJVCL write FInstallJVCL; // InstallJVCL specifies if the JVCL should be installed on this target. --- 165,168 ---- *************** *** 202,205 **** --- 210,214 ---- FJVCLConfig: TJVCLConfig; FJVCLDir: string; + FDeleteFilesOnUninstall: Boolean; function GetTargetConfig(Index: Integer): TTargetConfig; *************** *** 215,222 **** function GetCompileOnly: Integer; procedure SetCompileOnly(const Value: Integer); protected function JvclIncFilename: string; procedure Init; virtual; - function RegisterProjectGroupToIDE(ProjectGroup: TProjectGroup): Boolean; public constructor Create; --- 224,231 ---- function GetCompileOnly: Integer; procedure SetCompileOnly(const Value: Integer); + function GetOptionState(Index: Integer): Integer; protected function JvclIncFilename: string; procedure Init; virtual; public constructor Create; *************** *** 224,231 **** procedure SaveTargetConfigs; - function RegisterToIDE(TargetConfig: TTargetConfig): Boolean; - function FindTargetConfig(const TargetSymbol: string): TTargetConfig; - function IsJVCLInstalledAnywhere(MinVersion: Integer): Boolean; --- 233,237 ---- *************** *** 243,246 **** --- 249,254 ---- property CompileOnly: Integer read GetCompileOnly write SetCompileOnly; + property DeleteFilesOnUninstall: Boolean read FDeleteFilesOnUninstall write FDeleteFilesOnUninstall; + property TargetConfig[Index: Integer]: TTargetConfig read GetTargetConfig; property Targets: TCompileTargetList read FTargets; *************** *** 250,257 **** uses ! Utils; resourcestring RsComponentPalettePrefix = 'TJv'; function ReadRegString(RootKey: HKEY; const Key, Name: string): string; --- 258,279 ---- uses ! Utils, CmdLineUtils; resourcestring RsComponentPalettePrefix = 'TJv'; + RsNoJVCLFound = 'No JVCL directory found. Application terminated.'; + RsJVCLInstaller = 'JVCL Installer'; + + RsCleaningPalette = 'Cleaning Palette...'; + RsCleaningPathLists = 'Cleaning Path lists...'; + RsUnregisteringPackages = 'Unregistering packages...'; + RsDeletingFiles = 'Deleting files...'; + RsComplete = 'Complete.'; + + const + sDxgettextRegKey = '\bplfile\Shell\Extract strings\Command'; + sJvclIncFile = '%s\common\jvcl.inc'; + sBCBIncludeDir = '%s\Include\Vcl'; + function ReadRegString(RootKey: HKEY; const Key, Name: string): string; *************** *** 318,391 **** end; ! function TJVCLData.GetBuild: Integer; var i: Integer; begin Result := 0; // false for i := 0 to Targets.Count - 1 do begin ! if TargetConfig[i].Build then ! Result := 1 // true ! else ! if Result = 1 then begin ! Result := 2; // mixed ! Exit; end; end; end; function TJVCLData.GetCleanPalettes: Integer; - var - i: Integer; begin ! Result := 0; // false ! for i := 0 to Targets.Count - 1 do ! begin ! if TargetConfig[i].CleanPalettes then ! Result := 1 // true ! else ! if Result = 1 then ! begin ! Result := 2; // mixed ! Exit; ! end; ! end; end; function TJVCLData.GetCompileOnly: Integer; - var - i: Integer; begin ! Result := 0; // false ! for i := 0 to Targets.Count - 1 do ! begin ! if TargetConfig[i].CompileOnly then ! Result := 1 // true ! else ! if Result = 1 then ! begin ! Result := 2; // mixed ! Exit; ! end; ! end; end; function TJVCLData.GetDeveloperInstall: Integer; - var - i: Integer; begin ! Result := 0; // false ! for i := 0 to Targets.Count - 1 do ! begin ! if TargetConfig[i].DeveloperInstall then ! Result := 1 // true ! else ! if Result = 1 then ! begin ! Result := 2; // mixed ! Exit; ! end; ! end; end; --- 340,403 ---- end; ! function TJVCLData.GetOptionState(Index: Integer): Integer; var i: Integer; + b: Boolean; begin Result := 0; // false for i := 0 to Targets.Count - 1 do begin ! if TargetConfig[i].InstallJVCL then ! begin ! case Index of ! 0: b := TargetConfig[i].Build; ! 1: b := TargetConfig[i].CleanPalettes; ! 2: b := TargetConfig[i].CompileOnly; ! 3: b := TargetConfig[i].DeveloperInstall; ! else ! b := False; ! end; ! if b then begin ! if Result = 3 then ! begin ! Result := 2; ! Exit; ! end; ! Result := 1 // true ! end ! else ! begin ! if Result = 1 then ! begin ! Result := 2; // mixed ! Exit; ! end; ! Result := 3; end; + end; end; + if Result = 3 then + Result := 0; + end; + + function TJVCLData.GetBuild: Integer; + begin + Result := GetOptionState(0); end; function TJVCLData.GetCleanPalettes: Integer; begin ! Result := GetOptionState(1); end; function TJVCLData.GetCompileOnly: Integer; begin ! Result := GetOptionState(2); end; function TJVCLData.GetDeveloperInstall: Integer; begin ! Result := GetOptionState(3); end; *************** *** 395,404 **** begin FJVCLDir := ExtractFileDir(ParamStr(0)); ! while not DirectoryExists(FJVCLDir + '\packages') do begin if Length(FJVCLDir) < 4 then begin ! MessageBox(0, 'No JVCL directory found. Application terminated.', ! 'JVCL Installer', MB_ICONERROR or MB_OK); Halt(1); Break; --- 407,415 ---- begin FJVCLDir := ExtractFileDir(ParamStr(0)); ! while not DirectoryExists(JVCLPackagesDir) do begin if Length(FJVCLDir) < 4 then begin ! MessageBox(0, PChar(RsNoJVCLFound), PChar(RsJVCLInstaller), MB_ICONERROR or MB_OK); Halt(1); Break; *************** *** 417,421 **** function TJVCLData.GetJVCLPackagesXmlDir: string; begin ! Result := JVCLDir + '\packages\xml'; end; --- 428,432 ---- function TJVCLData.GetJVCLPackagesXmlDir: string; begin ! Result := JVCLPackagesDir + '\xml'; end; *************** *** 430,435 **** S: string; begin // dxgettext detection ! S := ReadRegString(HKEY_CLASSES_ROOT, '\bplfile\Shell\Extract strings\Command', ''); FIsDxgettextInstalled := S <> ''; if FIsDxgettextInstalled then --- 441,448 ---- S: string; begin + FDeleteFilesOnUninstall := True; + // dxgettext detection ! S := ReadRegString(HKEY_CLASSES_ROOT, PChar(sDxgettextRegKey), ''); FIsDxgettextInstalled := S <> ''; if FIsDxgettextInstalled then *************** *** 462,562 **** function TJVCLData.JvclIncFilename: string; begin ! Result := JVCLDir + '\common\jvcl.inc'; ! end; ! ! function TJVCLData.RegisterProjectGroupToIDE(ProjectGroup: TProjectGroup): Boolean; ! var ! PackageIndex, i: Integer; ! KnownPackages, DisabledPackages: TDelphiPackageList; ! Target: TCompileTarget; ! begin ! Target := ProjectGroup.Target; ! KnownPackages := Target.KnownPackages; ! DisabledPackages := Target.DisabledPackages; ! ! // remove JVCL packages ! for i := DisabledPackages.Count - 1 downto 0 do ! if StartsWith(DisabledPackages.Items[i].Name, 'Jv', True) then ! DisabledPackages.Delete(i); ! ! for i := KnownPackages.Count - 1 downto 0 do ! if StartsWith(KnownPackages.Items[i].Name, 'Jv', True) then ! KnownPackages.Delete(i); ! ! ! for PackageIndex := 0 to ProjectGroup.Count - 1 do ! begin ! if ProjectGroup.Packages[PackageIndex].Install and ! ProjectGroup.Packages[PackageIndex].Info.IsDesign then ! begin ! KnownPackages.Add( ! ProjectGroup.TargetConfig.BplDir + '\' + ProjectGroup.Packages[PackageIndex].TargetName, ! ProjectGroup.Packages[PackageIndex].Info.Description ! ); ! end; ! end; ! ! ProjectGroup.Target.SavePaths; ! ProjectGroup.Target.SaveKnownPackages; ! Result := True; ! end; ! ! function TJVCLData.RegisterToIDE(TargetConfig: TTargetConfig): Boolean; ! var ! Kind: TPackageGroupKind; ! i: Integer; ! AllPackages, PackageGroup: TProjectGroup; ! begin ! if TargetConfig.InstalledJVCLVersion < 3 then ! TargetConfig.DeinstallJVCL(nil); ! ! // remove old ! AddPaths(TargetConfig.Target.BrowsingPaths, False, ExtractFileDir(JVCLDir), ! ['jvcl3\common', 'jvcl3\run', 'jvcl3\qcommon', 'jvcl3\qrun']); ! AddPaths(TargetConfig.Target.SearchPaths, False, ExtractFileDir(JVCLDir), ! ['jvcl3\common', 'jvcl3\run', 'jvcl3\qcommon', 'jvcl3\qrun']); ! ! ! // common ! AddPaths(TargetConfig.Target.BrowsingPaths, True, ExtractFileDir(JVCLDir), ! ['jvcl3\common']); ! AddPaths(TargetConfig.Target.SearchPaths, True, ExtractFileDir(JVCLDir), ! ['jvcl3\common', TargetConfig.Target.InsertDirMacros(TargetConfig.UnitOutDir)]); ! ! // add ! if pkVCL in TargetConfig.InstallMode then ! begin ! AddPaths(TargetConfig.Target.BrowsingPaths, True, ExtractFileDir(JVCLDir), ! ['jvcl3\run']); ! AddPaths(TargetConfig.Target.SearchPaths, {Add:=}TargetConfig.DeveloperInstall, ExtractFileDir(JVCLDir), ! ['jvcl3\run']); ! end; ! if pkCLX in TargetConfig.InstallMode then ! begin ! AddPaths(TargetConfig.Target.BrowsingPaths, True, ExtractFileDir(JVCLDir), ! ['jvcl3\qcommon', 'jvcl3\qrun']); ! AddPaths(TargetConfig.Target.SearchPaths, {Add:=}TargetConfig.DeveloperInstall, ExtractFileDir(JVCLDir), ! ['jvcl3\qcommon', 'jvcl3\qrun']); ! end; ! ! AllPackages := TProjectGroup.Create(TargetConfig, ''); ! try ! for Kind := pkFirst to pkLast do ! begin ! if Kind in TargetConfig.InstallMode then ! begin ! PackageGroup := TargetConfig.Frameworks.Items[TargetConfig.Target.IsPersonal, Kind]; ! if PackageGroup <> nil then ! begin ! for i := 0 to PackageGroup.Count - 1 do ! if PackageGroup.Packages[i].Install then ! AllPackages.AddPackage(PackageGroup.Packages[i]); ! end; ! end; ! end; ! Result := RegisterProjectGroupToIDE(AllPackages); ! finally ! AllPackages.Free; ! end; end; --- 475,479 ---- function TJVCLData.JvclIncFilename: string; begin ! Result := Format(sJvclIncFile, [JVCLDir]); end; *************** *** 612,616 **** FInstallMode := [pkVcl]; ! FHppDir := Target.RootDir + '\Include\Vcl'; FCleanPalettes := True; FDeveloperInstall := False; --- 529,533 ---- FInstallMode := [pkVcl]; ! FHppDir := Format(sBCBIncludeDir, [Target.RootDir]); FCleanPalettes := True; FDeveloperInstall := False; *************** *** 618,621 **** --- 535,539 ---- FBplDir := Target.BplDir; FDcpDir := Target.DcpDir; + FJCLDir := CmdOptions.JclPath; Init; FInstallJVCL := CanInstallJVCL; *************** *** 634,655 **** // Memory allocations must go to the constructor because Init could be called // more the once. - var - i: Integer; - S: string; - begin - FCompiledJCL := False; ! // parse command line arguments ! for i := 1 to ParamCount do begin ! S := ParamStr(i); ! if StartsWith(S, '--jcl-path=', True) then begin ! Delete(S, 1, 11); ! if DirectoryExists(S) then ! FJCLDir := S; end; end; // identify JVCL version FInstalledJVCLVersion := 0; --- 552,593 ---- // Memory allocations must go to the constructor because Init could be called // more the once. ! function FindJCL(List: TStrings): string; ! var ! i: Integer; ! S: string; begin ! Result := ''; ! for i := 0 to List.Count - 1 do begin ! S := Target.ExpandDirMacros(List[i]); ! if EndsWith(S, '\jcl\source\common', True) then ! begin ! if FileExists(S + '\JclBase.pas') then ! begin ! Result := ExtractFileDir(ExtractFileDir(S)); ! FMissingJCL := False; ! Break; ! end; ! end ! else ! if EndsWith(S, '\jcl\lib\', True) then ! begin ! if FileExists(ExtractFileDir(S) + '\source\common\JclBase.pas') then ! begin ! Result := ExtractFileDir(S); ! FMissingJCL := False; ! Break; ! end; ! end; end; end; + var + S: string; + begin + FInstallMode := []; + FCompiledJCL := False; + // identify JVCL version FInstalledJVCLVersion := 0; *************** *** 658,663 **** else if Target.FindPackageEx('jvcl2') <> nil then FInstalledJVCLVersion := 2 ! else if Target.FindPackageEx('JvCore') <> nil then FInstalledJVCLVersion := 3; // identify JCL version --- 596,611 ---- else if Target.FindPackageEx('jvcl2') <> nil then FInstalledJVCLVersion := 2 ! else if Target.FindPackageEx('JvCore') <> nil then // VCL ! begin ! Include(FInstallMode, pkVCL); ! FInstalledJVCLVersion := 3; ! end; ! if Target.FindPackageEx('JvQCore') <> nil then // CLX ! begin ! Include(FInstallMode, pkCLX); FInstalledJVCLVersion := 3; + end; + if FInstallMode = [] then // if no VCL and no CLX that it is CLX + Include(FInstallMode, pkVCL); // identify JCL version *************** *** 665,714 **** if FJCLDir = '' then begin ! for i := 0 to Target.BrowsingPaths.Count - 1 do ! begin ! if Pos('jcl\source', LowerCase(Target.BrowsingPaths[i])) <> 0 then ! begin ! FJCLDir := Target.ExpandDirMacros(Target.BrowsingPaths[i]); ! if CompareText(ExtractFileName(FJCLDir), 'source') = 0 then ! FJCLDir := ExtractFileDir(FJCLDir) ! else ! FJCLDir := ExtractFileDir(ExtractFileDir(FJCLDir)); ! FInstallJCL := False; ! Break; ! end; ! end; end; ! if FJCLDir = '' then ! begin ! for i := 0 to Target.SearchPaths.Count - 1 do ! begin ! if Pos('jcl\lib', LowerCase(Target.SearchPaths[i])) <> 0 then ! begin ! FJCLDir := Target.ExpandDirMacros(Target.SearchPaths[i]); ! if CompareText(ExtractFileName(FJCLDir), 'lib') = 0 then ! FJCLDir := ExtractFileDir(FJCLDir) ! else ! FJCLDir := ExtractFileDir(ExtractFileDir(FJCLDir)); ! FInstallJCL := False; ! Break; ! end; ! end; ! end; ! if FJCLDir <> '' then ! begin ! if DirectoryExists(JCLDir + '\source\common') then ! FMissingJCL := False; ! end; ! // are CJcl.dcp and CJclVcl.dcp available ! if FileExists(BplDir + '\CJcl.dcp') and ! FileExists(BplDir + '\CJclVcl.dcp') then begin - if FJCLDIr = '' then - FJCLDir := BplDir; - FMissingJCL := False; FCompiledJCL := True; end; end; --- 613,646 ---- if FJCLDir = '' then begin ! FJCLDir := FindJCL(Target.BrowsingPaths); ! if FJCLDir = '' then ! FJCLDir := FindJCL(Target.SearchPaths); end; ! // are C/DJcl.dcp and C/DJclVcl.dcp available ! if Target.Version = 5 then S := '50' else S := ''; ! if (Target.IsBCB and ! FileExists(Format('%s\CJcl%s.dcp', [BplDir, S])) and ! FileExists(Format('%s\CJclVcl%s.dcp', [BplDir, S]))) or ! (not Target.IsBCB and ! FileExists(Format('%s\DJcl%s.dcp', [BplDir, S])) and ! FileExists(Format('%s\DJclVcl%s.dcp', [BplDir, S]))) then begin FCompiledJCL := True; + + if FJCLDir = '' then // replace JCL directory + FJCLDir := BplDir; + + if Target.IsBCB then + FMissingJCL := False + else + begin + // Delphi requires .bpl files + if FileExists(Format('%s\DJcl%s.bpl', [BplDir, S])) and + FileExists(Format('%s\DJclVcl%s.bpl', [BplDir, S])) then + FMissingJCL := False; + end; end; end; *************** *** 957,960 **** --- 889,900 ---- end; + function TTargetConfig.GetDxgettextDir: string; + begin + Result := Owner.DxgettextDir; + if Result <> '' then + if Target.Version = 5 then + Result := Result + '\delphi5'; + end; + procedure TTargetConfig.Save; var *************** *** 972,982 **** Ini := TMemIniFile.Create(ChangeFileExt(ParamStr(0), '.ini')); try ! Ini.WriteString(Target.DisplayName, 'JCLDir', JCLDir); ! Ini.WriteString(Target.DisplayName, 'HPPDir', HppDir); ! Ini.WriteBool(Target.DisplayName, 'DeveloperInstall', DeveloperInstall); ! Ini.WriteBool(Target.DisplayName, 'CleanPalettes', CleanPalettes); for Kind := pkFirst to pkLast do ! Ini.WriteBool(Target.DisplayName, 'InstallMode_' + IntToStr(Integer(Kind)), Kind in InstallMode); ! Ini.WriteBool(Target.DisplayName, 'AutoDependencies', AutoDependencies); Ini.UpdateFile; --- 912,924 ---- Ini := TMemIniFile.Create(ChangeFileExt(ParamStr(0), '.ini')); try ! Ini.WriteString(Target.DisplayName, 'JCLDir', JCLDir); // do not localize ! Ini.WriteString(Target.DisplayName, 'HPPDir', HppDir); // do not localize ! Ini.WriteString(Target.DisplayName, 'BPLDir', BplDir); // do not localize ! Ini.WriteString(Target.DisplayName, 'DCPDir', DcpDir); // do not localize ! Ini.WriteBool(Target.DisplayName, 'DeveloperInstall', DeveloperInstall); // do not localize ! Ini.WriteBool(Target.DisplayName, 'CleanPalettes', CleanPalettes); // do not localize for Kind := pkFirst to pkLast do ! Ini.WriteBool(Target.DisplayName, 'InstallMode_' + IntToStr(Integer(Kind)), Kind in InstallMode); // do not localize ! Ini.WriteBool(Target.DisplayName, 'AutoDependencies', AutoDependencies); // do not localize Ini.UpdateFile; *************** *** 1003,1014 **** try if JCLDir = '' then ! JCLDir := Ini.ReadString(Target.DisplayName, 'JCLDir', JCLDir); ! if HppDir = '' then ! HppDir := Ini.ReadString(Target.DisplayName, 'HPPDir', HppDir); ! DeveloperInstall := Ini.ReadBool(Target.DisplayName, 'DeveloperInstall', DeveloperInstall); ! CleanPalettes := Ini.ReadBool(Target.DisplayName, 'CleanPalettes', CleanPalettes); Mode := []; for Kind := pkFirst to pkLast do ! if Ini.ReadBool(Target.DisplayName, 'InstallMode_' + IntToStr(Integer(Kind)), Kind in InstallMode) then Include(Mode, Kind); InstallMode := Mode; --- 945,957 ---- try if JCLDir = '' then ! JCLDir := Ini.ReadString(Target.DisplayName, 'JCLDir', JCLDir); // do not localize ! HppDir := Ini.ReadString(Target.DisplayName, 'HPPDir', HppDir); // do not localize ! BplDir := Ini.ReadString(Target.DisplayName, 'BPLDir', BplDir); // do not localize ! DcpDir := Ini.ReadString(Target.DisplayName, 'DCPDir', DcpDir); // do not localize ! DeveloperInstall := Ini.ReadBool(Target.DisplayName, 'DeveloperInstall', DeveloperInstall); // do not localize ! CleanPalettes := Ini.ReadBool(Target.DisplayName, 'CleanPalettes', CleanPalettes); // do not localize Mode := []; for Kind := pkFirst to pkLast do ! if Ini.ReadBool(Target.DisplayName, 'InstallMode_' + IntToStr(Integer(Kind)), Kind in InstallMode) then // do not localize Include(Mode, Kind); InstallMode := Mode; *************** *** 1019,1022 **** --- 962,1061 ---- end; + function TTargetConfig.RegisterProjectGroupToIDE(ProjectGroup: TProjectGroup): Boolean; + var + PackageIndex, i: Integer; + KnownPackages, DisabledPackages: TDelphiPackageList; + Target: TCompileTarget; + begin + Target := ProjectGroup.Target; + KnownPackages := Target.KnownPackages; + DisabledPackages := Target.DisabledPackages; + + // remove JVCL packages + for i := DisabledPackages.Count - 1 downto 0 do + if StartsWith(DisabledPackages.Items[i].Name, 'Jv', True) then + DisabledPackages.Delete(i); + + for i := KnownPackages.Count - 1 downto 0 do + if StartsWith(KnownPackages.Items[i].Name, 'Jv', True) then + KnownPackages.Delete(i); + + + for PackageIndex := 0 to ProjectGroup.Count - 1 do + begin + if ProjectGroup.Packages[PackageIndex].Install and + ProjectGroup.Packages[PackageIndex].Info.IsDesign then + begin + KnownPackages.Add( + ProjectGroup.TargetConfig.BplDir + '\' + ProjectGroup.Packages[PackageIndex].TargetName, + ProjectGroup.Packages[PackageIndex].Info.Description + ); + end; + end; + + ProjectGroup.Target.SavePaths; + ProjectGroup.Target.SavePackagesLists; + Result := True; + end; + + function TTargetConfig.RegisterToIDE: Boolean; + var + Kind: TPackageGroupKind; + i: Integer; + AllPackages, PackageGroup: TProjectGroup; + begin + if InstalledJVCLVersion < 3 then + DeinstallJVCL(nil, nil); + + // remove old + AddPaths(Target.BrowsingPaths, False, ExtractFileDir(Owner.JVCLDir), + ['jvcl3\common', 'jvcl3\run', 'jvcl3\qcommon', 'jvcl3\qrun']); + AddPaths(Target.SearchPaths, False, ExtractFileDir(Owner.JVCLDir), + ['jvcl3\common', 'jvcl3\run', 'jvcl3\qcommon', 'jvcl3\qrun']); + + + // common + AddPaths(Target.BrowsingPaths, True, ExtractFileDir(Owner.JVCLDir), + ['jvcl3\common']); + AddPaths(Target.SearchPaths, True, ExtractFileDir(Owner.JVCLDir), + ['jvcl3\common', Target.InsertDirMacros(UnitOutDir)]); + + // add + if pkVCL in InstallMode then + begin + AddPaths(Target.BrowsingPaths, True, ExtractFileDir(Owner.JVCLDir), + ['jvcl3\run']); + AddPaths(Target.SearchPaths, {Add:=}DeveloperInstall, ExtractFileDir(Owner.JVCLDir), + ['jvcl3\run']); + end; + if pkCLX in InstallMode then + begin + AddPaths(Target.BrowsingPaths, True, ExtractFileDir(Owner.JVCLDir), + ['jvcl3\qcommon', 'jvcl3\qrun']); + AddPaths(Target.SearchPaths, {Add:=}DeveloperInstall, ExtractFileDir(Owner.JVCLDir), + ['jvcl3\qcommon', 'jvcl3\qrun']); + end; + + AllPackages := TProjectGroup.Create(Self, ''); + try + for Kind := pkFirst to pkLast do + begin + if Kind in InstallMode then + begin + PackageGroup := Frameworks.Items[Target.IsPersonal, Kind]; + if PackageGroup <> nil then + begin + for i := 0 to PackageGroup.Count - 1 do + if PackageGroup.Packages[i].Install then + AllPackages.AddPackage(PackageGroup.Packages[i]); + end; + end; + end; + Result := RegisterProjectGroupToIDE(AllPackages); + finally + AllPackages.Free; + end; + end; + procedure TTargetConfig.DoCleanPalette(reg: TRegistry; const Name: string; RemoveEmptyPalettes: Boolean); *************** *** 1089,1100 **** end; ! procedure TTargetConfig.DeinstallJVCL(Progress: TDeinstallProgressEvent); var i: Integer; Kind: TPackageGroupKind; - ProjectGroup: TProjectGroup; begin CleanJVCLPalette(True); for i := Target.BrowsingPaths.Count - 1 downto 0 do if Pos('\jvpack\', AnsiLowerCase(Target.BrowsingPaths[i])) <> 0 then --- 1128,1156 ---- end; ! procedure TTargetConfig.DeinstallJVCL(Progress: TDeinstallProgressEvent; ! DeleteFiles: TDeleteFilesEvent); ! ! procedure DoProgress(const Text: string; Position, Max: Integer); ! begin ! if Assigned(Progress) then ! Progress(Self, Text, Position, Max); ! end; ! var + MaxSteps: Integer; i: Integer; + Ini: TMemIniFile; Kind: TPackageGroupKind; begin + MaxSteps := 4; + if not Assigned(DeleteFiles) then + Dec(MaxSteps); + + {**}DoProgress(RsCleaningPalette, 0, MaxSteps); CleanJVCLPalette(True); + {**}DoProgress(RsCleaningPathLists, 1, MaxSteps); + + // remove JVCL 1 and 2 directories for i := Target.BrowsingPaths.Count - 1 downto 0 do if Pos('\jvpack\', AnsiLowerCase(Target.BrowsingPaths[i])) <> 0 then *************** *** 1105,1122 **** Target.SearchPaths.Delete(i); - for Kind := pkFirst to pkLast do - begin - ProjectGroup := Frameworks.Items[Target.IsPersonal, Kind]; - if ProjectGroup <> nil then - begin ! for i := Target.KnownPackages.Count - 1 downto 0 do ! begin ! end; end; end; end; --- 1161,1210 ---- Target.SearchPaths.Delete(i); ! // remove JVCL 3 directories ! AddPaths(Target.BrowsingPaths, {Add:=}False, ExtractFileDir(Owner.JVCLDir), ! ['jvcl3\common', 'jvcl3\design', 'jvcl3\run', 'jvcl3\qcommon', 'jvcl3\qdesign', 'jvcl3\qrun']); ! AddPaths(Target.SearchPaths, {Add:=}False, ExtractFileDir(Owner.JVCLDir), ! ['jvcl3\common', 'jvcl3\design', 'jvcl3\run', 'jvcl3\qcommon', 'jvcl3\qdesign', 'jvcl3\qrun', ! Target.InsertDirMacros(UnitOutDir), UnitOutDir]); ! Target.SavePaths; ! {**}DoProgress(RsUnregisteringPackages, 2, MaxSteps); ! // remove JVCL packages ! with Target do ! begin ! for i := DisabledPackages.Count - 1 downto 0 do ! if StartsWith(DisabledPackages.Items[i].Name, 'Jv', True) then ! DisabledPackages.Delete(i); + for i := KnownPackages.Count - 1 downto 0 do + if StartsWith(KnownPackages.Items[i].Name, 'Jv', True) then + KnownPackages.Delete(i); + end; + Target.SavePackagesLists; + + // clean ini file + Ini := TMemIniFile.Create(ChangeFileExt(ParamStr(0), '.ini')); + try + Ini.EraseSection(Target.DisplayName); + for Kind := pkFirst to pkLast do + begin + if Frameworks.Items[False, Kind] <> nil then + Ini.EraseSection(Frameworks.Items[False, Kind].BpgName); + if Frameworks.Items[True, Kind] <> nil then + Ini.EraseSection(Frameworks.Items[True, Kind].BpgName); end; + Ini.UpdateFile; + finally + Ini.Free; + end; + + if Assigned(DeleteFiles) then + begin + {**}DoProgress(RsDeletingFiles, 3, MaxSteps); + DeleteFiles(Self); end; + {**}DoProgress(RsComplete, MaxSteps, MaxSteps); end; Index: JVCLInstall.dpr =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/install/JVCLInstall/JVCLInstall.dpr,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JVCLInstall.dpr 6 Apr 2004 16:39:33 -0000 1.1 --- JVCLInstall.dpr 9 Apr 2004 22:22:31 -0000 1.2 *************** *** 11,15 **** The Original Code is: JVCLInstall.dpr, released on 2004-03-29. ! The Initial Developer of the Original Code is Andreas Hausladen [And...@gm...] Portions created by Andreas Hausladen are Copyright (C) 2004 Andreas Hausladen. All Rights Reserved. --- 11,16 ---- The Original Code is: JVCLInstall.dpr, released on 2004-03-29. ! The Initial Developer of the Original Code is Andreas Hausladen ! [Andreas dott Hausladen att gmx dott de] Portions created by Andreas Hausladen are Copyright (C) 2004 Andreas Hausladen. All Rights Reserved. *************** *** 17,22 **** Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL home page, ! located at http://jvcl.sourceforge.net Known Issues: --- 18,23 ---- Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL ! home page, located at http://jvcl.sourceforge.net Known Issues: *************** *** 59,63 **** FrmInstall in 'Frames\FrmInstall.pas' {FrameInstall: TFrame}, PgInstall in 'Pages\PgInstall.pas', ! PgUninstall in 'Pages\PgUninstall.pas'; {$R *.res} --- 60,67 ---- FrmInstall in 'Frames\FrmInstall.pas' {FrameInstall: TFrame}, PgInstall in 'Pages\PgInstall.pas', ! PgUninstall in 'Pages\PgUninstall.pas', ! MainConfig in 'Helpers\MainConfig.pas' {FormJvclIncConfig}, ! CmdLineUtils in 'CmdLineUtils.pas', ! InstallerConsts in 'InstallerConsts.pas'; {$R *.res} *************** *** 66,69 **** --- 70,74 ---- Application.Initialize; Application.CreateForm(TFormMain, FormMain); + Application.CreateForm(TFormJvclIncConfig, FormJvclIncConfig); Application.Run; end. Index: Core.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/install/JVCLInstall/Core.pas,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Core.pas 6 Apr 2004 16:39:33 -0000 1.1 --- Core.pas 9 Apr 2004 22:22:31 -0000 1.2 *************** *** 18,23 **** Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL home page, ! located at http://jvcl.sourceforge.net Known Issues: --- 18,23 ---- Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL ! home page, located at http://jvcl.sourceforge.net Known Issues: *************** *** 127,130 **** --- 127,133 ---- IInstallPage = interface(IInstallerPage) ['{5DFD17E9-1DCE-444F-9B6F-FC27B79DFBFF}'] + procedure Abort; + { The package installer calls Abort when the installation process should + be aborted. } end; *************** *** 153,156 **** --- 156,163 ---- procedure Finish; { Is called when the finish button is pressed. } + + function AutoInstall: Boolean; + { Return True if the package installer should step through all pages + automatically until it reaches a IInstallPage or IUninstallPage. } end; --- NEW FILE: InstallerConsts.pas --- {----------------------------------------------------------------------------- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is: InstallerConsts.pas, released on 2004-04-09. The Initial Developer of the Original Code is Andreas Hausladen (Andreas dott Hausladen att gmx dott de) Portions created by Andreas Hausladen are Copyright (C) 2004 Andreas Hausladen. All Rights Reserved. Contributor(s): - You may retrieve the latest version of this file at the Project JEDI's JVCL home page, located at http://jvcl.sourceforge.net Known Issues: -----------------------------------------------------------------------------} // $Id: InstallerConsts.pas,v 1.1 2004/04/09 22:22:32 ahuser Exp $ unit InstallerConsts; interface resourcestring // JVCL3Install.pas SWelcomeText = 'The JEDI Visual Component Library (JVCL) consists of a large collection (currently ca. 500)'#10 + 'visual and non-visual components which can be instantly reused in your Delphi, Kylix and'#10 + 'C++ Builder projects.'#10 + ''#10 + 'The library is built upon code donated from the JEDI community. It is reformatted to achieve'#10 + 'a common look-and-feel, tested, documented and merged into the library. The library is grouped'#10 + 'into several categories such as Enhanced Standard, Visual, Non-Visual, Data Aware and many,'#10 + 'many more. The library is released to the public under the terms of the Mozilla Public License'#10 + '(MPL) and as such can be freely used in both freeware, shareware, open source and commercial'#10 + 'projects.'#10 + ''#10 + 'Source code files included in the JVCL have a header which explicitly states the license (as'#10 + 'is required). However, unless noted otherwise, all files, including those without an MPL'#10 + 'header, are subject to the MPL license.'; RsInstallerName = 'JVCL 3 Installation'; RsInstallerTitle = 'JVCL 3 Installation'; RsWelcomePageSubTitle = 'Welcome to the JVCL 3 installation program.'; RsNoDelphiBcbInstalled = 'No Delphi or BCB is installed. The installer terminates.'; RsDelphiBcbRunning = 'Delphi or BCB is running. Terminate the IDE and restart the installer.'; RsInstallMode = 'New installation / Upgrade from an older version|Change package selection.'; RsUpdateMode = 'Compile already installed packages / Update IDE|'; RsUninstallMode = 'Uninstall JVCL'; const sWelcomeFilename = '%s\Install\JVCLInstall\welcome.txt'; // sJclRootDirXx is used to find the "$(JVCL)\..\JCL" directory sJclRootDirName = '%s\Jcl'; // do not localize sJclRootDirFromJVCLDir = sJclRootDirName + '\Source\Common'; // do not localize // PgUninstall.pas resourcestring RsUninstallPageTitle = 'Uninstalling JVCL 3'; RsUninstallPageSubTitle = 'Uninstalling the JVCL 3 from the selected Delphi and BCB versions.'; // FrmDirEditBrowse.pas resourcestring RsSelectJCLDir = 'Select the directory where the JCL source is.'; // FrmInstall.pas resourcestring RsErrorOpeningFile = 'Error opening the file.'; RsCompileError = 'An error occured while compiling the packages.'; RsComplete = 'Complete.'; RsError = '%s - Error'; RsCompiling = 'Compiling: %s'; // FrmPackageSelection.pas resourcestring RsSelectTargetIDE = 'Select an IDE'; RsPkgInfoRequires = 'Requires:'; RsPkgInfoContains = 'Contains:'; // FrmUninstall.pas resourcestring RsDeletingFile = 'Deleting %s'; // PgInstall.pas resourcestring RsInstallPageTitle = 'Compiling packages'; RsInstallPageSubTitle = 'The selected packages are compiling for the selected Delphi and BCB versions.'; // PgPackageSelection.pas resourcestring RsPackageSelectionPageTitle = 'Select packages'; RsPackageSelectionPageSubTitle = 'Select all packages for the target IDEs which should be installed.'; // PgSummary.pas resourcestring RsSummaryPageTitle = 'Summary'; RsSummaryPageSubTitleInstall = 'The following actions will be done through installation.'; RsSummaryPageSubTitleUpdate = 'The following actions will be done through the update.'; RsSummaryPageSubTitleUninstall = 'The following actions will be done through uninstallation.'; RsInstallForTarget = 'Install JVCL 3 for'; RsInstallForFrameworks = 'Install for frameworks:'; RsBplOutputDirectory = 'BPL output directory:'; RsDcpOutputDirectory = 'DCP output directory:'; RsLibOutputDirectory = 'LIB output directory:'; RsHppOutputDirectory = 'HPP output directory:'; RsBuildPackages = 'Build packages'; RsCompilePackages = 'Compile packages'; RsCleanComponentPalettes = 'Clean component palettes'; RsAddToBrowsePath = 'Add to browse path:'; RsAddToSearchPath = 'Add to search path:'; RsAddToLibraryPath = 'Add to library path:'; RsAddToIncludePath = 'Add to include path:'; RsUninstallFromTarget = 'Uninstall from'; RsRemove = 'Remove'; RsUnregister = 'Unregister'; RsJVCLPalettes = 'JVCL palettes'; RsJVCLDirsFromPathLists = 'JVCL directories from path lists'; RsJVCLPackages = 'JVCL 3 packages'; RsJVCLFiles = 'JVCL 3 files'; const // sJVCLMacroXxx are displayed in the Summary page. They are not used by code. sJVCLMacroCommonDir = '$(JVCL)\common'; // do not localize sJVCLMacroRunDir = '$(JVCL)\run'; // do not localize sJVCLMacroClxDirs = '$(JVCL)\qcommon;$(JVCL)\qrun'; // do not localize // PgConfig.pas resourcestring RsConfigPageTitle = 'Configuration'; RsConfigPageSubTitle = 'Choose the compilation options and global options for all targets'; // PgIDESelection.pas resourcestring RsSelectionPageTitle = 'Choose IDE targets'; RsSelectionPageSubTitleInstall = 'Select all target IDEs where the JVCL should be installed.'; RsSelectionPageSubTitleUpdate = 'Select all target IDEs where the JVCL should be updated.'; RsSelectionPageSubTitleUninstall = 'Select all target IDEs from which the JVCL should be uninstalled.'; RsErrorInstallingJCL = 'Cannot start the JCL Installer.'; RsDelphiBCBUpdateRequired = 'Delphi/BCB update required'; RsDownloadUpdatesFrom = 'Download from'; RsJCLVersionRequired = 'JCL 1.9 or higher required'; RsDownloadOrSelectJclDir = 'Download or select a JCL directory.|' + 'http://homepages.borland.com/jedi/jcl/'; // http://jcl.sourceforge.net RsInstalledJVCLVersion = 'installed JVCL version: %d'; RsInstallJCL = 'Install JCL'; RsNoJclVersionFound = 'No JCL 1.9 found.'; RsJCLDirectoryCaption = '&JCL directory:'; RsDeleteJVCLFilesCaption = '&Delete JVCL files (dcu,bpl,dcp, obj,bpi,lib,tds)'; // Main.pas resourcestring RsBtnInstall = '&Install'; RsBtnUninstall = '&Uninstall'; RsNoPackageInstaller = 'Application error. No PackageInstaller created.'; RsCancelInstallation = 'Do you really want to cancel the installation?'; RsJediHomepage = 'http://projectjedi.sourceforge.net'; RsJVCLHomepage = 'http://jvcl.sourceforge.net'; implementation end. Index: Compile.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/install/JVCLInstall/Compile.pas,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Compile.pas 8 Apr 2004 17:14:38 -0000 1.4 --- Compile.pas 9 Apr 2004 22:22:31 -0000 1.5 *************** *** 18,23 **** Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL home page, ! located at http://jvcl.sourceforge.net Known Issues: --- 18,23 ---- Contributor(s): - ! You may retrieve the latest version of this file at the Project JEDI's JVCL ! home page, located at http://jvcl.sourceforge.net Known Issues: *************** *** 120,124 **** const ProjectMax = 5; ! var Compiler: TJVCLCompiler = nil; --- 120,124 ---- const ProjectMax = 5; ! var Compiler: TJVCLCompiler = nil; *************** *** 127,131 **** uses ! JvConsts; resourcestring --- 127,131 ---- uses ! CmdLineUtils, JvConsts; resourcestring *************** *** 136,139 **** --- 136,140 ---- RsFinished = 'Finished.'; RsCompilingJCL = 'Compiling JCL dcp files...'; + RsGeneratePackages = '[Generating: Packages]'; const *************** *** 142,148 **** ); - resourcestring - RsGeneratePackages = '[Generating: Packages]'; - { TJVCLCompiler } --- 143,146 ---- *************** *** 311,318 **** /// </summary> function TJVCLCompiler.PrepareJCL(Force: Boolean): Boolean; var Args: string; i, LineNum: Integer; ! ErrorFileName, TargetPkgDir, TargetXmlDir: string; ErrorLines: TStrings; begin --- 309,325 ---- /// </summary> function TJVCLCompiler.PrepareJCL(Force: Boolean): Boolean; + + function CompareFileAge(const Filename1Fmt: string; const Args1: array of const; + const Filename2Fmt: string; const Args2: array of const): Integer; + begin + Result := FileAge(Format(Filename1Fmt, Args1)) + - + FileAge(Format(Filename2Fmt, Args2)); + end; + var Args: string; i, LineNum: Integer; ! ErrorFileName, TargetPkgDir, TargetXmlDir, S: string; ErrorLines: TStrings; begin *************** *** 329,337 **** // Are the .dcp files newer than the .bpk files ! if (not Force) and (not Data.TargetConfig[i].Build) and ! FileExists(Data.TargetConfig[i].BplDir + '\CJcl.dcp') and ! FileExists(Data.TargetConfig[i].BplDir + '\CJclVcl.dcp') and ! (FileAge(Data.TargetConfig[i].BplDir + '\CJcl.dcp') >= FileAge(TargetXmlDir + '\Jcl-R.xml')) then ! Continue; SetEnvironmentVariable('JCLROOT', PChar(Data.TargetConfig[i].JCLDir)); --- 336,349 ---- // Are the .dcp files newer than the .bpk files ! with Data.TargetConfig[i] do ! begin ! if Target.Version = 5 then S := '50' else S := ''; ! if (not Force) and (not Build) and CompiledJCL and ! (CompareFileAge('%s\CJcl%s.dcp', [BplDir, S], ! '%s\Jcl-R.xml', [TargetXmlDir]) >= 0) and ! (CompareFileAge('%s\CJclVcl%s.dcp', [BplDir, S], ! '%s\JclVcl-R.xml', [TargetXmlDir]) >= 0) then ! Continue; ! end; SetEnvironmentVariable('JCLROOT', PChar(Data.TargetConfig[i].JCLDir)); *************** *** 341,377 **** DoPackageProgress(nil, RsCompilingJCL, 0, 3); ! // copy template for PackageGenerator ! if CaptureExecute('"' + Data.Targets[i].Make + '"', Args + ' -s Templates', ! Data.JVCLPackagesDir + '\bin', CaptureLine) <> 0 then ! Exit; ! DoPackageProgress(nil, RsCompilingJCL, 1, 3); ! // generate packages ! Result := GeneratePackages('JCL', 'c' + IntToStr(Data.Targets[i].Version), ! Data.TargetConfig[i].JCLDir + '\packages'); ! DoPackageProgress(nil, RsCompilingJCL, 2, 3); ! // compile dcp files ! if CaptureExecute('"' + Data.Targets[i].Make + '"', Args + ' -s Compile', ! Data.JVCLPackagesDir + '\bin', CaptureLine) <> 0 then ! begin ! if FileExists(ErrorFileName) then begin ! ErrorLines := TStringList.Create; ! try ! ErrorLines.LoadFromFile(ErrorFileName); ! for LineNum := 0 to ErrorLines.Count - 1 do ! CaptureLine(ErrorLines[LineNum], FAborted); ! finally ! ErrorLines.Free; end; end; ! Exit; ! end; ! // clean ! CaptureExecute('"' + Data.Targets[i].Make + '"', Args + ' -s CleanJcl', ! Data.JVCLPackagesDir + '\bin', CaptureLine); ! DeleteFile(ErrorFileName); DoTargetProgress(Data.TargetConfig[i], 0, 100); --- 353,392 ---- DoPackageProgress(nil, RsCompilingJCL, 0, 3); ! try ! // copy template for PackageGenerator ! if CaptureExecute('"' + Data.Targets[i].Make + '"', Args + ' -s Templates', ! Data.JVCLPackagesDir + '\bin', CaptureLine) <> 0 then ! Exit; ! DoPackageProgress(nil, RsCompilingJCL, 1, 3); ! // generate packages ! Result := GeneratePackages('JCL', 'c' + IntToStr(Data.Targets[i].Version), ! Data.TargetConfig[i].JCLDir + '\packages'); ! DoPackageProgress(nil, RsCompilingJCL, 2, 3); ! // compile dcp files ! if CaptureExecute('"' + Data.Targets[i].Make + '"', Args + ' -s Compile', ! Data.JVCLPackagesDir + '\bin', CaptureLine, True) <> 0 then begin ! if FileExists(ErrorFileName) then ! begin ! ErrorLines := TStringList.Create; ! try ! ErrorLines.LoadFromFile(ErrorFileName); ! for LineNum := 0 to ErrorLines.Count - 1 do ! CaptureLine(ErrorLines[LineNum], FAborted); ! finally ! ErrorLines.Free; ! end; end; + Exit; end; ! finally ! // clean ! CaptureExecute('"' + Data.Targets[i].Make + '"', Args + ' -s CleanJcl', ! Data.JVCLPackagesDir + '\bin', CaptureLine); ! DeleteFile(ErrorFileName); ! end; DoTargetProgress(Data.TargetConfig[i], 0, 100); *************** *** 413,417 **** SetLength(TargetConfigs, Count); ! // compile all targets for i := 0 to Count - 1 do begin --- 428,432 ---- SetLength(TargetConfigs, Count); ! // compile all targets for i := 0 to Count - 1 do begin *************** *** 429,436 **** --- 444,470 ---- /// </summary> function TJVCLCompiler.CompileTarget(TargetConfig: TTargetConfig): Boolean; + var + ObjFiles: TStrings; + i: Integer; begin Result := True; FOutput.Clear; + if TargetConfig.Target.IsBCB and TargetConfig.Build then + begin + // Delete all .obj files because dcc32.exe -JPHNE does not create new .obj + // files if they already exist. And as a result interface changes in a unit + // let the bcc32.exe compiler fail. + ObjFiles := TStringList.Create; + try + FindFiles(TargetConfig.UnitOutDir, '*.*', True, ObjFiles, ['.obj']); + for i := 0 to ObjFiles.Count - 1 do + De... [truncated message content] |