Packing Apps with built in JRE...

%3CLINGO-SUB%20id%3D%22lingo-sub-2591113%22%20slang%3D%22en-US%22%3EPacking%20Apps%20with%20built%20in%20JRE...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2591113%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20couple%20of%20applications%20that%20I%20am%20trying%20to%20capture%20that%20install%20their%20own%20JRE%20however%20after%20creating%20the%20MSIX%20they%20complain%20that%20the%20JRE%20can't%20be%20found%20and%20suggest%20setting%20JAVA_HOME.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E---------------------------%3CBR%20%2F%3EError%20launching%20IDEA%3CBR%20%2F%3E---------------------------%3CBR%20%2F%3EFailed%20to%20load%20JVM%20DLL%20C%3A%5CProgram%20Files%5CWindowsApps%5CIntelliJIDEACommunityEdition2016.3.4_163.12024.16.0_x64__p1z46hfsarpje%5CVFS%5CProgramFilesX86%5CJetBrains%5CIntelliJ%20IDEA%20Community%20Edition%202016.3.4%5Cjre%5Cjre%5Cbin%5Cserver%5Cjvm.dll%3CBR%20%2F%3EIf%20you%20already%20have%20a%2032-bit%20JDK%20installed%2C%20define%20a%20JAVA_HOME%20variable%20in%20Computer%20%26gt%3B%20System%20Properties%20%26gt%3B%20System%20Settings%20%26gt%3B%20Environment%20Variables.%3CBR%20%2F%3E---------------------------%3CBR%20%2F%3EOK%3CBR%20%2F%3E---------------------------%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20application%20works%20fine%20when%20installed%20from%20original%20source%20without%20an%20additional%20JRE%20installed%20or%20a%20JAVA_HOME%20Environment%20Variable%20set.%26nbsp%3B%20The%20file%20that%20can't%20be%20found%20is%20present%20in%20the%20location%20that%20the%20app%20is%20looking%20for%20them%2C%20I%20have%20tried%20capturing%20the%20app%20both%20with%20and%20without%20installing%20to%20VFS%20as%20well%20as%20installing%20to%20a%20location%20without%20spaces%20in%20the%20target%20folder%20structure.%26nbsp%3B%26nbsp%3BI%20have%20also%20launched%20the%20application%20during%20the%20capture%20phase%20and%20for%20the%20first%20use%20settings.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20also%20used%20the%20PSF%20Trace%20Fixup%20but%20all%20that%20seems%20to%20do%20is%20confirm%20the%20error%20message%20I%20am%20getting%20from%20the%20application.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20not%20sure%20what%20else%20I%20can%20try%20or%20why%20the%20app%20wouldn't%20be%20able%20to%20find%20the%20JRE%20when%20it%20is%20looking%20in%20the%20correct%20place.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2614902%22%20slang%3D%22en-US%22%3ERe%3A%20Packing%20Apps%20with%20built%20in%20JRE...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2614902%22%20slang%3D%22en-US%22%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F927331%22%20target%3D%22_blank%22%3E%40AndrewMason%3C%2FA%3E....%3CBR%20%2F%3EIs%20this%20resovled%3F%3F%3F%3F%20I%20am%20also%20facing%20this.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2618338%22%20slang%3D%22en-US%22%3ERe%3A%20Packing%20Apps%20with%20built%20in%20JRE...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2618338%22%20slang%3D%22en-US%22%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F927331%22%20target%3D%22_blank%22%3E%40AndrewMason%3C%2FA%3E%3CBR%20%2F%3EThanks%20for%20the%20reply..%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2651484%22%20slang%3D%22en-US%22%3ERe%3A%20Packing%20Apps%20with%20built%20in%20JRE...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2651484%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3E.%26nbsp%3B%20I%20have%20tried%20the%20EnvVar%20fixup%20but%20it%20doesn't%20seem%20to%20have%20any%20effect%20on%20the%20behaviour%20of%20the%20app%2C%20possible%20because%20more%20than%20one%20fix%20up%20is%20needed%20as%20you%20suggest.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20possible%20to%20set%2Fadd%20to%20the%20PATH%20env%20var%20with%20the%20EnvVar%20fix%20up%20as%20that%20is%20where%20the%20app%20is%20adding%20the%20%22missing%22%20paths%20at%20runtime%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2651796%22%20slang%3D%22en-US%22%3ERe%3A%20Packing%20Apps%20with%20built%20in%20JRE...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2651796%22%20slang%3D%22en-US%22%3E%3CP%3EHI%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EThe%20same%20type%20of%20issue%20faced%20with%20one%20more%20application%20%22Universal%20Village%20Corporate%22%2C%20the%20source%20installer%20of%20this%20app%20automatically%20prompt%20us%20to%20install%20JRE%201.6.0%2C%20as%20specified%20we%20have%20installed%20and%20bundled%20JRE%20along%20with%20the%20main%20application%2C%20also%20implemented%20all%20the%20fixups%20suggested%20by%20PSF%20Tool%20of%20latest%20version%20(psflauncher%2C%20FileRedirection%2CEnv%20fixups)%2C%20still%20no%20luck..%20while%20launching%20the%20shortcut%20it%20through%20the%20attached%20error%20%22Failed%20to%20load%20jvm.dll%20(Java%20VM%20Library)%20please%20make%20sure%20of%201.4%20or%20higher%20is%20installed%22.%20In%20second%20attempt%20I%20have%20specified%20the%20environment%20variable%20JAVA_HOME%20in%20to%20the%20MSIX%20package%2C%20but%20still%20no%20luck%2C%20with%20one%20more%20attempt..%20tried%20to%20inject%20Registry%20and%20Dynamic%20Library%20Fixups%20too%2C%20still%20it%20also%20not%20working.....%3C%2FP%3E%3CP%3Eas%20a%20part%20of%20trouble%20shooing%2C%20used%20procmon%20and%20filted%20the%20available%20outcome%20with%20processname%20psflauncher.exe%20along%20with%20PATH%20which%20contains%20jvm.dll%2C%20to%20check%20from%20which%20location%20its%20trying%20to%20access%20the%20dll%20file%2C%20but%20with%20this%20filter%20no%20tasks%20available%20in%20the%20list...%3C%2FP%3E%3CP%3ECould%20you%20please%20help%20us%20to%20resolve%20these%20type%20JAVA%20pre-req%20issues.%3C%2FP%3E%3CP%3EThanks%20in%20advance.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2652805%22%20slang%3D%22en-US%22%3ERe%3A%20Packing%20Apps%20with%20built%20in%20JRE...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2652805%22%20slang%3D%22en-US%22%3EReach%20out%20to%20me%20offline%20at%20tmangan%20%40%20tmurgent.com.%20It%20would%20be%20good%20to%20have%20you%20send%20me%20your%20package.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2695781%22%20slang%3D%22en-US%22%3ERE%3A%20Packing%20Apps%20with%20built%20in%20JRE...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2695781%22%20slang%3D%22en-US%22%3EI%20found%20the%20installer%2C%20and%20it%20seems%20to%20install%20natively%20without%20a%20JRE.%20Can%20you%20provide%20detail%20on%20what%20version%20JRE%20you%20use%2C%20and%20how%20to%20test%20if%20the%20app%20is%20working%3F%3C%2FLINGO-BODY%3E
New Contributor

