You are here

Arduino Legacy Portable 1.8.19 Dev Test 4

42 posts / 0 new
Last post
Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
Arduino Legacy Portable 1.8.19 Dev Test 4

Application: Arduino
Category: Development
Description:

The Arduino IDE.

Features: Arduino is an open-source physical computing platform based on a simple I/O board and a development environment that implements the Processing/Wiring language. Arduino can be used to develop stand-alone interactive objects or can be connected to software on your computer (e.g. Flash, Processing and MaxMSP). The boards can be assembled by hand or purchased preassembled.

Download Arduino Legacy 1.8.19 Portable Development Test 4 [110MB download / 544MB installed]
(MD5: 944dd3c88fd38b242b01e769bcfc43bb)
(SHA256: 6bfbda658d7b79927a245fc56d088c9f74dd03cbbc24f95a3e17a5559d1cb0d9)
(SHA512: c946e37b93174d62de00237d5bb3908f39a12930caaa6b4bf73a46efae294bccd9a2259ad551513e5e1894a36ba9dce63fca2856f27893506b7e6a5865a69c98)
(BLAKE3: 216f6f845260317a1ebeda5ac7933c405e8dd9b6ef01f17e584e0248356634a1)

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
Updated Arduino to 1.8.16 DT 1

Update base app.

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
Updated Arduino to 1.8.19 DT 1

Update base app. Update link in libraries instructions. Lossless compression of image files (.gif, .jpg, .png, etc)

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
What about version 2?

What about version 2?

I'd like to see the currently latest Arduino IDE 2.1.1 in portableapps format.

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
Funny you should mention it...
Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Storage Efficient purpose

I'd like to use the Java in CommonFiles folder instead.
Symbolic link with mklink /d is effective and non-official but only works on NTFS.
Do you have better ways?

According to https://forum.arduino.cc/t/forcing-java-64-bit-with-arduino/1076759/5
It seems that the Java path is hard-coded.

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
No idea.

This one is a little over my head. Need to learn some stuff before I can weigh in. New with java.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Bug Report: The PAL:DataDir folder seems to have no purpose

The PAL:DataDir folder seems to have no purpose.
The real data is in the portable folder instead.

There won't be any update to the main app, so it's trivial.
But this seems weird to me.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Bug Report: Fail to launch on Windows 7

On Windows 7, if java was replaced, for example either with:

Then it won't launch with ArduinoPortable.exe
But it will launch successfully if directly launched with arduino.exe within the App\1.8.19 directory.

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
So...

You're saying that if you modify the package in a way I haven't specified, it doesn't work as intended? Seems like expected behaviour to me.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
It seems to be fixed at the moment.

With the new Arduino1Portable.exe, I was able to launch it just fine with the currently latest version of Adoptium Temurin JRE 8.0.452+9 x86.

Not sure what was the cause and its fix.

If I guess, it might be because of the use of the latest version of PortableApps.com Launcher.

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
cool

cool cool cool

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Bug Report: Some Tools will fail to open

Some tools will fail to open with ArduinoPortable.exe, but it will successfully open if directly launched with arduino.exe

For example: Guino https://www.instructables.com/Guino-Dashboard-for-your-Arduino/

java.io.IOException: Cannot run program "C:\ArduinoPortable\tools\Guino\tool\guino\GUINO.exe" (in directory "C:\ArduinoPortable\tools\Guino\tool\guino"): CreateProcess error=2, The system cannot find the file specified

It should be C:\ArduinoPortable\App\1.8.19\tools\Guino\tool\guino\GUINO.exe
I think the IDE couldn't detect that the directory has changed because indirectly launched (not by arduino.exe).
What's the solution?

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
Solution

Don't use guino. Wink

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Real proper solution.

I've just found the fix.

Add this line to the Arduino1Portable.ini file:

WorkingDirectory=%PAL:AppDir%\1.8.19

---

Very bad solution from you lol *yahoo*

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
Wisdom...

...is getting other people to do it for you.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
I didn't know back then on what to modify.

I didn't know back then on what to modify.

If I'd known, I would've posted it as a suggestion instead of a bug report.

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
all good.

