Make the IDE installer script stop dropping binaries in My Documents. The build/clean/etc script uses the "build" folder for output, so tell Delphi to look there for BPL files via a PATH override instead.

This commit is contained in:
rosenfield
2008-03-29 15:45:22 +00:00
parent f9f311adf0
commit 201598de81
4 changed files with 35 additions and 13 deletions

View File

@ -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)) + ' <fully qualified bpl path + filename> <description>');
WriteLn(' ' + ExtractFileName(ParamStr(0)) + ' <fully qualified bpl path> <filename> <description>');
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);

View File

@ -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

View File

@ -186,8 +186,9 @@
</p>
<p>
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.<br />
Note: Delphi 2007 users will have to open the *.groupproj files instead of *.bdsproj or *.bdsgroup.<br />
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.
</p>
<table>
<tr>