I need the files that fit in the installer to be packaged upx first. For this, I have. \ Upx.bat. What needs to be done so that this bat is called before placing files into the installer?

    1 answer 1

    There may be at least 2 ways:

    1. Write another BAT file that would first call your upx.bat , and then call InnoSetup with the installer build script, for example, write this BAT file like this: C:\Path_to_InnoSetup\compil32 /cc "c:\isetup\my installer scips\my script.iss" You can read about the compiler command line options here .

    2. Use the upx.bat BAT file upx.bat from Inno Setup just before building the installer (I think this is the most convenient option for you). This method is implemented by writing the Exec () preprocessor command in your script, for example: #expr Exec("c:\upx.bat") . In this case, the InnoSetup compiler will execute your BAT file, and for the time it is executed it will pause the compilation process.

    • With the first solution, everything is clear. The second does not work for me. I add this line to the beginning of the file, where should I put it? - Ufx
    • In the script file, of course, here’s an example: #expr Exec(AddBackslash(CompilerPath) + "Compil32.exe", """" + AddBackslash(SourcePath) + "Preprocessed.iss""") . And what is your result? - BlackWitcher
    • Here's another example of just archiving files before compiling, but there is no UPX and no BAT file, but the command itself works: stackoverflow.com/a/14599702/6935496 I can not say why this preprocessor command does not work for you, perhaps, the reason in something else. - BlackWitcher
    • I do not observe any result. Here is an example, the installer is being built and launched, but my bat is not running pastebin.com/mWi1gedq - Ufx
    • And which version of Inno? Do you have a preprocessor in it? You just do everything right, and the Exec() call should be at the beginning of the script, before [Setup] , as you have done. - BlackWitcher