I keep learning things as I go as well. It's a work of love.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Suggestion: Launch4j configuration

Beside the portable folder that I've mentioned before.
arduino.l4j.ini and arduino_debug.l4j.ini should also be in the Data folder.

Somtimes we need to increase the -Xmx<maximum heap size> to avoid the error of Exception in thread "AWT-EventQueue-1" java.lang.OutOfMemoryError: Java heap space.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Bug report & Suggestion

With the new update, I think you forgot to rename the file of ArduinoPortable.ini to Arduino1Portable.ini
Otherwise it could not be launched.

---

Based on the format of another PortableApps of legacy apps, such as Mozilla Firefox, Portable Edition Legacy 115. I think the current Name variable is awkward.

it's better to rename it as Arduino IDE Portable (Legacy 1.8.19).
Since the PortableApps.com Platform will strips out the Portable word, it will shows up in the app list nicely as Arduino IDE (Legacy 1.8.19)

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
lol

not super important. i'll get around to it in a bit.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Hmm

I see that you haven't update the download links for the fixes.

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
there.

Updated now. Smile

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
One last thing

You forget to include this in the .ini file.

WorkingDirectory=%PAL:AppDir%\1.8.19
Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
ok

that should be fixed now too.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Very good

Everything seems to be perfect now.
Thank you for your work.

Peppernrino
Peppernrino's picture
Offline
Last seen: 6 months 2 weeks ago
Joined: 2016-09-05 13:42
Thank you

Could not have done it without your help. Appreciate it.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Fatal Bugs

https://portableapps.com/manuals/PortableApps.comLauncher/ref/launcher.i...

WaitForEXEN

Value: another_optional_app.exe
Optional.

If the program that you run is a launcher program which launches another executable, and you need to wait for that as well as (or instead of) the original program, specify its file name here, as WaitForEXE1=whatever.exe. If you need more than one, use WaitForEXE2, WaitForEXE3, etc.

Arduino 1.8.19 is a Java based GUI app.
Based on: https://github.com/arduino/Arduino/blob/master/build/windows/launcher/co...
The main arduino.exe launches another executable of javaw.exe

Without WaitForEXEN, the ArduinoLegacyPortable.exe will not wait for the javaw.exe to exit, and the [DirectoriesMove] section will execute prematurely. This will cause data loss for the app.

Please consider to fix the ArduinoLegacyPortable.ini by adding the [Launch] section's entry with the key and value of WaitForEXE1=javaw.exe

[Launch]
ProgramExecutable=1.8.19\arduino.exe
WorkingDirectory=%PAL:AppDir%\1.8.19
DirectoryMoveOK=yes
SupportsUNC=yes
WaitForEXE1=javaw.exe

[DirectoriesMove]
portable=%PAL:AppDir%\1.8.19\portable

---

https://portableapps.com/development/portableapps.com_format

DefaultData is usually used as a container for the default files to be placed within the Data directory. Generally, the launcher, when run, will check if there is a set of files within Data and, if not, will copy them from DefaultData.

Furthermore, the folder structure needs to be proper.
The portable folder should be in the DefaultData folder instead of in the App folder.

And also the default portable folder's content should be empty.

ArduinoLegacyPortable
+ App
  + AppInfo
  + 1.8.19
  + DefaultData
    + portable
+ Data
+ Other
  + Help
    + Images
  + Source

---

Tested and works.

Since this is a launch4j app, there are other ways, such as bypassing the arduino.exe and directly launching it through java/bin/javaw.exe
https://portableapps.com/manuals/PortableApps.comLauncher/topics/java.ht...

Not sure which one is better, the WaitForEXE or direct launch.

JLim
Online
Last seen: 54 min 28 sec ago
Joined: 2013-07-17 01:30
Java created a directory in

Java created a directory in "C:\ProgramData\Oracle\Java". You need to handle this too.

[DirectoriesMove]
-=%AllUsersAppData%\Oracle\Java

[DirectoriesCleanupIfEmpty]
1=%AllUsersAppData%\Oracle

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
An elegant way to disable Oracle Java Usage Tracker

References

