Search code examples
install4j

Can't run application from install4j launcher after install has completed


I have completed the core functionality of my installer, but need to add the ability for the user to launch the application after it has finished installing.

I have already gained elevated privileges earlier in the install process, but when the installer tries to launch the application it fails with the following error log:

java.io.IOException: Cannot run program "C:\Program Files\abc\xyz\xyz 1.2.exe" (in directory "C:\Program Files\abc\xyz"): CreateProcess error=740, The requested operation requires elevation
at java.base/java.lang.ProcessBuilder.start(Unknown Source)
at java.base/java.lang.ProcessBuilder.start(Unknown Source)
at com.install4j.runtime.installer.helper.launching.LaunchHelper.launchOnWindows(LaunchHelper.java:387)
at com.install4j.runtime.installer.helper.launching.LaunchHelper.launchApplicationDirectly(LaunchHelper.java:151)
at com.install4j.runtime.installer.helper.launching.LaunchHelper.access$000(LaunchHelper.java:33)
at com.install4j.runtime.installer.helper.launching.LaunchHelper$2.fetchValue(LaunchHelper.java:110)
at com.install4j.runtime.installer.helper.launching.LaunchHelper$2.fetchValue(LaunchHelper.java:107)
at com.install4j.runtime.installer.helper.comm.actions.FetchObjectAction.execute(FetchObjectAction.java:14)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionWrapper(HelperCommunication.java:367)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.access$200(HelperCommunication.java:30)
at com.install4j.runtime.installer.helper.comm.HelperCommunication$1.run(HelperCommunication.java:96)
Caused by: java.io.IOException: CreateProcess error=740, The requested operation requires elevation
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(Unknown Source)
at java.base/java.lang.ProcessImpl.start(Unknown Source)
... 11 more

Any ideas?


Solution

  • If this is generated launcher, try selecting "As invoker" on the "Executable info->Windows manifest options" step of the launcher wizard. The "Run executable" action will provide the privileges.