2
0

build.bat 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 build 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 -Compile ISHelpGen
  14. rem -Compile ISetup*.chm
  15. rem -Compile Inno Setup including ISSigTool
  16. rem -Create Inno Setup installer
  17. rem
  18. rem Once done the installer can be found in Output
  19. setlocal
  20. set VER=6.7.0
  21. echo Building Inno Setup %VER%...
  22. echo.
  23. cd /d %~dp0
  24. if /I "%1"=="setup" goto setup
  25. if not "%1"=="" goto failed
  26. call .\compile.bat issigtool
  27. if errorlevel 1 goto failed
  28. echo Compiling ISSigTool done
  29. rem Verify precompiled binaries which are used during compilation
  30. rem Note: Other precompiled binaries are verified by Setup.iss
  31. call .\issig.bat verify --key-file=def01.ispublickey ^
  32. Projects\Src\Setup.HelperEXEs.res ^
  33. Projects\Src\Compression.LZMADecompressor\Lzma2Decode\ISLzmaDec-x86.obj ^
  34. Projects\Src\Compression.LZMADecompressor\Lzma2Decode\ISLzmaDec-x64.obj ^
  35. Projects\Src\Compression.LZMA1SmallDecompressor\LzmaDecode\LzmaDecodeInno-x86.obj ^
  36. Projects\Src\Compression.LZMA1SmallDecompressor\LzmaDecode\LzmaDecodeInno-x64.obj ^
  37. Projects\Src\Compression.SevenZipDecoder\7zDecode\IS7zDec-x86.obj ^
  38. Projects\Src\Compression.SevenZipDecoder\7zDecode\IS7zDec-x64.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. call .\compile.bat
  46. if errorlevel 1 goto failed
  47. echo Compiling Inno Setup done
  48. if exist .\setup-presign.bat (
  49. echo - Presigning
  50. call .\setup-presign.bat Files\ISCC.exe Files\ISCmplr.dll Files\ISPP.dll
  51. if errorlevel 1 goto failed
  52. echo Presign done
  53. )
  54. rem Sign using user's private key - also see compile.bat
  55. call .\issig.bat sign Files\ISCmplr.dll Files\ISPP.dll Files\Setup.e32 Files\SetupCustomStyle.e32 Files\SetupLdr.e32 Files\SetupLdr.e64
  56. if errorlevel 1 goto failed
  57. echo ISSigTool sign done
  58. pause
  59. cd ishelp
  60. if errorlevel 1 goto failed
  61. call .\compile.bat
  62. if errorlevel 1 goto failed
  63. cd ..
  64. if errorlevel 1 goto failed
  65. echo Compiling ISetup*.chm done
  66. pause
  67. :setup
  68. echo - Setup.exe
  69. if exist .\setup-sign.bat (
  70. call .\setup-sign.bat
  71. ) else (
  72. files\iscc setup.iss
  73. )
  74. if errorlevel 1 goto failed
  75. echo - Renaming files
  76. cd output
  77. if errorlevel 1 goto failed
  78. move /y mysetup.exe innosetup-%VER%.exe
  79. if errorlevel 1 goto failed
  80. cd ..
  81. if errorlevel 1 goto failed
  82. echo Creating Inno Setup installer done
  83. call .\issig.bat sign output\innosetup-%VER%.exe
  84. if errorlevel 1 goto failed
  85. powershell.exe -NoProfile -Command "Write-Host -NoNewline 'SHA256 hash: '; (Get-FileHash -Algorithm SHA256 -Path output\innosetup-%VER%.exe).Hash.ToLower()"
  86. rem ignoring error here
  87. echo All done!
  88. pause
  89. exit /b 0
  90. :failed
  91. echo *** FAILED ***
  92. pause
  93. exit /b 1