2

I'm using Inno Setup to make installer for my Django webapp created using PyInstaller. Since my application needs a command (command-line console application) to run a server, I wrote a batch script to accomplish that. My problem is I don't want to show console window to end user, I want to make it hidden.

Inno Setup .iss file:

[Run]
Filename: "{app}\cookie_dot.bat"; Description: "Start server"; \
    Flags: nowait postinstall runhidden skipifsilent

But it still shows a console window.

For more details, my batch file:

set PATH=%PATH%;C:\cookie_dot\wkhtmltopdf.exe
START "" "http://localhost:88/"
START "" "C:\cookie_dot\cookie_dot.exe" runserver localhost:88
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
skysoft999
  • 540
  • 1
  • 6
  • 27

1 Answers1

2

The runhidden hides a console window of the batch file (cmd.exe).

But you start yet another console application (cookie_dot.exe) in a separate console window (due to the start command).

Note that if you remove the runhidden flag, you will get two console windows (though the first one shows just briefly, while the batch file is running).


You do not need to use the start command for cookie_dot.exe, as you use nowait flag, so Inno Setup won't mind that the (hidden) batch file stays running as long as the cookie_dot.exe runs:

set PATH=%PATH%;C:\cookie_dot\wkhtmltopdf.exe
START "" "http://localhost:88/"
"C:\cookie_dot\cookie_dot.exe" runserver localhost:88

Without the start command, the cookie_dot.exe inherits the hidden console window of the batch file (cmd.exe).

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • When i executed the EXE file Two applications are running in background its using lot of memories too, Any idea why application running in background two times ? – skysoft999 Mar 08 '18 at 10:28
  • What "exe"? `cookie_dot.exe` itself? Or the installer? – Martin Prikryl Mar 08 '18 at 11:05
  • Then I do not see how this is related to this question. If you have a new problem, please ask it separately. This is Q&A site, not a discussion forum. – Martin Prikryl Mar 08 '18 at 13:51