Related:
https://stackoverflow.com/questions/49888290/how-do-you-disable-home-jav...
https://stackoverflow.com/questions/60588394/oracle-jdk-usage-logging
https://docs.oracle.com/en/java/java-components/usage-tracker/
https://docs.oracle.com/javase/9/troubleshoot/JSTGD.pdf
https://www.oracle.com/java/technologies/javase/10-relnote-issues.html
https://steamcommunity.com/sharedfiles/filedetails/?id=3134362402
https://beingwinsysadmin.blogspot.com/2018/05/java-usage-tracking-or-how...
https://www.oracle.com/java/technologies/javase/8u102-relnotes.html
https://www.oracle.com/java/technologies/javase/8u60-relnotes.html
https://bugs.openjdk.org/browse/JDK-8135224
https://bugs.java.com/bugdatabase/JDK-8169236

https://www.oracle.com/java/technologies/javase/8u171-relnotes.html

core-svc/java.lang.management

System Property to Disable JRE Last Usage Tracking

A new system property jdk.disableLastUsageTracking has been introduced to disable JRE last usage tracking for a running VM. This property can be set in the command line by using either -Djdk.disableLastUsageTracking=true or -Djdk.disableLastUsageTracking. With this system property set, JRE last usage tracking will be disabled regardless of the com.oracle.usagetracker.track.last.usage property value set in usagetracker.properties.

JDK-8192039 (not public)

I don't know for sure since when does the com.oracle.usagetracker.track.last.usage exist or even the swtich, and also how does their usage evolve in the newer versions. Maybe only the Oracle vendor that uses it? According to the bug tracker by Pardeep Sharma, it does exist since 8u112 albeit unofficially documented.

After researching through the references, I believe that com.oracle.usagetracker.track.last.usage exists since Oracle Java 8u60 and the -Djdk.disableLastUsageTracking exists since Oracle Java 8u171

The documentations are just very scattered, but it is helpful to know that it does exist.

Arduino IDE v1 Release Notes:
https://web.archive.org/web/20250513033935/https://www.arduino.cc/en/sof...
https://github.com/arduino/Arduino/releases

Direct download link collections:
https://www.npackd.org/p/ArduinoSA.arduino

After downloading through manual direct link, I've observed that Arduino 1.6.5-r5 uses Java 8u51, while Arduino 1.6.6 uses Java 8u66
So the usage tracking issue has existed since the version of 1.6.6 (2015.11.03)

Most importantly, the Arduino IDE 1.8.19 uses Oracle Java 8u191, so we have both methods available.

---
Methods

The first method,
It utilizes the usagetracker.properties file with the content of com.oracle.usagetracker.track.last.usage=false

ArduinoLegacyPortable.ini file:

[FilesMove]
usagetracker.properties=%PAL:AppDir%\1.8.19\java\lib\management

The second method,
It utilizes the environment variable of JAVA_TOOL_OPTIONS with the value of -Djdk.disableLastUsageTracking

ArduinoLegacyPortable.ini file:

[Environment]
JAVA_TOOL_OPTIONS=-Djdk.disableLastUsageTracking

---

Conclusions

I believe the most elegant way is the second method.
That way, it looks clean and doesn't add unnecessary clutters since we only need to disable one thing.

The final config should be like this:

ArduinoLegacyPortable.ini file:

[Launch]
ProgramExecutable=1.8.19\arduino.exe
WorkingDirectory=%PAL:AppDir%\1.8.19
DirectoryMoveOK=yes
SupportsUNC=yes
WaitForEXE1=javaw.exe

[DirectoriesMove]
portable=%PAL:AppDir%\1.8.19\portable

[Environment]
JAVA_TOOL_OPTIONS=-Djdk.disableLastUsageTracking

The folder structure:

ArduinoLegacyPortable
+ App
  + AppInfo
  + 1.8.19
  + DefaultData
    + portable
+ Data
+ Other
  + Help
    + Images
  + Source

---

P.S.

It's getting more perfect each time, but it takes time to research.
I'm very thankful for all of you.
Good job!

JLim
Online
Last seen: 54 min 28 sec ago
Joined: 2013-07-17 01:30
using open-source distributions

