build-ce.bat 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.4.3
  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. call .\issig.bat embed
  33. if errorlevel 1 goto failed
  34. echo ISSigTool embed done
  35. echo.
  36. call :deletefile files\compil32.exe
  37. call :deletefile files\iscc.exe
  38. call :deletefile files\iscmplr.dll
  39. call :deletefile files\ispp.dll
  40. call :deletefile files\setup.e32
  41. call :deletefile files\setupldr.e32
  42. call :deletefile files\issigtool.exe
  43. call :deletefile ishelp\ishelpgen\ishelpgen.exe
  44. echo Clearing compilation output done
  45. echo Now open Projects\Projects.groupproj and build all projects in Release mode
  46. echo Waiting for files...
  47. call :waitforfile files\compil32.exe
  48. call :waitforfile files\iscc.exe
  49. call :waitforfile files\iscmplr.dll
  50. call :waitforfile files\ispp.dll
  51. call :waitforfile files\setup.e32
  52. call :waitforfile files\setupldr.e32
  53. call :waitforfile files\issigtool.exe
  54. call :waitforfile ishelp\ishelpgen\ishelpgen.exe
  55. echo Found all, waiting 2 seconds more...
  56. timeout /t 2 /nobreak >nul
  57. echo Compiling Inno Setup done
  58. if exist .\setup-presign.bat (
  59. call .\setup-presign.bat Files\ISCC.exe Files\ISCmplr.dll Files\ISPP.dll
  60. )
  61. call .\issig.bat sign
  62. if errorlevel 1 goto failed
  63. echo ISSigTool sign done
  64. pause
  65. cd ishelp
  66. if errorlevel 1 goto failed
  67. call .\compile.bat
  68. if errorlevel 1 goto failed
  69. cd ..
  70. if errorlevel 1 goto failed
  71. echo Compiling ISetup*.chm done
  72. pause
  73. :setup
  74. echo - Setup.exe
  75. if exist .\setup-sign.bat (
  76. call .\setup-sign.bat
  77. ) else (
  78. files\iscc setup.iss
  79. )
  80. if errorlevel 1 goto failed
  81. echo - Renaming files
  82. cd output
  83. if errorlevel 1 goto failed
  84. move /y mysetup.exe innosetup-%VER%.exe
  85. if errorlevel 1 goto failed
  86. cd ..
  87. if errorlevel 1 goto failed
  88. echo Creating Inno Setup installer done
  89. powershell.exe -NoProfile -Command "Write-Host -NoNewline 'SHA256 hash: '; (Get-FileHash -Algorithm SHA256 -Path output\innosetup-%VER%.exe).Hash.ToLower()"
  90. echo All done!
  91. pause
  92. exit /b 0
  93. :failed
  94. echo *** FAILED ***
  95. pause
  96. exit /b 1
  97. :deletefile
  98. if exist "%~1" (
  99. del "%~1"
  100. if exist "%~1" goto failed
  101. echo Cleared %~1
  102. )
  103. exit /b
  104. :waitforfile
  105. if not exist "%~1" (
  106. timeout /t 1 /nobreak >nul
  107. goto waitforfile
  108. )
  109. echo Found %~1
  110. exit /b