1

I am a beginner in inno scripting and sorry about my bad English. My problem is, how can I execute a batch file during installation? Actually the whole installation is dependent upon the batch file i.e. The setup should simply execute the batch and show the progress, The batch will do everything (decompression etc.)

Source code:

@echo off
arc x data.cab >nul
del data.cab >nul
srep.exe -d data1.cab >nul
del data1.cab >nul
pZlib decode data2.cab data3.tar >nul
del data2.cab >nul
7z.exe x data3.tar >nul
del data3.tar >nul

Please help

user333900
  • 111
  • 4
  • That's pretty vague question. At what stage of the installation do you want to execute the batch file? Where the batch file comes from? Where the batch file takes the files to decompress? – Martin Prikryl Sep 12 '16 at 11:07
  • Edit and Post the source code of your batch file – Hackoo Sep 12 '16 at 11:37
  • @MartinPrikryl Ok, I am using inno setup because I don't want to make batch file installers which can be easily edited. The inno setup should only show credits etc. and do nothing, just execute the batch file and show the decompression progress. Rest will be done by the batch file silently. I know the [Run] parameter but it executes the batch file after the setup has finished. – user333900 Sep 12 '16 at 12:13
  • Edit your question with the additional information. Explain the "decompression" phase. Do you want the batch file to decompress something, yet show the decompression progress in Inno Setup GUI? Also what's the problem with *"I know the [Run] parameter but it executes the batch file after the setup has finished"*, when the installer actually does not do anything. So there's nothing to be *"finished"*? Or are you referring the "post install" run? Your question does not make much sense so far. – Martin Prikryl Sep 12 '16 at 12:20
  • 1
    [This](http://www.jrsoftware.org/iskb.php?runbatchfile) has been found after a short google search. If this not provides an answer please post your code here so we can see, what you have tried, where possible errors could be and what might be missing. You might as well want to have a look on [this](http://stackoverflow.com/questions/6818024/inno-setup-execute-a-batch-file-before-files-section) – geisterfurz007 Sep 12 '16 at 12:33
  • @Hackoo source code posted. – user333900 Sep 12 '16 at 12:34
  • So what's the `data.cab`? Where does it get from? Should that be extracted by the installer before starting the batch file? – Martin Prikryl Sep 12 '16 at 13:18
  • 'data.cab' is the archive to be unpacked. No, as I said the installer has to do nothing just execute the batch when the user begins installation. – user333900 Sep 12 '16 at 13:23
  • 1
    @user333900 Have you tried the batch-file out already? If it works the focus of error searching should be set on the inno-setup and the batch-file can more or less be ignored. – geisterfurz007 Sep 12 '16 at 13:29
  • 1
    I'm voting for this question to be closed as a duplicate of the question pointed to by @geisterfurz007: [Inno Setup Execute a batch file before [Files\] section](http://stackoverflow.com/q/6818024/850848). – Martin Prikryl Sep 12 '16 at 13:55

0 Answers0