build-ce.bat 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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 builds 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 -Ask the user to compile Inno Setup including ISSigTool and ISHelpGen after clearing output first
  14. rem -Compile ISetup*.chm
  15. rem -Create Inno Setup installer
  16. rem
  17. rem Once done the installer can be found in Output
  18. setlocal
  19. set VER=6.5.0-dev
  20. echo Building Inno Setup %VER%...
  21. echo.
  22. cd /d %~dp0
  23. if "%1"=="setup" goto setup
  24. if not "%1"=="" goto failed
  25. if not exist files\issigtool.exe (
  26. echo Missing ISSigTool
  27. echo Now open Projects\Projects.groupproj and build ISSigTool in Release mode
  28. echo - Waiting for file...
  29. call :waitforfile files\issigtool.exe
  30. echo Compiling ISSigTool done
  31. )
  32. rem Verify precompiled binaries which are used during compilation
  33. rem Note: Other precompiled binaries are verified by Setup.iss
  34. call .\issig.bat verify --key-file=def01.ispublickey ^
  35. Projects\Src\Setup.HelperEXEs.res ^
  36. Projects\Src\Compression.LZMADecompressor\Lzma2Decode\ISLzmaDec.obj ^
  37. Projects\Src\Compression.LZMA1SmallDecompressor\LzmaDecode\LzmaDecodeInno.obj ^
  38. Projects\Src\Compression.SevenZipDecoder\7zDecode\IS7zDec.obj
  39. if errorlevel 1 goto failed
  40. echo ISSigTool verify done
  41. rem Embed user's public key into sources
  42. call .\issig.bat embed
  43. if errorlevel 1 goto failed
  44. echo ISSigTool embed done
  45. echo.
  46. call :deletefile files\compil32.exe
  47. call :deletefile files\iscc.exe
  48. call :deletefile files\iscmplr.dll
  49. call :deletefile files\ispp.dll
  50. call :deletefile files\setup.e32
  51. call :deletefile files\setupldr.e32
  52. call :deletefile files\issigtool.exe
  53. call :deletefile ishelp\ishelpgen\ishelpgen.exe
  54. echo Clearing compilation output done
  55. echo Now open Projects\Projects.groupproj and build all projects in Release mode
  56. echo - Waiting for files...
  57. call :waitforfile files\compil32.exe
  58. call :waitforfile files\iscc.exe
  59. call :waitforfile files\iscmplr.dll
  60. call :waitforfile files\ispp.dll
  61. call :waitforfile files\setup.e32
  62. call :waitforfile files\setupldr.e32
  63. call :waitforfile files\issigtool.exe
  64. call :waitforfile ishelp\ishelpgen\ishelpgen.exe
  65. echo Found all, waiting 2 seconds more...
  66. timeout /t 2 /nobreak >nul
  67. echo Compiling Inno Setup done
  68. if exist .\setup-presign.bat (
  69. echo - Presigning
  70. call .\setup-presign.bat Files\ISCC.exe Files\ISCmplr.dll Files\ISPP.dll
  71. if errorlevel 1 goto failed
  72. echo Presign done
  73. )
  74. rem Sign using user's private key
  75. call .\issig.bat sign Files\ISCmplr.dll Files\ISPP.dll Files\Setup.e32 Files\SetupLdr.e32
  76. if errorlevel 1 goto failed
  77. echo ISSigTool sign done
  78. pause
  79. cd ishelp
  80. if errorlevel 1 goto failed
  81. call .\compile.bat
  82. if errorlevel 1 goto failed
  83. cd ..
  84. if errorlevel 1 goto failed
  85. echo Compiling ISetup*.chm done
  86. pause
  87. :setup
  88. echo - Setup.exe
  89. if exist .\setup-sign.bat (
  90. call .\setup-sign.bat
  91. ) else (
  92. files\iscc setup.iss
  93. )
  94. if errorlevel 1 goto failed
  95. echo - Renaming files
  96. cd output
  97. if errorlevel 1 goto failed
  98. move /y mysetup.exe innosetup-%VER%.exe
  99. if errorlevel 1 goto failed
  100. cd ..
  101. if errorlevel 1 goto failed
  102. echo Creating Inno Setup installer done
  103. call .\issig.bat sign output\innosetup-%VER%.exe
  104. if errorlevel 1 goto failed
  105. powershell.exe -NoProfile -Command "Write-Host -NoNewline 'SHA256 hash: '; (Get-FileHash -Algorithm SHA256 -Path output\innosetup-%VER%.exe).Hash.ToLower()"
  106. rem ignoring error here
  107. echo All done!
  108. pause
  109. exit /b 0
  110. :failed
  111. echo *** FAILED ***
  112. pause
  113. exit /b 1
  114. :deletefile
  115. if exist "%~1" (
  116. del "%~1"
  117. if exist "%~1" goto failed
  118. echo Cleared %~1
  119. )
  120. exit /b
  121. :waitforfile
  122. if not exist "%~1" (
  123. timeout /t 1 /nobreak >nul
  124. goto waitforfile
  125. )
  126. echo Found %~1
  127. exit /b