build-ce.bat 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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.6.0
  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\setupcustomstyle.e32
  52. call :deletefile files\setupldr.e32
  53. call :deletefile files\issigtool.exe
  54. call :deletefile ishelp\ishelpgen\ishelpgen.exe
  55. echo Clearing compilation output done
  56. echo Now open Projects\Projects.groupproj and build all projects in Release mode
  57. echo - Waiting for files...
  58. call :waitforfile files\compil32.exe
  59. call :waitforfile files\iscc.exe
  60. call :waitforfile files\iscmplr.dll
  61. call :waitforfile files\ispp.dll
  62. call :waitforfile files\setup.e32
  63. call :waitforfile files\setupcustomstyle.e32
  64. call :waitforfile files\setupldr.e32
  65. call :waitforfile files\issigtool.exe
  66. call :waitforfile ishelp\ishelpgen\ishelpgen.exe
  67. echo Found all, waiting 2 seconds more...
  68. timeout /t 2 /nobreak >nul
  69. echo Compiling Inno Setup done
  70. if exist .\setup-presign.bat (
  71. echo - Presigning
  72. call .\setup-presign.bat Files\ISCC.exe Files\ISCmplr.dll Files\ISPP.dll
  73. if errorlevel 1 goto failed
  74. echo Presign done
  75. )
  76. rem Sign using user's private key - also see compile.bat
  77. call .\issig.bat sign Files\ISCmplr.dll Files\ISPP.dll Files\Setup.e32 Files\SetupCustomStyle.e32 Files\SetupLdr.e32
  78. if errorlevel 1 goto failed
  79. echo ISSigTool sign done
  80. pause
  81. cd ishelp
  82. if errorlevel 1 goto failed
  83. call .\compile.bat
  84. if errorlevel 1 goto failed
  85. cd ..
  86. if errorlevel 1 goto failed
  87. echo Compiling ISetup*.chm done
  88. pause
  89. :setup
  90. echo - Setup.exe
  91. if exist .\setup-sign.bat (
  92. call .\setup-sign.bat
  93. ) else (
  94. files\iscc setup.iss
  95. )
  96. if errorlevel 1 goto failed
  97. echo - Renaming files
  98. cd output
  99. if errorlevel 1 goto failed
  100. move /y mysetup.exe innosetup-%VER%.exe
  101. if errorlevel 1 goto failed
  102. cd ..
  103. if errorlevel 1 goto failed
  104. echo Creating Inno Setup installer done
  105. call .\issig.bat sign output\innosetup-%VER%.exe
  106. if errorlevel 1 goto failed
  107. powershell.exe -NoProfile -Command "Write-Host -NoNewline 'SHA256 hash: '; (Get-FileHash -Algorithm SHA256 -Path output\innosetup-%VER%.exe).Hash.ToLower()"
  108. rem ignoring error here
  109. echo All done!
  110. pause
  111. exit /b 0
  112. :failed
  113. echo *** FAILED ***
  114. pause
  115. exit /b 1
  116. :deletefile
  117. if exist "%~1" (
  118. del "%~1"
  119. if exist "%~1" goto failed
  120. echo Cleared %~1
  121. )
  122. exit /b
  123. :waitforfile
  124. if not exist "%~1" (
  125. timeout /t 1 /nobreak >nul
  126. goto waitforfile
  127. )
  128. echo Found %~1
  129. exit /b