News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Every save could update to the updated version of the pakset/.exe

Started by fam621, December 31, 2017, 01:26:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DrSuperGood

Can confirm that pak128.Sweden-Ex now appears to download perfectly.

I would say the tool is mature enough for a more wide scale deployment.

jamespetts

Splendid, thank you for that. Can I check under what licence that this software is made available?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

Probably should be under the same licence as Simutrans Extended seeing how it is effectively coupled to it. It is meant to be open source, just I have not uploaded the source to GitHub yet. Been meaning to do that for a few days now. Next to that it uses all standard Java 9 APIs, no other dependencies.

EDIT:
64 bit build deployment with the tool seems to have gone flawlessly, using it right now.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

The "Simutrans-Extended-64.exe" is actually just another copy of "Simutrans-Extended.exe"... Even the OS reports it as 32bit.

EDIT: Source code!
https://github.com/DrSuperGood/simutrans-extended-updater

Was written using Eclipse. The projects should just import and be ready to use. I might refractor the code around in the future, but this is probably low priority seeing how it is working pretty well.

fam621


Rollmaterial


fam621


Rollmaterial

You put it into the folder where Simutrans-Extended.exe is.

fam621

Yes I've done that but it has not like auto updated stuff like the livery additions etc.

Rollmaterial



DrSuperGood

One has to run the updater application. Doing so requires Java 9 be installed.


Matthew

Yesterday I managed to get the Nightly Updater working for the first time. Thank you, Dr SuperGood, it's very useful!

I discovered some things that may be helpful for other new users to know (though probably blindingly obvious to experienced Simutransians).

Nightly Updater is a .jar program, known as a 'Java applet'. In the past, the way to use a Java applet was to download 'Java' (a large package of tools called a 'JRE') from Java.com. This package would update itself regularly.

Since the Nightly Updater was written, this model has now been abandoned. Programs written in Java are supposed to be distributed as EXEs (like Simutrans itself). Java is now available in several distributions (somewhat like Linux) for coders. To use a Java applet, you must download a full distribution (called a 'JDK'). The Nightly Updater requires version 9 or above (version 9 itself is no longer available).

Nightly Updater works for me using a distribution called SapMachine. This is free (both 'free beer' and 'free speech') and version 11 will receive security updates until September 2022. Although it's a large package (~200MB) it's still smaller than a single download of the Simutrans-Expanded ZIP file, so well worth the effort. It has to be manually updated, but I don't think that this is necessary if it is only used for the Nightly Updater. However, if it becomes the default Java installation (which Windows users can turn off in the installer), then occasionally checking their website for security updates for version 11 might be wise.

In an ideal world, the Nightly Updater would be distributed as an EXE, but I understand that this adds nothing to gameplay and is therefore a vanishingly low priority for the community's coders, who are already very generous with their time and effort.

@DrSuperGood: I understand that you have licensed Nightly Updater under the Artistic Licence, which makes total sense so that it can be distributed with Simutrans. Would you be so kind as to dual-license it under the GPL with class-path exception too? This is the licence used by SapMachine, and therefore seems to be a prerequisite to any eventual distribution as an EXE.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

DrSuperGood

Quote from: Matthew on May 03, 2019, 04:22:05 PMNightly Updater is a .jar program, known as a 'Java applet'. In the past, the way to use a Java applet was to download 'Java' (a large package of tools called a 'JRE') from Java.com. This package would update itself regularly.
And this still is the case, minus the auto updating of Java SE.
Quote from: Matthew on May 03, 2019, 04:22:05 PMSince the Nightly Updater was written, this model has now been abandoned. Programs written in Java are supposed to be distributed as EXEs (like Simutrans itself). Java is now available in several distributions (somewhat like Linux) for coders. To use a Java applet, you must download a full distribution (called a 'JDK'). The Nightly Updater requires version 9 or above (version 9 itself is no longer available).
Java programs cannot compile to executables due to their nature. They always require a Java Virtual Machine to run. Yes one can technically compile a JVM into an executable and embed your Java program inside the executable as well, however this is a rather hacky approach as it means any update to the software requires downloading a complete multi megabyte JVM even for a tiny couple of kilobyte program.

