1
votes

My Inno Setup installer contains a small webserver and a desktop application. Both of these are standalone executables. On installation I want to start a the webserver so that it is up an running before starting up the desktop app. I'm trying to achieve this in the [Run] section of my Inno Setup script as follows:

[Run]
Filename: "{app}\Server\{#ServerExeName}"; \
    Description: "{cm:LaunchProgram,{#StringChange(ServerName, '&', '&&')}}"; \
    Flags: waituntilidle runascurrentuser
Filename: "{app}\App\{#AppExeName}"; \
    Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; \
    Flags: nowait postinstall

This does not work in the sense that the installer does not finish properly, os hangs waiting for the server (ServerExeName). I guess it is waiting for the server to go into an idle state which does not happen. (Same thing goes for the 'waituntilterminated' flag since the server will and shall not terminate). What is the preferred Inno Setup way of making sure the server has started before continuing (starting the other application)?

I'm running Inno Setup 5.6.1u, but I can upgrade if needed. The web server is CherryPy web server bundled to an exe using PyInstaller. The application is custom made wxWidgets based GUI.

1

1 Answers

1
votes

waituntilidle is very specific thing. It internally uses WaitForInputIdle WinAPI function. Read more about it to understand, when it can be used.

If it does not fit your server application, you will have to implement some sort of signal in it, that Inno Setup can look for. On *nix systems, a pidfile is commonly used for this purpose. Or use a mutex or other similar mechanism.


Even easier might be to add a function/switch to your application (not the server) that will make it wait until the server is running.