After seeing this post I started looking at the Java Portable Launcher and discovered that if I Drag&Dropped a .jar file to JavaPortableLauncher.exe it would work perfectly, but if I told C.A.F.E. Mod aka eXpresso to open .jar files with the Java Portable Launcher then double clicked on one, it would tell me that the file couldn't be found.
So I checked what was different about how the Drag&Drop method worked, how CAFE ran it. I found that when Drag&Dropping It was running "X:\PortableApps\JavaPortableLauncher\JavaPortableLauncher.exe" P:\ath\to\file.jar
, and when using CAFE It was running "X:\PortableApps\JavaPortableLauncher\JavaPortableLauncher.exe" "P:\ath\to\file.jar"
.
Looking into the JavaPortableLauncher.nsi file I thought I found the culprit:
Line 121: Exec `"$PortableAppsPath\CommonFiles\Java\bin\javaw.exe" -Duser.home="$EXEDIR\Data\AppData" -jar "$JarPath"`
Now, normally this is what you want, but when your $JarPath already includes quotes they double up, so it was trying to execute "X:\PortableApps\CommonFiles\Java\bin\javaw.exe" -Duser.home="X:\PortableApps\JavaPortableLauncher\Data\AppData" -jar ""P:\ath\to\file.jar""
, now it makes sense that it's not working.
So, the problem now is how to fix this?
Should there be a check to see if there are quotes in $JarPath or not, add/delete them, then run it, or should the launcher try it with quotes, and if it doesn't work try it without quotes (or vice versa), any other suggestions?
I later discovered the issue is that ${FileExists}
can't handle quotes, and have posted proper information including a fix in This Comment