5

Is it possible to define pre-/post-compile actions in *.iss script?

In short I need to run *.bat script before compilation and after.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
CODIJY
  • 93
  • 2
  • 7

2 Answers2

3

One way is to revert your logic and run command-line compiler from the batch file:

call precompile.bat

ISCC.exe setup.iss

call postcompile.bat

If you need a GUI solution, there's ISTool, an Inno Setup extension, that has direct support for Pre Compilation and Post Compilation "Steps". But this project is unfortunately no longer maintained. You might be able to update it to the latest Inno Setup version, as it is open source.


Another way to run some script before compilation is using Exec preprocessor function.

#expr Exec("precompile.bat")

See also Is it possible to call a batch file while compiling an Inno Setup script?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
-5

@Martin Prikryl, @CODIJY:

ISTool is really old and deprecated. Does anyone still use it?

There are also advanced GUI tools like Visual & Installer (for Microsoft Visual Studio) or RAD & Installer (for Embarcadero RAD Studio - a little self promo :)

In these modern tools you can easily specify "Launch tool after build" and "Launch tool before build" events and run your .bat file.

Project Properties

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Slappy
  • 5,250
  • 1
  • 23
  • 29