2
0

build-ce.bat 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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.7.1
  20. echo Building Inno Setup %VER%...
  21. echo.
  22. cd /d %~dp0
  23. if /I "%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 the ISSigTool project and its Win32 target 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-x86.obj ^
  37. Projects\Src\Compression.LZMADecompressor\Lzma2Decode\ISLzmaDec-x64.obj ^
  38. Projects\Src\Compression.LZMA1SmallDecompressor\LzmaDecode\LzmaDecodeInno-x86.obj ^
  39. Projects\Src\Compression.LZMA1SmallDecompressor\LzmaDecode\LzmaDecodeInno-x64.obj ^
  40. Projects\Src\Compression.SevenZipDecoder\7zDecode\IS7zDec-x86.obj ^
  41. Projects\Src\Compression.SevenZipDecoder\7zDecode\IS7zDec-x64.obj
  42. if errorlevel 1 goto failed
  43. echo ISSigTool verify done
  44. rem Embed user's public key into sources
  45. call .\issig.bat embed
  46. if errorlevel 1 goto failed
  47. echo ISSigTool embed done
  48. echo.
  49. call :deletefile files\compil32.exe
  50. call :deletefile files\iscc.exe
  51. call :deletefile files\iscmplr.dll
  52. call :deletefile files\ispp.dll
  53. call :deletefile files\setup.e32
  54. call :deletefile files\setupcustomstyle.e32
  55. call :deletefile files\setupldr.e32
  56. call :deletefile files\setupldr.e64
  57. call :deletefile files\issigtool.exe
  58. call :deletefile ishelp\ishelpgen\ishelpgen.exe
  59. echo Clearing compilation output done
  60. echo Now open Projects\Projects.groupproj and build the Release build group
  61. echo You can open the Build Groups pane from the Projects tool window
  62. echo - Waiting for files...
  63. call :waitforfile files\compil32.exe
  64. call :waitforfile files\iscc.exe
  65. call :waitforfile files\iscmplr.dll
  66. call :waitforfile files\ispp.dll
  67. call :waitforfile files\setup.e32
  68. call :waitforfile files\setupcustomstyle.e32
  69. call :waitforfile files\setupldr.e32
  70. call :waitforfile files\setupldr.e64
  71. call :waitforfile files\issigtool.exe
  72. call :waitforfile ishelp\ishelpgen\ishelpgen.exe
  73. echo Found all, waiting 2 seconds more...
  74. timeout /t 2 /nobreak >nul
  75. echo Compiling Inno Setup done
  76. if exist .\setup-presign.bat (
  77. echo - Presigning
  78. call .\setup-presign.bat Files\ISCC.exe Files\ISCmplr.dll Files\ISPP.dll
  79. if errorlevel 1 goto failed
  80. echo Presign done
  81. )
  82. rem Sign using user's private key - also see compile.bat
  83. call .\issig.bat sign Files\ISCmplr.dll Files\ISPP.dll Files\Setup.e32 Files\SetupCustomStyle.e32 Files\SetupLdr.e32 Files\SetupLdr.e64
  84. if errorlevel 1 goto failed
  85. echo ISSigTool sign done
  86. pause
  87. cd ishelp
  88. if errorlevel 1 goto failed
  89. call .\compile.bat
  90. if errorlevel 1 goto failed
  91. cd ..
  92. if errorlevel 1 goto failed
  93. echo Compiling ISetup*.chm done
  94. pause
  95. :setup
  96. echo - Setup.exe
  97. if exist .\setup-sign.bat (
  98. call .\setup-sign.bat
  99. ) else (
  100. files\iscc setup.iss
  101. )
  102. if errorlevel 1 goto failed
  103. echo - Renaming files
  104. cd output
  105. if errorlevel 1 goto failed
  106. move /y mysetup.exe innosetup-%VER%.exe
  107. if errorlevel 1 goto failed
  108. cd ..
  109. if errorlevel 1 goto failed
  110. echo Creating Inno Setup installer done
  111. call .\issig.bat sign output\innosetup-%VER%.exe
  112. if errorlevel 1 goto failed
  113. powershell.exe -NoProfile -Command "Write-Host -NoNewline 'SHA256 hash: '; (Get-FileHash -Algorithm SHA256 -Path output\innosetup-%VER%.exe).Hash.ToLower()"
  114. rem ignoring error here
  115. echo All done!
  116. pause
  117. exit /b 0
  118. :failed
  119. echo *** FAILED ***
  120. pause
  121. exit /b 1
  122. :deletefile
  123. if exist "%~1" (
  124. del "%~1"
  125. if exist "%~1" goto failed
  126. echo Cleared %~1
  127. )
  128. exit /b
  129. :waitforfile
  130. if not exist "%~1" (
  131. timeout /t 1 /nobreak >nul
  132. goto waitforfile
  133. )
  134. echo Found %~1
  135. exit /b