javaprocessintegration-testinginstall4jgui-testing

Why does install4j sometimes start a separate process after the language selection dialog and sometimes not?


I'm working on automated UI testing.

When I start the installer on a physical Win 11 Pro machine, a separate process is created after the initial language selection dialog.

When the installer is started on a Hyper-V virtual machine (Win 11 Enterprise Evaluation image), there is only a single process.

I can work with both scenarios, but I would like to understand the reason, and maybe how to have it consistent so that I can use the same code for testing on my dev machine and when running in the Hyper-V VM.

I've tried launching the installer directly (with right-lick and run as admin), from a Command Prompt (run as admin), from Eclipse (run as admin) or via PsExec (sysinternals) with the -h flag.

I assume it has something to do with the way install4j elevation mechanism.

Another difference of the virtual machine is that it is not yet added to the domain (only proof of concept at this point), and the user is a local user instead of a domain user (but it is part of the local Administrators group).

Details:

enter image description here

After clicking ok, the wizard UI appears in a 2nd process:

enter image description here


Solution

  • The installer is restarted if the selected locale is different from the system locale.

    To avoid this, you have two options:

    1. Start the installer with the command line arguments

       -Duser.language=de -Dinstall4j.language=de
      

      In this case, the language selection dialog is not shown.

    2. Start the installer with the command line argument

       -Dinstall4j.noSecondaryProcess=true
      

      In this case, the language selection dialog is shown, but no restart is performed. Instead, the locale is set in the same process, which has some drawbacks that the restart avoids. I don't have a list of those drawbacks, but there may be inconsistent formatting or messages in the UI.