build.bat 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 prepare a release
  8. rem
  9. rem Calls setup-sign.bat if it exists to create a signed build, otherwise creates setup.exe without signing
  10. rem Signed build also require a setup-presign.bat to exist which should sign all files passed to it
  11. rem
  12. rem This batch files does the following things:
  13. rem -Compile ISHelpGen
  14. rem -Compile ISetup*.chm
  15. rem -Compile Inno Setup including ISSigTool
  16. rem -Create Inno Setup installer
  17. rem
  18. rem Once done the installer can be found in Output
  19. setlocal
  20. set VER=6.5.0-dev
  21. echo Building Inno Setup %VER%...
  22. echo.
  23. cd /d %~dp0
  24. if "%1"=="setup" goto setup
  25. if not "%1"=="" goto failed
  26. cd ishelp\ishelpgen
  27. if errorlevel 1 goto failed
  28. call .\compile.bat
  29. if errorlevel 1 goto failed
  30. cd ..\..
  31. if errorlevel 1 goto failed
  32. echo Compiling ISHelpGen done
  33. pause
  34. cd ishelp
  35. if errorlevel 1 goto failed
  36. call .\compile.bat
  37. if errorlevel 1 goto failed
  38. cd ..
  39. if errorlevel 1 goto failed
  40. echo Compiling ISetup*.chm done
  41. pause
  42. call .\compile.bat issigtool
  43. if errorlevel 1 goto failed
  44. echo Compiling ISSigTool done
  45. rem Verify precompiled binaries which are used during compilation
  46. rem Note: Other precompiled binaries are verified by Setup.iss
  47. call .\issig.bat verify --key-file=def01.ispublickey ^
  48. Projects\Src\Setup.HelperEXEs.res ^
  49. Projects\Src\Compression.LZMADecompressor\Lzma2Decode\ISLzmaDec.obj ^
  50. Projects\Src\Compression.LZMA1SmallDecompressor\LzmaDecode\LzmaDecodeInno.obj ^
  51. Projects\Src\Compression.SevenZipDecoder\7zDecode\IS7zDec.obj
  52. if errorlevel 1 goto failed
  53. echo ISSigTool verify done
  54. rem Embed user's public key into sources
  55. call .\issig.bat embed
  56. if errorlevel 1 goto failed
  57. echo ISSigTool embed done
  58. call .\compile.bat
  59. if errorlevel 1 goto failed
  60. echo Compiling Inno Setup done
  61. if exist .\setup-presign.bat (
  62. echo - Presigning
  63. call .\setup-presign.bat Files\ISCC.exe Files\ISCmplr.dll Files\ISPP.dll
  64. if errorlevel 1 goto failed
  65. echo Presign done
  66. )
  67. rem Sign using user's private key
  68. call .\issig.bat sign Files\ISCmplr.dll Files\ISPP.dll Files\Setup.e32 Files\SetupLdr.e32
  69. if errorlevel 1 goto failed
  70. echo ISSigTool sign done
  71. pause
  72. :setup
  73. echo - Setup.exe
  74. if exist .\setup-sign.bat (
  75. call .\setup-sign.bat
  76. ) else (
  77. files\iscc setup.iss
  78. )
  79. if errorlevel 1 goto failed
  80. echo - Renaming files
  81. cd output
  82. if errorlevel 1 goto failed
  83. move /y mysetup.exe innosetup-%VER%.exe
  84. if errorlevel 1 goto failed
  85. cd ..
  86. if errorlevel 1 goto failed
  87. echo Creating Inno Setup installer done
  88. call .\issig.bat sign output\innosetup-%VER%.exe
  89. if errorlevel 1 goto failed
  90. powershell.exe -NoProfile -Command "Write-Host -NoNewline 'SHA256 hash: '; (Get-FileHash -Algorithm SHA256 -Path output\innosetup-%VER%.exe).Hash.ToLower()"
  91. rem ignoring error here
  92. echo All done!
  93. pause
  94. exit /b 0
  95. :failed
  96. echo *** FAILED ***
  97. pause
  98. exit /b 1