0

I am packaging my app into exe with javafx-maven-plugin. x64 version works well. But then I package x86 version on 32-bit Windows 7 (running in VirtualBox if that's important) with 32-bit JDK 1.8.0_161 and 32-bit Maven. The resulting application installs, but fails to run, claiming that MSVCR100.dll is missing even though it is in the runtime\bin folder. I googled around and found out that this is a JDK bug that was supposedly fixed way back in u40. So why does this still happen? If I copy that dll manually next to the .exe it starts on one machine (again, in VirtualBox), but for some reason silently crashed on another (real one this time, fresh installation). Found an identical problem in javafx-gradle-plugin issues, though it got resolved when building on newest Win10 version, whereas I'm building on newest Win7.

If I just install Microsoft Visual C++ 2010 Redistributable Package then everything works, obviously, but I don't want user having to do that. So how do I copy .dll with Inno Setup script and how do I figure out the reason behind silent crashing?

graynk
  • 131
  • 1
  • 2
  • 17

2 Answers2

0

There may be another .dll on which MSVCR100.dll depends and which is not present on specific machine.

That is a reason why the Redistributable Package installs everything together.

Try to find another dependencies using http://dependencywalker.com/, it looks like you need more dlls than MSVCR100.dll.

Or simply install Redistributable Package on each machine. Installing it multiple times does not harm any application or system.

Slappy
  • 5,250
  • 1
  • 23
  • 29
  • Dependency Walker reports following dlls as missing: API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL, API-MS-WIN-CORE-WINRT-L1-1-0.DLL, API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL, API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL, DCOMP.DLL, IESHIMS.DLL. There's also a warning message: "Warning: At least one delay-load dependency module was not found. Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module." However, working installations report those same dlls missing with the same warnings. – graynk Feb 12 '18 at 07:25
  • Tested a bit more, the same installer installs and launches perfectly on Win10x86. On fresh (pretty old setup) of Win7x86 it also works (with one necessary update) but requires MSVCR100.dll to be copied, as stated earlier (so the silent crash is machine specific, I think. It crashes even with Redist package installed). And one last thing: installer built on Win10x86 installs on Win7X86 and works perfectly. No copying of dll required. Go figure. Should I file a bug or something? – graynk Feb 12 '18 at 08:01
0

I don't think this is related to Windows being 32 bit and it just happens to coincide with your two testing computers. I posted a question that is related here: Failed to find library: jvm.dll. What's going on here?

What you are experiencing is likely a bug on java(fx)packager as described here: https://bugs.openjdk.java.net/browse/JDK-8191176. That bug report claims the bug started on 8u155 and was solved by 8u171 but I am experiencing the bug all the way to the latest 8u172 b03 as I describe here: https://github.com/javafxports/openjdk-jfx/issues/59

I also tried going to 8u144 before the bug existed and I found that building the installer fails because of a missing MSVC dll (surprise! surprise!). I described the problem here: Where/how to get the MSVC dlls Java 1.8.0_144 wants?

Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
  • I ended up giving up on bundling JRE. Now I generate .exe with launch4j (that simply launches the .jar with installed JRE) and package the app with my own InnoSetup script – graynk Apr 05 '18 at 08:32
  • I see. Yeah, the situation is not good. I'm writing a long blog post about all of this. I'm not using InnoSetup because I'd rather distribute an MSI. I might end up using launch4j but in my case I need to include the JRE, so, I'm trying to figure that one out: https://stackoverflow.com/questions/49651902/how-to-get-the-jre-to-bundle-with-launch4j – Pablo Fernandez Apr 05 '18 at 08:45
  • launch4j can use bundled JRE, but in my case I found out that on Windows XP the app launched, but then crashed with Exception Access Violation when I clicked in any area of the window (Windows 7 and Windows 10 did not have that problem). Using installed JRE does not have that problem, so I'm rolling with that. – graynk Apr 05 '18 at 08:57
  • That is one of my fears, hence me asking what's the appropriate way to get the JRE to bundle. It seems everybody is content with a manual step of copying whatever JRE they have laying around. – Pablo Fernandez Apr 05 '18 at 09:01