compile.bat 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. rem -------------------------------------------------------------------------
  22. rem Compile each project separately because it seems Delphi
  23. rem carries some settings (e.g. $APPTYPE) between projects
  24. rem if multiple projects are specified on the command line.
  25. set DELPHIXEDISABLEDWARNINGS=-W-SYMBOL_DEPRECATED -W-SYMBOL_PLATFORM -W-UNSAFE_CAST -W-EXPLICIT_STRING_CAST -W-EXPLICIT_STRING_CAST_LOSS -W-IMPLICIT_INTEGER_CAST_LOSS -W-IMPLICIT_CONVERSION_LOSS
  26. cd Projects
  27. if errorlevel 1 goto failed
  28. if "%1"=="issigtool" goto issigtool
  29. if not "%1"=="" goto failed
  30. echo - ISPP.dpr
  31. mkdir Dcu\ISPP.dpr 2>nul
  32. "%DELPHIXEROOT%\bin\dcc32.exe" --no-config -NSSystem;System.Win;Winapi -Q -B -H -W %DELPHIXEDISABLEDWARNINGS% %1 -U"%DELPHIXEROOT%\lib\win32\release" -E..\Files -NUDcu\ISPP.dpr ISPP.dpr
  33. if errorlevel 1 goto failed
  34. echo - Compil32.dpr
  35. mkdir Dcu\Compil32.dpr 2>nul
  36. "%DELPHIXEROOT%\bin\dcc32.exe" --no-config -NSSystem;System.Win;Winapi;Vcl;Vcl.Imaging -Q -B -H -W %DELPHIXEDISABLEDWARNINGS% %1 -U"%DELPHIXEROOT%\lib\win32\release;..\Components\UniPs\Source" -E..\Files -NUDcu\Compil32.dpr -DCOMPIL32PROJ;PS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS Compil32.dpr
  37. if errorlevel 1 goto failed
  38. echo - ISCC.dpr
  39. mkdir Dcu\ISCC.dpr 2>nul
  40. "%DELPHIXEROOT%\bin\dcc32.exe" --no-config -NSSystem;System.Win;Winapi -Q -B -H -W %DELPHIXEDISABLEDWARNINGS% %1 -U"%DELPHIXEROOT%\lib\win32\release;..\Components\UniPs\Source" -E..\Files -NUDcu\ISCC.dpr -DPS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS ISCC.dpr
  41. if errorlevel 1 goto failed
  42. echo - ISCmplr.dpr
  43. mkdir Dcu\ISCmplr.dpr 2>nul
  44. "%DELPHIXEROOT%\bin\dcc32.exe" --no-config -NSSystem;System.Win;Winapi -Q -B -H -W %DELPHIXEDISABLEDWARNINGS% %1 -U"%DELPHIXEROOT%\lib\win32\release;..\Components\UniPs\Source" -E..\Files -NUDcu\ISCmplr.dpr -DPS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS ISCmplr.dpr
  45. if errorlevel 1 goto failed
  46. echo - SetupLdr.dpr
  47. mkdir Dcu\SetupLdr.dpr 2>nul
  48. "%DELPHIXEROOT%\bin\dcc32.exe" --no-config -NSSystem;System.Win;winapi -Q -B -H -W %DELPHIXEDISABLEDWARNINGS% %1 -U"%DELPHIXEROOT%\lib\win32\release" -E..\Files -NUDcu\SetupLdr.dpr -DSETUPLDRPROJ SetupLdr.dpr
  49. if errorlevel 1 goto failed
  50. echo - Setup.dpr
  51. mkdir Dcu\Setup.dpr 2>nul
  52. "%DELPHIXEROOT%\bin\dcc32.exe" --no-config -NSSystem;System.Win;Winapi;Vcl -Q -B -W %DELPHIXEDISABLEDWARNINGS% %1 -U"%DELPHIXEROOT%\lib\win32\release;..\Components\UniPs\Source" -E..\Files -NUDcu\Setup.dpr -DSETUPPROJ;PS_MINIVCL;PS_NOGRAPHCONST;PS_PANSICHAR;PS_NOINTERFACEGUIDBRACKETS Setup.dpr
  53. if errorlevel 1 goto failed
  54. echo - Renaming E32 files
  55. cd ..\Files
  56. if errorlevel 1 goto failed
  57. move SetupLdr.exe SetupLdr.e32
  58. if errorlevel 1 goto failed
  59. move Setup.exe Setup.e32
  60. if errorlevel 1 goto failed
  61. cd ..\Projects
  62. if errorlevel 1 goto failed
  63. :issigtool
  64. echo - ISSigTool.dpr
  65. mkdir Dcu\ISSigTool.dpr 2>nul
  66. "%DELPHIXEROOT%\bin\dcc32.exe" --no-config -NSSystem;System.Win;Winapi -Q -B -H -W %DELPHIXEDISABLEDWARNINGS% %1 -U"%DELPHIXEROOT%\lib\win32\release" -E..\Files -NUDcu\ISSigTool.dpr ISSigTool.dpr
  67. if errorlevel 1 goto failed
  68. cd ..
  69. if errorlevel 1 goto failed
  70. echo Success!
  71. goto exit
  72. :failed
  73. echo *** FAILED ***
  74. cd ..
  75. :failed2
  76. exit /b 1
  77. :exit