From: <ah...@us...> - 2012-09-06 19:21:41
|
Revision: 3870 http://jcl.svn.sourceforge.net/jcl/?rev=3870&view=rev Author: ahuser Date: 2012-09-06 19:21:34 +0000 (Thu, 06 Sep 2012) Log Message: ----------- Create Settings.iss on the fly with current JCL version number Modified Paths: -------------- trunk/thirdparty/InnoSetup/BuildSetup.bat trunk/thirdparty/InnoSetup/CompInstall/CompInst.pas trunk/thirdparty/InnoSetup/CompInstall.dll trunk/thirdparty/InnoSetup/ComponentInstallerScript.iss trunk/thirdparty/InnoSetup/Install.iss Added Paths: ----------- trunk/thirdparty/InnoSetup/GenerateSettings.dpr Removed Paths: ------------- trunk/thirdparty/InnoSetup/Settings.iss Modified: trunk/thirdparty/InnoSetup/BuildSetup.bat =================================================================== --- trunk/thirdparty/InnoSetup/BuildSetup.bat 2012-09-05 22:01:26 UTC (rev 3869) +++ trunk/thirdparty/InnoSetup/BuildSetup.bat 2012-09-06 19:21:34 UTC (rev 3870) @@ -1,6 +1,7 @@ @echo off SETLOCAL -SET SETUPDIR=%CD% +SET CURDIR=%CD% +SET SETUPDIR=%~dp0 :: ========================================================== :: rsvars.bat check @@ -15,8 +16,12 @@ SET InnoSetupDir=%SETUPDIR%\InnoSetup :: == Sanity checks == +if not exist "%SETUPDIR%\Install.iss" goto NoInstallDir +if exist "%JCLROOT%\source\common\JclBase.pas" goto JclRootDirFound +:: Try the "thirdparty" checkout +SET JCLROOT=%SETUPDIR%\..\..\jcl if not exist "%JCLROOT%\source\common\JclBase.pas" goto NoRootDirFound -if not exist "%SETUPDIR%\Install.iss" goto NoInstallDir +:JclRootDirFound :: ========================================================== @@ -31,12 +36,13 @@ md "%JCLBUILTDIR%\bpl" 2>NUL >NUL :: == Delete all files in the output directories, we always want to rebuild them == +if "-%JCLBUILTDIR%" == "-" GOTO NoRootDirFound del /Q /S "%JCLBUILTDIR%\*.*" 2>NUL >NUL :: == Compile the files SET JclLib=%JCLBUILTDIR%\lib\win32 -cd %JCLROOT% +cd /d %JCLROOT% msbuild make.proj "/p:Platform=win32" "/p:HppOutDir=%JCLBUILTDIR%\hpp" "/p:DcuOutDir=%JCLBUILTDIR%\lib\win32" "/p:BplOutDir=%JCLBUILTDIR%\bpl" if ERRORLEVEL 1 goto Failed if not exist "%BDS%\bin\dcc64.exe" goto NoWin64 @@ -45,8 +51,15 @@ :: For 64bit we have to install both win32 and lib\win64 SET JclLib=%JCLBUILTDIR%\lib :NoWin64 -cd %SETUPDIR% +cd /d %SETUPDIR% +:: Generate Settings.iss file +del Settings.iss >NUL 2>NUL +dcc32 -E. "-U%JCLBUILTDIR%\lib\win32;%BDS%\lib\release;%BDS%\lib;%BDS%\lib\win32\release" GenerateSettings.dpr +if ERRORLEVEL 1 goto Failed +GenerateSettings.exe "%JCLROOT%" +del GenerateSettings.exe >NUL + :: ========================================================== :: Compile Setup :: ========================================================== @@ -69,5 +82,5 @@ pause :Leave -cd %SETUPDIR% -ENDLOCAL \ No newline at end of file +cd /d %CURDIR% +ENDLOCAL Modified: trunk/thirdparty/InnoSetup/CompInstall/CompInst.pas =================================================================== --- trunk/thirdparty/InnoSetup/CompInstall/CompInst.pas 2012-09-05 22:01:26 UTC (rev 3869) +++ trunk/thirdparty/InnoSetup/CompInstall/CompInst.pas 2012-09-06 19:21:34 UTC (rev 3870) @@ -101,9 +101,10 @@ Inst: TJclBorRADToolInstallation; VStr: string; ConfigDataLocation: string; + VersionNum: Integer; begin + Result := 0; try - Result := Installations.Count; for I := 0 to Installations.Count - 1 do begin Inst := Installations[I]; @@ -112,10 +113,12 @@ if (ConfigDataLocation <> '') and (ConfigDataLocation[1] = PathDelim) then ConfigDataLocation := Copy(ConfigDataLocation, 2, MaxInt); // there is no such thing as an absolute "\Software" registry key + VersionNum := 0; case Inst.RadToolKind of brDelphi: begin - VStr := IntToStr(Inst.VersionNumber); + VersionNum := Inst.VersionNumber; + VStr := IntToStr(VersionNum); SetEnvironmentVariable(PChar('DELPHI' + VStr), PChar(Inst.RootDir)); SetEnvironmentVariable(PChar('DELPHI' + VStr + 'BPL'), PChar(Inst.BPLOutputPath[bpWin32])); SetEnvironmentVariable(PChar('DELPHI' + VStr + 'DCP'), PChar(Inst.DCPOutputPath[bpWin32])); @@ -123,7 +126,8 @@ end; brCppBuilder: begin - VStr := IntToStr(Inst.VersionNumber); + VersionNum := Inst.VersionNumber; + VStr := IntToStr(VersionNum); SetEnvironmentVariable(PChar('BCB' + VStr), PChar(Inst.RootDir)); SetEnvironmentVariable(PChar('BCB' + VStr + 'BPL'), PChar(Inst.BPLOutputPath[bpWin32])); SetEnvironmentVariable(PChar('BCB' + VStr + 'DCP'), PChar(Inst.DCPOutputPath[bpWin32])); @@ -132,9 +136,10 @@ brBorlandDevStudio: begin if Inst.VersionNumber >= 7 then - VStr := IntToStr(7 + Inst.VersionNumber) // Delphi 14 is RAD Studio 7 + VersionNum := 7 + Inst.VersionNumber // Delphi 14 is RAD Studio 7 else - VStr := IntToStr(9 - 3 + Inst.VersionNumber); // Delphi 9 is BDS 3 + VersionNum := 9 - 3 + Inst.VersionNumber; // Delphi 9 is BDS 3 + VStr := IntToStr(VersionNum); if bpDelphi32 in Inst.Personalities then begin SetEnvironmentVariable(PChar('DELPHI' + VStr), PChar(Inst.RootDir)); @@ -166,6 +171,8 @@ SetEnvironmentVariable(PChar('BDSCOMMONDIR' + VStr), PChar(Inst.EnvironmentVariables.Values['BDSCOMMONDIR'])); end; end; + if Result < VersionNum then + Result := VersionNum; end; except HandleException; Modified: trunk/thirdparty/InnoSetup/CompInstall.dll =================================================================== (Binary files differ) Modified: trunk/thirdparty/InnoSetup/ComponentInstallerScript.iss =================================================================== --- trunk/thirdparty/InnoSetup/ComponentInstallerScript.iss 2012-09-05 22:01:26 UTC (rev 3869) +++ trunk/thirdparty/InnoSetup/ComponentInstallerScript.iss 2012-09-06 19:21:34 UTC (rev 3870) @@ -4,6 +4,8 @@ [Code] type TIdeKind = (ikUnknown, ikDelphi, ikBCB); +var + LastInstalledIDEVersionNumber: Integer; function MapDesignPackage(IdeKind: TIdeKind; Version: Integer; const PackageName: string): string; forward; // user defined mapping function that maps the component name @PackageName to a full qualified DesignPackage file name @@ -448,11 +450,11 @@ var Version: Integer; begin - compinst_init; // sets the "DELPHIx[|BPL|DCP|RegKey]" and "BCBx[|BPL|DCP|RegKey] environment variables + LastInstalledIDEVersionNumber := compinst_init; // sets the "DELPHIx[|BPL|DCP|RegKey]" and "BCBx[|BPL|DCP|RegKey] environment variables // Check if there is any Delphi IDE installed Result := False; - for Version := 6 to 17 do + for Version := 6 to LastInstalledIDEVersionNumber do if IsDelphiInstalled(Version) then Result := True; @@ -462,7 +464,7 @@ function InitComponentUninstaller(): Boolean; begin - compinst_initUninstall; // sets the "DELPHIx[|BPL|DCP|RegKey]" and "BCBx[|BPL|DCP|RegKey] environment variables + LastInstalledIDEVersionNumber := compinst_initUninstall; // sets the "DELPHIx[|BPL|DCP|RegKey]" and "BCBx[|BPL|DCP|RegKey] environment variables Result := True; end; Added: trunk/thirdparty/InnoSetup/GenerateSettings.dpr =================================================================== --- trunk/thirdparty/InnoSetup/GenerateSettings.dpr (rev 0) +++ trunk/thirdparty/InnoSetup/GenerateSettings.dpr 2012-09-06 19:21:34 UTC (rev 3870) @@ -0,0 +1,22 @@ +program GenerateSettings; + +uses + {$IF CompilerVersion >= 23.0} // XE2+ + System.SysUtils, + {$ELSE} + SysUtils, + {$IFEND} + JclBase; + +var + f: TextFile; + Version: Integer; +begin + Version := Trunc(CompilerVersion) - 7; + + AssignFile(f, ExtractFilePath(ParamStr(0)) + 'Settings.iss'); + Rewrite(f); + WriteLn(f, '#define Include_Delphi', Version); + WriteLn(f, '#define JclVersionStr "', JclVersionMajor, '.', JclVersionMinor, '.', JclVersionRelease, '.', JclVersionBuild, '"'); + CloseFile(f); +end. \ No newline at end of file Modified: trunk/thirdparty/InnoSetup/Install.iss =================================================================== --- trunk/thirdparty/InnoSetup/Install.iss 2012-09-05 22:01:26 UTC (rev 3869) +++ trunk/thirdparty/InnoSetup/Install.iss 2012-09-06 19:21:34 UTC (rev 3870) @@ -384,7 +384,7 @@ Version: Integer; begin { // Uninstall from all IDEs ? - for Version := 6 to 17 do + for Version := 6 to LastInstalledIDEVersionNumber do UninstallExpertsPrefixed(ikDelphi, Version, 'Jcl'); for Version := 6 to 6 do UninstallExpertsPrefixed(ikBCB, Version, 'Jcl');} Deleted: trunk/thirdparty/InnoSetup/Settings.iss =================================================================== --- trunk/thirdparty/InnoSetup/Settings.iss 2012-09-05 22:01:26 UTC (rev 3869) +++ trunk/thirdparty/InnoSetup/Settings.iss 2012-09-06 19:21:34 UTC (rev 3870) @@ -1,2 +0,0 @@ -#define Include_Delphi17 -#define JclVersionStr "2.4.1.4571" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |