diff --git a/extra/IdeBplInstall/IdeBplInstall.dpr b/extra/IdeBplInstall/IdeBplInstall.dpr index d7f7399d..ccbadd7d 100644 --- a/extra/IdeBplInstall/IdeBplInstall.dpr +++ b/extra/IdeBplInstall/IdeBplInstall.dpr @@ -10,9 +10,11 @@ uses const baseKey = '\Software\Borland'; - finalKey = 'Known Packages'; + pkgKey = 'Known Packages'; + envKey = 'Environment Variables'; var + path: string; bpl: string; descr: string; reg: TRegistry; @@ -22,17 +24,18 @@ var s: string; begin - if ParamCount <> 2 then begin + if ParamCount <> 3 then begin WriteLn(''); WriteLn('Usage:'); - WriteLn(' ' + ExtractFileName(ParamStr(0)) + ' '); + WriteLn(' ' + ExtractFileName(ParamStr(0)) + ' '); WriteLn(''); ExitCode := 1; Exit; end; - bpl := ParamStr(1); - descr := ParamStr(2); + path := ParamStr(1); + bpl := path + '\' + ParamStr(2); + descr := ParamStr(3); if ((bpl[1] = '"') and (bpl[Length(bpl)] = '"')) or ((bpl[1] = '''') and (bpl[Length(bpl)] = '''')) then begin @@ -85,7 +88,8 @@ begin reg.GetKeyNames(versionKeys); reg.CloseKey; if versionKeys.Count > 0 then for j := 0 to versionKeys.Count - 1 do begin - s := baseKey + '\' + productKeys[i] + '\' + versionKeys[j] + '\' + finalKey; + // Install package in IDE. + s := baseKey + '\' + productKeys[i] + '\' + versionKeys[j] + '\' + pkgKey; reg.Access := KEY_WRITE; if reg.KeyExists(s) then begin if not reg.OpenKey(s, false) then begin @@ -96,6 +100,24 @@ begin reg.WriteString(bpl, descr); reg.CloseKey; end; + // Work around Delphi bug #23225. + s := baseKey + '\' + productKeys[i] + '\' + versionKeys[j] + '\' + envKey; + reg.Access := KEY_READ or KEY_WRITE; + if reg.KeyExists(s) then begin + if not reg.OpenKey(s, false) then begin + WriteLn('Error: Could not open key ' + s + '.'); + ExitCode := 6; + Exit; + end; + s := reg.ReadString('Path'); + s := StringReplace(s, path, '', [rfReplaceAll, rfIgnoreCase]); + s := s + ';' + path; + while Pos(';;', s) > 0 do s := StringReplace(s, ';;', ';', [rfReplaceAll]); + while (Length(s) > 0) and (s[1] = ';') do Delete(s, 1, 1); + while (Length(s) > 0) and (s[Length(s)] = ';') do Delete(s, 1, 1); + reg.WriteString('Path', s); + reg.CloseKey; + end; end; finally FreeAndNil(versionKeys); diff --git a/extra/IdeBplInstall/IdeBplInstall.exe b/extra/IdeBplInstall/IdeBplInstall.exe index 3535b8a4..87fafe4b 100644 Binary files a/extra/IdeBplInstall/IdeBplInstall.exe and b/extra/IdeBplInstall/IdeBplInstall.exe differ diff --git a/extra/install_ide_components.cmd b/extra/install_ide_components.cmd index effee834..d63ba4ad 100644 --- a/extra/install_ide_components.cmd +++ b/extra/install_ide_components.cmd @@ -87,14 +87,13 @@ goto :start :install echo Installing component %1, package %2%package_suffix%.bpl. rem -rem Drop a copy of all BPLs in a directory which is in PATH. -rem This is a workaround for bug #23225 in BDS 2006. +rem There is a workaround for bug #23225 in IdeBplInstall.exe. rem (technically a regression since Delphi 7 worked OK.) rem -rem see here: http://qc.borland.com/wc/qcmain.aspx?d=23225 +rem see: http://qc.borland.com/wc/qcmain.aspx?d=23225 rem -copy /y "%base_dir%\components\%1\build\*.bpl" "%USERPROFILE%\My Documents\Borland Studio Projects\Bpl\" >NUL: -"%start_dir%\IdeBplInstall\IdeBplInstall.exe" "%base_dir%\components\%1\build\%2%package_suffix%.bpl" "%1" +del /f /q "%USERPROFILE%\My Documents\Borland Studio Projects\Bpl\%2%package_suffix%.bpl" 2>NUL: +"%start_dir%\IdeBplInstall\IdeBplInstall.exe" "%base_dir%\components\%1\build" "%2%package_suffix%.bpl" "%1" set err=%errorlevel% echo. goto :eof diff --git a/readme.html b/readme.html index 6d03ea99..d5663444 100644 --- a/readme.html +++ b/readme.html @@ -186,8 +186,9 @@

- Open these projects in Delphi 2006 and perform the action listed: - (Delphi 2007 users will have to open the *.groupproj files instead of *.bdsproj or *.bdsgroup) + Open these projects in Delphi 2006 and perform the action listed.
+ Note: Delphi 2007 users will have to open the *.groupproj files instead of *.bdsproj or *.bdsgroup.
+ Note: Before you can install components into the IDE, you will also need to either (a) copy the generated BPL files from the build folders to somewhere in your path, or (b) add the build folders to your Delphi PATH environment variable override. The override can be found under Tools --> Options --> Environment Options --> Environment Variables.