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 const
baseKey = '\Software\Borland'; baseKey = '\Software\Borland';
finalKey = 'Known Packages'; pkgKey = 'Known Packages';
envKey = 'Environment Variables';
var var
path: string;
bpl: string; bpl: string;
descr: string; descr: string;
reg: TRegistry; reg: TRegistry;
@ -22,17 +24,18 @@ var
s: string; s: string;
begin begin
if ParamCount <> 2 then begin if ParamCount <> 3 then begin
WriteLn(''); WriteLn('');
WriteLn('Usage:'); WriteLn('Usage:');
WriteLn(' ' + ExtractFileName(ParamStr(0)) + ' <fully qualified bpl path + filename> <description>'); WriteLn(' ' + ExtractFileName(ParamStr(0)) + ' <fully qualified bpl path> <filename> <description>');
WriteLn(''); WriteLn('');
ExitCode := 1; ExitCode := 1;
Exit; Exit;
end; end;
bpl := ParamStr(1); path := ParamStr(1);
descr := ParamStr(2); bpl := path + '\' + ParamStr(2);
descr := ParamStr(3);
if if
((bpl[1] = '"') and (bpl[Length(bpl)] = '"')) or ((bpl[1] = '"') and (bpl[Length(bpl)] = '"')) or
((bpl[1] = '''') and (bpl[Length(bpl)] = '''')) then begin ((bpl[1] = '''') and (bpl[Length(bpl)] = '''')) then begin
@ -85,7 +88,8 @@ begin
reg.GetKeyNames(versionKeys); reg.GetKeyNames(versionKeys);
reg.CloseKey; reg.CloseKey;
if versionKeys.Count > 0 then for j := 0 to versionKeys.Count - 1 do begin 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; reg.Access := KEY_WRITE;
if reg.KeyExists(s) then begin if reg.KeyExists(s) then begin
if not reg.OpenKey(s, false) then begin if not reg.OpenKey(s, false) then begin
@ -96,6 +100,24 @@ begin
reg.WriteString(bpl, descr); reg.WriteString(bpl, descr);
reg.CloseKey; reg.CloseKey;
end; 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; end;
finally finally
FreeAndNil(versionKeys); FreeAndNil(versionKeys);

View File

@ -87,14 +87,13 @@ goto :start
:install :install
echo Installing component %1, package %2%package_suffix%.bpl. echo Installing component %1, package %2%package_suffix%.bpl.
rem rem
rem Drop a copy of all BPLs in a directory which is in PATH. rem There is a workaround for bug #23225 in IdeBplInstall.exe.
rem This is a workaround for bug #23225 in BDS 2006.
rem (technically a regression since Delphi 7 worked OK.) rem (technically a regression since Delphi 7 worked OK.)
rem 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 rem
copy /y "%base_dir%\components\%1\build\*.bpl" "%USERPROFILE%\My Documents\Borland Studio Projects\Bpl\" >NUL: 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" "%start_dir%\IdeBplInstall\IdeBplInstall.exe" "%base_dir%\components\%1\build" "%2%package_suffix%.bpl" "%1"
set err=%errorlevel% set err=%errorlevel%
echo. echo.
goto :eof goto :eof

View File

@ -186,8 +186,9 @@
</p> </p>
<p> <p>
Open these projects in Delphi 2006 and perform the action listed: Open these projects in Delphi 2006 and perform the action listed.<br />
(Delphi 2007 users will have to open the *.groupproj files instead of *.bdsproj or *.bdsgroup) 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> </p>
<table> <table>
<tr> <tr>