I have a couple of applications that I am trying to capture that install their own JRE however after creating the MSIX they complain that the JRE can't be found and suggest setting JAVA_HOME.

 

---------------------------
Error launching IDEA
---------------------------
Failed to load JVM DLL C:\Program Files\WindowsApps\IntelliJIDEACommunityEdition2016.3.4_163.12024.16.0_x64__p1z46hfsarpje\VFS\ProgramFilesX86\JetBrains\IntelliJ IDEA Community Edition 2016.3.4\jre\jre\bin\server\jvm.dll
If you already have a 32-bit JDK installed, define a JAVA_HOME variable in Computer > System Properties > System Settings > Environment Variables.
---------------------------
OK
---------------------------

 

The application works fine when installed from original source without an additional JRE installed or a JAVA_HOME Environment Variable set.  The file that can't be found is present in the location that the app is looking for them, I have tried capturing the app both with and without installing to VFS as well as installing to a location without spaces in the target folder structure.  I have also launched the application during the capture phase and for the first use settings.

 

I have also used the PSF Trace Fixup but all that seems to do is confirm the error message I am getting from the application.

 

I'm not sure what else I can try or why the app wouldn't be able to find the JRE when it is looking in the correct place.

 

18 Replies
Hi @AndrewMason....
Is this resovled???? I am also facing this.
Hi @Siva116,

No, this isn’t resolved yet but I have noticed that if you inspect the main EXE with ProcMon you can see that the JRE bin folder and at least one other JRE path is present in the path environment variable for the EXE so it looks like that is created at runtime and the path is correct but it still says the JRE is invalid.

I’m not sure if there is something else missing or if maybe it wants to write somewhere in the JRE location.

Andrew
Hi @AndrewMason
Thanks for the reply..
While I suspect that there is more at play here, you can use the PSF to provide virtual environment variables like JAVA_HOME as container-specific environment variables (this is the purpose of the EnvVarFixup).