To run Java applications now you still need to download a JVM. Oracle is kind enough to continue providing one for free. However as part of their drive to push Java fully open source they have discontinued "standard edition" with the JDK being the new standard edition. For Windows users all one has to do is install the JDK and it should work. However when I did this approach some manual tweaking was required since it did not register the JVM as installed correctly, something that has hopefully been fixed over the last many months.
Quote from: Matthew on May 03, 2019, 04:22:05 PMNightly Updater works for me using a distribution called SapMachine. This is free (both 'free beer' and 'free speech') and version 11 will receive security updates until September 2022. Although it's a large package (~200MB) it's still smaller than a single download of the Simutrans-Expanded ZIP file, so well worth the effort. It has to be manually updated, but I don't think that this is necessary if it is only used for the Nightly Updater. However, if it becomes the default Java installation (which Windows users can turn off in the installer), then occasionally checking their website for security updates for version 11 might be wise.
It runs fine on Windows with the latest Oracle JDK.
Quote from: Matthew on May 03, 2019, 04:22:05 PM@DrSuperGood: I understand that you have licensed Nightly Updater under the Artistic Licence, which makes total sense so that it can be distributed with Simutrans. Would you be so kind as to dual-license it under the GPL with class-path exception too? This is the licence used by SapMachine, and therefore seems to be a prerequisite to any eventual distribution as an EXE.
The point of writing it in Java was because Java is cross platform and so should work on Windows, Linux and Mac with the same download. Executables are not portable as they are Windows only files and so would at very least require 3 different distributions, one each for Windows, Linux and Mac and still it might not cover all platforms.

I am not sure what you mean by "class-path exception" in this context.

Matthew

I must apologize as my last post does not seem to have come across anything like the way that I intended. I'm grateful that you have volunteered the time to get the Nightly Updater working, DrSuperGood, but it's taken me many hours to get it working, and I hoped to save other new users the same bother.

Quote from: DrSuperGood on May 04, 2019, 04:02:49 AM
And this still is the case, minus the auto updating of Java SE.
...
To run Java applications now you still need to download a JVM. Oracle is kind enough to continue providing one for free. However as part of their drive to push Java fully open source they have discontinued "standard edition" with the JDK being the new standard edition. For Windows users all one has to do is install the JDK and it should work. However when I did this approach some manual tweaking was required since it did not register the JVM as installed correctly, something that has hopefully been fixed over the last many months.

As a Windows user, if I go to Java.com (as was the correct practice for many years), I am pushed to download Java 8 (with a new warning about licence conditions that seems intended to scare off ordinary users) and there is no mention of Java 9 and upwards at all. When I searched for Java 9, I found the Java 11 and 12 JDKs (9 seems to have gone), but they very clearly state that they are for developers and I am not a developer, so at first sight this seemed to be the wrong choice. I installed it, but like you I found that the Oracle JVM did not install correctly (only Java 8 appears in my PATH). So I found using applets much less straightforward than it used to be.

QuoteJava programs cannot compile to executables due to their nature. They always require a Java Virtual Machine to run. Yes one can technically compile a JVM into an executable and embed your Java program inside the executable as well, however this is a rather hacky approach as it means any update to the software requires downloading a complete multi megabyte JVM even for a tiny couple of kilobyte program.

You can see from the linked SuperUser discussion that there are other people with the diametrically opposite point of view. Until your post I didn't know it was a disputed point and I have no wish to take sides on a programmers' debate. I'm sorry if my comments came across as criticism - it was a result of ignorance.

QuoteIt runs fine on Windows with the latest Oracle JDK.The point of writing it in Java was because Java is cross platform and so should work on Windows, Linux and Mac with the same download. Executables are not portable as they are Windows only files and so would at very least require 3 different distributions, one each for Windows, Linux and Mac and still it might not cover all platforms.

This is a really important point that I completely missed. Last week I spent several hours looking at Java packaging/installation utilities (such as NSIS and the ones listed here) to try to work out whether it might be a feasible project for a non-developer like myself to put Nightly Updater into an EXE file that would run without any effort. But as you rightly say, that this isn't even desirable for Simutrans, so your solution of distributing a Java applet does make more sense.

QuoteI am not sure what you mean by "class-path exception" in this context.

Wikipedia has a brief summary. There's a helpful discussion on Stack Exchange of why it would be useful if the Nightly Updater was distributed as an EXE. But this is now academic, as you have helpfully pointed out that a Windows EXE is unhelpful for a multi-platform project such as Simutrans.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

DrSuperGood

Quote from: Matthew on May 09, 2019, 09:33:37 PMAs a Windows user, if I go to Java.com (as was the correct practice for many years), I am pushed to download Java 8 (with a new warning about licence conditions that seems intended to scare off ordinary users) and there is no mention of Java 9 and upwards at all. When I searched for Java 9, I found the Java 11 and 12 JDKs (9 seems to have gone), but they very clearly state that they are for developers and I am not a developer, so at first sight this seemed to be the wrong choice. I installed it, but like you I found that the Oracle JVM did not install correctly (only Java 8 appears in my PATH). So I found using applets much less straightforward than it used to be.
The idea is that since Java is open source that all JVMs should come with the source code and hence that all JVMs are now JDKs.

https://www.oracle.com/technetwork/java/javase/downloads/index.html

Java 12 is still quite new so I have not looked into it.