http://bugs.winehq.org/show_bug.cgi?id=58550
Bug ID: 58550 Summary: Native host executable is run asynchronously Product: Wine Version: 10.6 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: Bjoern@Kautler.net Distribution: ---
Some context to understand the use-case:
I have a build that runs on CI agents running Linux. That build runs InnoSetup through wine to build an EXE installer. To sign the executable you can give InnoSetup a command to run (signing after building is not possible, because there is also an uninstaller built into the result that also needs signing. For the signing I use JSign which cross-platform can sign executables using a remote sign server. JSign is a Java program.
I want to avoid provisioning a separate Windows Java Runtime just for that task. So I have a .bat file that translates the path of the signable file from wine path to Linux path.
Now I need to call the host systems Java runtime with that path and wait for it to finish.
I tried various things.
I tried like the FAQ suggests to add . to PATHEXT and just call the Linux executable. This works from the commandline like
wine /usr/lib/jvm/java-11-openjdk-amd64/bin/java
but also does not wait for the process to finish, if you do
wine /usr/lib/jvm/java-11-openjdk-amd64/bin/java; echo FOO
you see the FOO before the Java output.
Furthermore it does not work from inside the .bat file.
I also tried with
START /B /D . /WAIT /UNIX /usr/lib/jvm/java-11-openjdk-amd64/bin/java
This even works without manipulating PATHEXT. But is also does not wait for the process to finish, despite the /WAIT. It immediately returns and then further processing fails as JSign sees the file is not signed yet after the process seemingly ended.
So it seems wine never waits for the process to end, no matter what I use but immediately returns, making further processing impossible.