From google ai:
You can download Java 8 without Oracle's usage tracker or account requirements by using open-source distributions like Eclipse Adoptium (Temurin) available at Adoptium.
Free Java 8 Alternatives:
Eclipse Temurin (Adoptium): Provides fully certified OpenJDK 8 binaries with no tracking or login walls.

Amazon Corretto: A no-cost, multiplatform, production-ready distribution of OpenJDK 8 by Amazon.

Azul Zulu: Offers free builds of OpenJDK 8 for various operating systems and architectures.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Re: using open-source distributions

Of course.

I personally did test it with Liberica Standard JRE 8u504+1 x86 32 for Windows and it works fine.
The Liberica vendor supports Java 8 32-bit until March 2031.
https://bell-sw.com/blog/oracle-java-8-and-11-end-of-life-risks-migratio...

Other vendors have already dropped the support for Java 8 32-bit.
For example, Termurin, https://github.com/adoptium/temurin-build/issues/4319

---

Assuming the need to maintain the policy to not alter the main distribution app due to licensing issues.
Then that is the most elegant solution that I can think of.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Direct launch of built-in javaw.exe

References

https://github.com/PortableApps/Launcher/blob/master/Other/Source/Portab...
https://portableapps.com/manuals/PortableApps.comLauncher/topics/java.html
https://github.com/PortableApps/Launcher/blob/master/Other/Source/Includ...
https://github.com/arduino/Arduino/blob/master/arduino-core/src/processi...
https://github.com/arduino/Arduino/blob/master/arduino-core/src/processi...
https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf...
https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi...
https://learn.microsoft.com/en-us/windows/win32/api/handleapi/nf-handlea...

Background

Based on the PortableApps.comLauncher.nsi, the current implementation of ProcessWaitClose and WaitForExeN inside the Execute function uses file name based tracking instead of PID based tracking, even though ProcessWaitClose macro itself supports PID tracking. These may results in false positive of another executable elsewhere with the same name that could cause race conditions and data losses.

Specifically, it uses ExecWait or Exec function directly instead of ${Execute} macro that could return PID for the ${ProcessWaitClose}. At least, I believe it would be helpful if $ExecString coulld be parsed first and then be passed into ${Execute}.

PortableApps.comLauncher.nsi

