build-ce.bat 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. @echo off
  2. rem Inno Setup
  3. rem Copyright (C) 1997-2026 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 of 64-bit Inno Setup
  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 64-bit Inno Setup installer
  16. rem
  17. rem Once done the installer can be found in Output
  18. setlocal
  19. set VER=7.0.0-preview-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 Win64 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\Compression.LZMADecompressor\Lzma2Decode\ISLzmaDec-x86.obj ^
  36. Projects\Src\Compression.LZMADecompressor\Lzma2Decode\ISLzmaDec-x64.obj ^
  37. Projects\Src\Compression.LZMA1SmallDecompressor\LzmaDecode\LzmaDecodeInno-x86.obj ^
  38. Projects\Src\Compression.LZMA1SmallDecompressor\LzmaDecode\LzmaDecodeInno-x64.obj ^
  39. Projects\Src\Compression.SevenZipDecoder\7zDecode\IS7zDec-x86.obj ^
  40. Projects\Src\Compression.SevenZipDecoder\7zDecode\IS7zDec-x64.obj
  41. if errorlevel 1 goto failed
  42. echo ISSigTool verify done
  43. rem Embed user's public key into sources
  44. call .\issig.bat embed
  45. if errorlevel 1 goto failed
  46. echo ISSigTool embed done
  47. if not exist files\ishelpgen.exe (
  48. echo Missing ISHelpGen
  49. echo Now open Projects\Projects.groupproj and build the ISHelpGen project and its Win64 target in Release mode
  50. echo - Waiting for file...
  51. call :waitforfile files\ishelpgen.exe
  52. echo Compiling ISHelpGen done
  53. )
  54. cd ishelp
  55. if errorlevel 1 goto failed
  56. call .\compile.bat
  57. if errorlevel 1 goto failed
  58. cd ..
  59. if errorlevel 1 goto failed
  60. echo Compiling ISetup*.chm done
  61. pause
  62. echo.
  63. call :deletefile files\iside.exe
  64. call :deletefile files\iscc.exe
  65. call :deletefile files\iscmplr.dll
  66. call :deletefile files\ispp.dll
  67. call :deletefile files\setup.e32
  68. call :deletefile files\setup.e64
  69. call :deletefile files\setupcustomstyle.e32
  70. call :deletefile files\setupcustomstyle.e64
  71. call :deletefile files\setupldr.e32
  72. call :deletefile files\setupldr.e64
  73. call :deletefile files\issigtool.exe
  74. call :deletefile ishelp\ishelpgen\ishelpgen.exe
  75. echo Clearing compilation output done
  76. echo Now open Projects\Projects.groupproj and build the Release64 build group
  77. echo You can open the Build Groups pane from the Projects tool window
  78. echo - Waiting for files...
  79. call :waitforfile files\iside.exe
  80. call :waitforfile files\iscc.exe
  81. call :waitforfile files\iscmplr.dll
  82. call :waitforfile files\ispp.dll
  83. call :waitforfile files\setup.e32
  84. call :waitforfile files\setup.e64
  85. call :waitforfile files\setupcustomstyle.e32
  86. call :waitforfile files\setupcustomstyle.e64
  87. call :waitforfile files\setupldr.e32
  88. call :waitforfile files\setupldr.e64
  89. call :waitforfile files\issigtool.exe
  90. call :waitforfile ishelp\ishelpgen\ishelpgen.exe
  91. echo Found all, waiting 2 seconds more...
  92. timeout /t 2 /nobreak >nul
  93. echo Compiling Inno Setup done
  94. if exist .\setup-presign.bat (
  95. echo - Presigning
  96. call .\setup-presign.bat Files\ISCC.exe Files\ISCmplr.dll Files\ISPP.dll
  97. if errorlevel 1 goto failed
  98. echo Presign done
  99. )
  100. rem Sign using user's private key - also see compile.bat
  101. 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
  102. if errorlevel 1 goto failed
  103. echo ISSigTool sign done
  104. :setup
  105. echo - Setup.exe
  106. if exist .\setup-sign.bat (
  107. call .\setup-sign.bat /Dx64
  108. ) else (
  109. files\iscc setup.iss /Dx64
  110. )
  111. if errorlevel 1 goto failed
  112. echo - Renaming files
  113. cd output
  114. if errorlevel 1 goto failed
  115. move /y mysetup.exe innosetup-%VER%.exe
  116. if errorlevel 1 goto failed
  117. cd ..
  118. if errorlevel 1 goto failed
  119. echo Creating Inno Setup installer done
  120. call .\issig.bat sign output\innosetup-%VER%.exe
  121. if errorlevel 1 goto failed
  122. echo All done!
  123. pause
  124. exit /b 0
  125. :failed
  126. echo *** FAILED ***
  127. pause
  128. exit /b 1
  129. :deletefile
  130. if exist "%~1" (
  131. del "%~1"
  132. if exist "%~1" goto failed
  133. echo Cleared %~1
  134. )
  135. exit /b
  136. :waitforfile
  137. if not exist "%~1" (
  138. timeout /t 1 /nobreak >nul
  139. goto waitforfile
  140. )
  141. echo Found %~1
  142. exit /b