2

I have a Inno Setup executable to install the program. I have made sure using How to detect whether the setup runs in very silent mode? to use the code to detect if there is a Silent switch and applied the VerySilent switch while installing. The problem I am facing now is that I need some kind of output on the console stating like, while installing: BUSY... and just after completing the installation the output on the console as: DONE!

This is needed because, I have to use /VERYSILENT switch and using this we have no clue if the installation is completed or not, if completed whether it is successful or not. Also a message box is not the way to go because the installs happen remotely. Just a console output and if possible a log file as well.

I have tried the usual pascal code:

begin
  WriteLn('Hello World!');
end. 

Any help is appreciated and if any more clarification of the problem is required please ask.

Community
  • 1
  • 1
Vivian Lobo
  • 583
  • 10
  • 29

1 Answers1

1

Installers are created as GUI applications. As such Windows automatically disconnects the console from them when they are launched, and there is absolutely no way for them to write to it.

You will have to handle it via whatever you are using to run the installer -- eg. in a batch script, for example:

@echo off
echo BUSY...
start /wait path\to\setup-foo /verysilent /norestart /suppressmsgboxes
echo DONE (%errorlevel%)

(You may also want to use the /LOG parameter.)

If the path to the setup might contain spaces, you have to use a slightly weirder syntax:

start /wait "" "another path\to\setup-foo" /verysilent /norestart ...

(The empty double-quotes are required and must appear before the executable path.)

Miral
  • 12,637
  • 4
  • 53
  • 93
  • I will definitely try this, but I think I understood what you are explaining. I was wondering why regular syntax does not work. Thanks – Vivian Lobo Jan 03 '13 at 12:11
  • One little gotcha in the `start` syntax: you should quote the filename if it might contain spaces, but if you do so you have to include an extra dummy parameter. I've edited my answer above to show an example. – Miral Jan 09 '13 at 09:56