compile.bat 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 "%1"=="x86" goto archfound
  11. if "%1"=="x64" goto archfound
  12. echo Architecture parameter is missing or invalid. Must be "x86" or "x64".
  13. goto failed2
  14. :archfound
  15. if exist compilesettings.bat goto compilesettingsfound
  16. :compilesettingserror
  17. echo compilesettings.bat is missing or incomplete. It needs to contain
  18. echo the following line, adjusted for your system:
  19. echo.
  20. echo set DELPHIXEROOT=C:\Program Files\Embarcadero\RAD Studio\20.0 [Path to Delphi 10.4 Sydney (or later)]
  21. goto failed2
  22. :compilesettingsfound
  23. set DELPHIXEROOT=
  24. call .\compilesettings.bat
  25. if "%DELPHIXEROOT%"=="" goto compilesettingserror
  26. rem -------------------------------------------------------------------------
  27. call "%DELPHIXEROOT%\bin\rsvars.bat"
  28. if errorlevel 1 goto failed
  29. cd Projects
  30. if errorlevel 1 goto failed
  31. set EnvOptionsWarn=false
  32. if "%1"=="x64" ( set Bits=64 ) else ( set Bits=32 )
  33. if /I "%2"=="ishelpgen" (
  34. echo - ISHelpGen.exe
  35. msbuild.exe ..\ISHelp\ISHelpGen\ISHelpGen.dproj /t:Build /p:Config=Release;Platform=Win64 /nologo
  36. ) else if /I "%2"=="issigtool" (
  37. echo - ISSigTool.exe
  38. msbuild.exe ISSigTool.dproj /t:Build /p:Config=Release;Platform=Win%Bits% /nologo
  39. ) else (
  40. echo - Projects.groupproj - Release build group
  41. rem This emits warning MSB4056, but that's ok since the build doesn't use COM. Modern MSBuild supports
  42. rem /noWarn:MSB4056, but the version targeted by Delphi 12.3's rsvars.bat does not. Additionally Delphi's
  43. rem implementation of build groups does not seem to pass through additional parameters, so even with a
  44. rem modern MSBuild you cannot suppress the warning. Likewise, using /nologo or /v:q has no effect.
  45. msbuild.exe Projects.groupproj /t:Build /p:BuildGroup=Release%Bits%
  46. )
  47. if errorlevel 1 goto failed
  48. cd ..
  49. if errorlevel 1 goto failed
  50. echo Success!
  51. if not "%2"=="" goto exit
  52. rem Sign using user's private key - will be overwritten if called by build.bat
  53. call .\issig.bat sign Files\ISCmplr.dll Files\ISPP.dll Files\Setup.e32 Files\Setup.e64 Files\SetupCustomStyle.e32 Files\SetupCustomStyle.e64 Files\SetupLdr.e32 Files\SetupLdr.e64
  54. if errorlevel 1 goto failed
  55. echo ISSigTool sign done
  56. goto exit
  57. :failed
  58. echo *** FAILED ***
  59. cd ..
  60. :failed2
  61. exit /b 1
  62. :exit