...
Function Execute           ;{{{1
    ; Users can override this function in Custom.nsh
    ; like this (see Segments.nsh for the OverrideExecute define):
    ;
    ;   ${OverrideExecute}
    ;       [code to replace this function]
    ;   !macroend

    !ifmacrodef OverrideExecuteFunction
        !insertmacro OverrideExecuteFunction
    !else
    ${!getdebug}
    !ifdef DEBUG
        ${If} $WaitForProgram != false
            ${DebugMsg} "About to execute the following string and wait till it's done: $ExecString"
        ${Else}
            ${DebugMsg} "About to execute the following string and finish: $ExecString"
        ${EndIf}
    !endif
    ${EmptyWorkingSet}
    ClearErrors
    ${ReadLauncherConfig} $0 Launch HideCommandLineWindow
    ${If} $0 == true
        ; TODO: do this without a plug-in or at least some way it won't wait with secondary
        ExecDos::exec $ExecString
        Pop $0
    ${Else}
        ${IfNot} ${Errors}
        ${AndIf} $0 != false
            ${InvalidValueError} [Launch]:HideCommandLineWindow $0
        ${EndIf}
        ${If} $WaitForProgram != false
            ExecWait $ExecString
        ${Else}
            Exec $ExecString
        ${EndIf}
    ${EndIf}
    ${DebugMsg} "$ExecString has finished."

    ${If} $WaitForProgram != false
        ; Wait till it's done
        ClearErrors
        ${ReadLauncherConfig} $0 Launch WaitForOtherInstances
        ${If} $0 == true
        ${OrIf} ${Errors}
            ${GetFileName} $ProgramExecutable $1
            ${DebugMsg} "Waiting till any other instances of $1 and any [Launch]:WaitForEXE[N] values are finished."
            ${EmptyWorkingSet}
            ${Do}
                ${ProcessWaitClose} $1 -1 $R9
                ${IfThen} $R9 > 0 ${|} ${Continue} ${|}
                StrCpy $0 1
                ${Do}
                    ClearErrors
                    ${ReadLauncherConfig} $2 Launch WaitForEXE$0
                    ${IfThen} ${Errors} ${|} ${ExitDo} ${|}
                    ${ProcessWaitClose} $2 -1 $R9
                    ${IfThen} $R9 > 0 ${|} ${ExitDo} ${|}
                    IntOp $0 $0 + 1
                ${Loop}
            ${LoopWhile} $R9 > 0
            ${DebugMsg} "All instances are finished."
        ${ElseIf} $0 != false
            ${InvalidValueError} [Launch]:WaitForOtherInstances $0
        ${EndIf}
    ${EndIf}
    !endif
FunctionEnd
...

BaseNoGui.java

...
  static public File getContentFile(String name) {
    String appDir = System.getProperty("APP_DIR");
    if (appDir == null || appDir.length() == 0) {
      appDir = currentDirectory;
    }
    File installationFolder = new File(appDir);
    return new File(installationFolder, name);
  }
...
  static public void initPortableFolder() {
    // Portable folder
    portableFolder = getContentFile("portable");
    if (!portableFolder.exists()) {
      portableFolder = null;
    }
  }
...

Furthermore, the portable folder is hardcoded to be the child of APP_DIR
It will be much easier if we could customize it through the javaw.exe arguments.

But the reality is that, there is a trade-off between the need to keep the portable folder to be in the Data folder and avoiding the NSIS false positives of polling the process name due to the current usage of ProcessWaitClose.

In order to tackle the trade-off, at least these are the long-term requirement.
1. Directly launch the javaw.exe as ProgramExecutable
2. Utilize custom NSIS script to track the spawned PID in an event-driven manner.

---

Findings

- I have found two equivalent command line based on the executables, the release build and the debug build.

- The release build uses javaw.exe while the debug build uses java.exe.
- The debug build omit the splash argument in order to be able to see the debug outputs in the terminal.
- The original command line has a long classpath argument's value, which may cause long path issues, so I've changed with - wildcard.
- The -Djdk.disableLastUsageTracking to prevent usage tracking is also added.
- And I've also increased the -Xmx into 1024M in order to avoid out of memory error.

If the debug build is desired, then
1. Use java.exe instead of javaw.exe
2. Add the argument of -DDEBUG=true
3. Remove the argument of splash

Equivalent javaw.exe command line from arduino.exe

".\java\bin\javaw.exe" -splash:".\lib\splash.png" -Djdk.disableLastUsageTracking -Xms128M -Xmx1024M -Dsun.java2d.d3d=false -Djna.nosys=true -Djna.nounpack=true -Djna.boot.library.name=jnidispatch-4.2.2-win32-x86 -Djna.boot.library.path=".\lib" -Djssc.library.path=".\lib" -DAPP_DIR="." -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -classpath ".\lib\*" processing.app.Base

Equivalent java.exe command line from arduino_debug.exe

".\java\bin\java.exe" -DDEBUG=true -Djdk.disableLastUsageTracking -Xms128M -Xmx1024M -Dsun.java2d.d3d=false -Djna.nosys=true -Djna.nounpack=true -Djna.boot.library.name=jnidispatch-4.2.2-win32-x86 -Djna.boot.library.path=".\lib" -Djssc.library.path=".\lib" -DAPP_DIR="." -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -classpath ".\lib\*" processing.app.Base

---

Summary

Milestone:

  1. Single PortableApp Instance with the usual process name tracking.
  2. (false positives to other javaw.exe)

  3. Single PortableApp Instance with child PID tracking.
  4. (false positives is gone but only one Arduino IDE)

  5. Multiple PortableApp Instances with child PID tracking.
  6. (same as the second, except supporting multiple Arduino IDE)

Currently, these are what I'm proposing for the first milestone.

ArduinoLegacyPortable.ini

[Launch]
SingleAppInstance=false
SinglePortableAppInstance=true
DirectoryMoveOK=yes
SupportsUNC=yes
WorkingDirectory="%PAL:AppDir%\1.8.19"
ProgramExecutable="1.8.19\java\bin\javaw.exe"
CommandLineArguments=-splash:"%PAL:AppDir%\1.8.19\lib\splash.png" -Djdk.disableLastUsageTracking -Xms128M -Xmx1024M -Dsun.java2d.d3d=false -Djna.nosys=true -Djna.nounpack=true -Djna.boot.library.name=jnidispatch-4.2.2-win32-x86 -Djna.boot.library.path="%PAL:AppDir%\1.8.19\lib" -Djssc.library.path="%PAL:AppDir%\1.8.19\lib" -DAPP_DIR="%PAL:AppDir%\1.8.19" -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -classpath "%PAL:AppDir%\1.8.19\lib\*" processing.app.Base

[DirectoriesMove]
portable="%PAL:AppDir%\1.8.19\portable"

---

2026-11-24

Sometimes, I find that the [directory] of [DirectoriesMove] becomes empty instead, not sure what's the cause.
I presume due to locked handles.

I believe that the [DirectoriesMove] is not robust enough to handle GiBs of directory moves with hundreds of thousands of files.

The current workaround is to not use the DirectoriesMove, and just keep the portable folder within the same folder as the arduino.exe

  static public void initPortableFolder() {
    // Portable folder
    portableFolder = getContentFile("portable");
    if (!portableFolder.exists()) {
      portableFolder = null;
    }
  }

There's just no better solution here for portabilization, since it's hardcoded in the source code.

JLim
Online
Last seen: 54 min 28 sec ago
Joined: 2013-07-17 01:30
Java in CommonFiles directory
Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
The UI with non Java 8

That is possible, but I prefer not to.

Careful attention is needed if using non Java 8, since it has effect on the UI.
The menu list vertical spacing is much taller than usual, and it ruins the experience for users with low screen resolution.

I presume that non-Java 8 runtimes utilize different UI frameworks and implementations.
Or maybe the IDE UI implementation itself could only work well with Java 8.
In such cases, the research on the IDE source code is needed.

Most importantly, I haven't found the javaw arguments to make the use of non-Java 8 to look identical to the Ui with Java 8.

JLim
Online
Last seen: 54 min 28 sec ago
Joined: 2013-07-17 01:30
Official PAL

In this case you can use official version of PAL which look for only Java 8.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
What's your reason to make your own launcher?
JLim
Online
Last seen: 54 min 28 sec ago
Joined: 2013-07-17 01:30
Official PAL 32-bit Java 8 only

Official version of PAL only look for Java directory in CommonFiles directory which is 32-bit Java 8.
To use other versions we have to write custome code.

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Not entirely correct.

https://github.com/PortableApps/Launcher/blob/master/Other/Source/Segmen...
https://github.com/PortableApps/Launcher/issues/10

The Java.nsh haven't supported to find JDK64, OpenJDK, OpenJDK64, OpenJDKJRE, and OpenJDKJRE yet.

But at least, it supports Java, Java64, and JDK.

There's a workaround to use, although not ideal, for example, %PAL:PortableAppsDir%\CommonFiles\OpenJDK\bin\javaw.exe as [Launch]:ProgramExecutable.

JLim
Online
Last seen: 54 min 28 sec ago
Joined: 2013-07-17 01:30
Current official version 2.2.9

That's the upcoming version 3. It hasn't been released yet, and in fact, not many people know about it.
The current official version use by all portable apps in portableapps.com is v2.2.9 https://portableapps.com/apps/development/portableapps.com_launcher

Unknown123
Offline
Last seen: 5 hours 10 min ago
Joined: 2016-06-23 04:38
Ah you're right

Ah you're right, I forgot the git branch.
That would mean no further development of Java.nsh has been made public since 2011.

The development of Java.nsh itself has been stagnant since 2017.

JLim
Online
Last seen: 54 min 28 sec ago
Joined: 2013-07-17 01:30
Workaround for own use only

The workaround method suitable for own use portable apps only. For pubilicly release portable apps we do not know which version of java the users have installed.

Log in or register to post comments