But I'm also guessing that you'll find the need for the registry fixup - you'd need to procmon the the access_denied registry entries --, the FileRedirectionFixup, and possibly DynamicLibraryFixup.

Thanks @TIMOTHY MANGAN.  I have tried the EnvVar fixup but it doesn't seem to have any effect on the behaviour of the app, possible because more than one fix up is needed as you suggest.

 

Is it possible to set/add to the PATH env var with the EnvVar fix up as that is where the app is adding the "missing" paths at runtime?

HI @TIMOTHY MANGAN,

The same type of issue faced with one more application "Universal Village Corporate", the source installer of this app automatically prompt us to install JRE 1.6.0, as specified we have installed and bundled JRE along with the main application, also implemented all the fixups suggested by PSF Tool of latest version (psflauncher, FileRedirection,Env fixups), still no luck.. while launching the shortcut it through the attached error "Failed to load jvm.dll (Java VM Library) please make sure of 1.4 or higher is installed". In second attempt I have specified the environment variable JAVA_HOME in to the MSIX package, but still no luck, with one more attempt.. tried to inject Registry and Dynamic Library Fixups too, still it also not working.....

as a part of trouble shooing, used procmon and filted the available outcome with processname psflauncher.exe along with PATH which contains jvm.dll, to check from which location its trying to access the dll file, but with this filter no tasks available in the list...

Could you please help us to resolve these type JAVA pre-req issues.

Thanks in advance.

 

 

Reach out to me offline at tmangan @ tmurgent.com. It would be good to have you send me your package.
Hi @TIMOTHY MANGAN,
Thanks for the reply.
The package is in locked down environment, which can't be sharable from my end. I am giving the name of that app which I faced that Java environment variable issue to reproduce.

Name : UVC
Version : 9.3.0
Author : Universal Village Corporation
I found the installer, and it seems to install natively without a JRE. Can you provide detail on what version JRE you use, and how to test if the app is working?
@AndrewMason - Never mind. I just reread your original post which had at least the first half of that question answered. I'll test it soon and report back.

@Siva116 @AndrewMason 

I have looked into UVC.  It is an odd thing... 

I don't have it working yet, but getting closer.

 

What I know:

  • DynamicLibraryFixup is needed for a number of dlls..
  • vcruntime140.dll and vcruntime140_1.dll must still be copied to the Program Files\UVC folder (as the app uses fileexists before loadlibrary so DynamicLibraryFixup doesn't help.

 

The app makes use of FindFirstFile and gets confused.  This is something that I am investigating as a potential edge-case bug in the FileRedirectionFixup.  I'll drop a note back here if fixable.

Thanks for the update @TIMOTHY MANGAN 

Is this resolved now? I also got a package which require (Zulu) Java 1.8 and got the JVM.DLL loading error. Also here i guess the variables are not set, but I can't find the solution to get it working.
There are many problems with this app that will need fixes that are "in progress", however there may be additional unidentified issues.

I can say that if the installer sets a environment variable, then the EnvVarFixup is needed. PsfTooling should automatically detect the need for that fixup if that is the case.
Hi Tim thanks for your response. I tried using the PsfTooling and it did detect the environment needed, but I was not able to get it in my package. I tried manually which also failed....will try again until I get it working ;)

@Pollewops 

The new version of the free PsfTooling (4.14) is now available in the Microsoft Store or TMurgent website. This includes many important fixes to the PSF that I announced earlier today (https://www.tmurgent.com/TmBlog/?p=3309 ).  This version solves a number of launching issues that we have been discussing, including PSF Scripting, and the launching of cmd files directly from the launcher.

 

Of importance for me to point out: The shell launch of a cmd/bat file by PsfLauncher used to drop out of the container and have no access to package files.  This is due to a change made by Microsoft a couple of years ago in the OS.  I found a way to overcome this in the 2021.09.23 PSF version, so that those shortcuts will work as you'd expect now.

 

I'll also mention that one of the apps with a "crappy java" I was pointed to was the UVC app.  This is a very old Java version which has additional behaviors that the PSF can't cope with today due to unanticipated OS limitations in the container.  Sorry!

Thanks a lot @TIMOTHY MANGAN for the new version of PSF Tool...

@TIMOTHY MANGAN Hi, when using the 4.14 toolbox I do get another psflauncher versions then when I download the psflauncher from the github location (https://github.com/TimMangan/MSIX-PackageSupportFramework/blob/develop/ZipRelease-v2021.09.26/Releas...

From the toolbox the size is much much larger and seems not to work with me.

When using the ones from github, the package starts working ;)