compile.bat 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. @echo off
  2. rem Inno Setup
  3. rem Copyright (C) 1997-2025 Jordan Russell
  4. rem Portions by Martijn Laan
  5. rem For conditions of distribution and use, see LICENSE.TXT.
  6. rem
  7. rem Batch file to compile Inno Setup
  8. setlocal
  9. cd /d %~dp0
  10. if exist compilesettings.bat goto compilesettingsfound
  11. :compilesettingserror
  12. echo compilesettings.bat is missing or incomplete. It needs to contain
  13. echo the following line, adjusted for your system:
  14. echo.
  15. echo set DELPHIXEROOT=C:\Program Files\Embarcadero\RAD Studio\20.0 [Path to Delphi 10.4 Sydney (or later)]
  16. goto failed2
  17. :compilesettingsfound
  18. set DELPHIXEROOT=
  19. call .\compilesettings.bat
  20. if "%DELPHIXEROOT%"=="" goto compilesettingserror
  21. set DELPHIXELIB_WIN32=%DELPHIXEROOT%\lib\win32\release
  22. rem -------------------------------------------------------------------------
  23. rem Compile each project separately because it seems Delphi
  24. rem carries some settings (e.g. $APPTYPE) between projects
  25. rem if multiple projects are specified on the command line.
  26. set DELPHIXEDISABLEDWARNINGS=-W-SYMBOL_DEPRECATED -W-SYMBOL_PLATFORM -W-UNSAFE_CAST -W-EXPLICIT_STRING_CAST -W-EXPLICIT_STRING_CAST_LOSS
  27. set FLAGS=--no-config -Q -B -$L- -$C- -H -W %DELPHIXEDISABLEDWARNINGS% %1 -E..\Files
  28. set FLAGSCONSOLE=%FLAGS% -CC
  29. set FLAGSE32=%FLAGS% -TX.e32
  30. set NAMESPACES=System;System.Win;Winapi
  31. set DCUDIR_WIN32=Dcu\Win32\Release
  32. set ROPSSRC=..\Components\UniPS\Source
  33. set ROPSDEF=PS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS
  34. cd Projects
  35. if errorlevel 1 goto failed
  36. if "%1"=="issigtool" goto issigtool
  37. if not "%1"=="" goto failed
  38. echo - ISPP.dll
  39. mkdir %DCUDIR_WIN32%\ISPP.dpr 2>nul
  40. "%DELPHIXEROOT%\bin\dcc32.exe" %FLAGSCONSOLE% -$T+ -NS%NAMESPACES% -U"%DELPHIXELIB_WIN32%" -NU%DCUDIR_WIN32%\ISPP.dpr ISPP.dpr
  41. if errorlevel 1 goto failed
  42. echo - Compil32.exe
  43. mkdir %DCUDIR_WIN32%\Compil32.dpr 2>nul
  44. "%DELPHIXEROOT%\bin\dcc32.exe" %FLAGS% -W-IMPLICIT_INTEGER_CAST_LOSS -W-IMPLICIT_CONVERSION_LOSS -NS%NAMESPACES%;Vcl;Vcl.Imaging -U"%DELPHIXELIB_WIN32%;%ROPSSRC%" -NU%DCUDIR_WIN32%\Compil32.dpr -DCOMPIL32PROJ;VCLSTYLES;%ROPSDEF% Compil32.dpr
  45. if errorlevel 1 goto failed
  46. echo - ISCC.exe
  47. mkdir %DCUDIR_WIN32%\ISCC.dpr 2>nul
  48. "%DELPHIXEROOT%\bin\dcc32.exe" %FLAGS% -$T+ -NS%NAMESPACES% -U"%DELPHIXELIB_WIN32%;%ROPSSRC%" -NU%DCUDIR_WIN32%\ISCC.dpr -D%ROPSDEF% ISCC.dpr
  49. if errorlevel 1 goto failed
  50. echo - ISCmplr.dll
  51. mkdir %DCUDIR_WIN32%\ISCmplr.dpr 2>nul
  52. "%DELPHIXEROOT%\bin\dcc32.exe" %FLAGS% -W-IMPLICIT_INTEGER_CAST_LOSS -W-IMPLICIT_CONVERSION_LOSS -NS%NAMESPACES% -U"%DELPHIXELIB_WIN32%;%ROPSSRC%" -NU%DCUDIR_WIN32%\ISCmplr.dpr -D%ROPSDEF% ISCmplr.dpr
  53. if errorlevel 1 goto failed
  54. echo - SetupLdr.e32
  55. mkdir %DCUDIR_WIN32%\SetupLdr.dpr 2>nul
  56. "%DELPHIXEROOT%\bin\dcc32.exe" %FLAGSE32% -$T+ -NS%NAMESPACES% -U"%DELPHIXELIB_WIN32%" -NU%DCUDIR_WIN32%\SetupLdr.dpr -DSETUPLDRPROJ SetupLdr.dpr
  57. if errorlevel 1 goto failed
  58. echo - Setup.e32
  59. mkdir %DCUDIR_WIN32%\Setup.dpr 2>nul
  60. "%DELPHIXEROOT%\bin\dcc32.exe" %FLAGSE32% -W-IMPLICIT_INTEGER_CAST_LOSS -W-IMPLICIT_CONVERSION_LOSS -NS%NAMESPACES%;Vcl -U"%DELPHIXELIB_WIN32%;%ROPSSRC%" -NU%DCUDIR_WIN32%\Setup.dpr -DSETUPPROJ;%ROPSDEF% Setup.dpr
  61. if errorlevel 1 goto failed
  62. echo - SetupCustomStyle.e32
  63. mkdir %DCUDIR_WIN32%\SetupCustomStyle.dpr 2>nul
  64. "%DELPHIXEROOT%\bin\dcc32.exe" %FLAGSE32% -W-IMPLICIT_INTEGER_CAST_LOSS -W-IMPLICIT_CONVERSION_LOSS -NS%NAMESPACES%;Vcl -U"%DELPHIXELIB_WIN32%;%ROPSSRC%" -NU%DCUDIR_WIN32%\SetupCustomStyle.dpr -DSETUPPROJ;VCLSTYLES;%ROPSDEF% SetupCustomStyle.dpr
  65. if errorlevel 1 goto failed
  66. :issigtool
  67. echo - ISSigTool.exe
  68. mkdir %DCUDIR_WIN32%\ISSigTool.dpr 2>nul
  69. "%DELPHIXEROOT%\bin\dcc32.exe" %FLAGSCONSOLE% -$T+ -NS%NAMESPACES% -U"%DELPHIXELIB_WIN32%" -NU%DCUDIR_WIN32%\ISSigTool.dpr ISSigTool.dpr
  70. if errorlevel 1 goto failed
  71. cd ..
  72. if errorlevel 1 goto failed
  73. echo Success!
  74. if "%1"=="issigtool" goto exit
  75. rem Sign using user's private key - will be overwritten if called by build.bat
  76. call .\issig.bat sign Files\ISCmplr.dll Files\ISPP.dll Files\Setup.e32 Files\SetupCustomStyle.e32 Files\SetupLdr.e32
  77. if errorlevel 1 goto failed
  78. echo ISSigTool sign done
  79. goto exit
  80. :failed
  81. echo *** FAILED ***
  82. cd ..
  83. :failed2
  84. exit /b 1
  85. :exit