The International Simutrans Forum

 

Author Topic: Every save could update to the updated version of the pakset/.exe  (Read 4194 times)

0 Members and 1 Guest are viewing this topic.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #70 on: January 16, 2018, 05:47:58 AM »
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.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #71 on: January 18, 2018, 12:42:53 AM »
Splendid, thank you for that. Can I check under what licence that this software is made available?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #72 on: January 18, 2018, 01:56:36 AM »
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.
« Last Edit: January 18, 2018, 06:56:57 AM by DrSuperGood »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #73 on: January 18, 2018, 09:14:43 AM »
Excellent, thank you very much for testing.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #74 on: January 19, 2018, 12:54:50 AM »
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.
« Last Edit: January 19, 2018, 07:47:40 AM by DrSuperGood »

Offline thegamer7893 england

  • *
  • Posts: 796
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #75 on: January 19, 2018, 04:16:04 PM »
After I install this, where do I put all the files in?

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Every save could update to the updated version of the pakset/.exe
« Reply #76 on: January 19, 2018, 04:44:54 PM »
After I install this, where do I put all the files in?
In the folder where you installed it.

Offline thegamer7893 england

  • *
  • Posts: 796
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #77 on: January 19, 2018, 04:49:08 PM »
I mean do you put it in the Simutrans Extended file?

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Every save could update to the updated version of the pakset/.exe
« Reply #78 on: January 19, 2018, 04:53:59 PM »
You put it into the folder where Simutrans-Extended.exe is.

Offline thegamer7893 england

  • *
  • Posts: 796
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #79 on: January 19, 2018, 05:44:07 PM »
Yes I've done that but it has not like auto updated stuff like the livery additions etc.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Every save could update to the updated version of the pakset/.exe
« Reply #80 on: January 19, 2018, 06:02:31 PM »
Livery definitions cannot update in existing saves.

Offline thegamer7893 england

  • *
  • Posts: 796
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #81 on: January 19, 2018, 09:30:03 PM »
RIP

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #82 on: January 19, 2018, 11:25:35 PM »
One has to run the updater application. Doing so requires Java 9 be installed.

Offline thegamer7893 england

  • *
  • Posts: 796
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #83 on: January 20, 2018, 11:22:52 AM »
I have that installed

Offline Matthew gb

  • *
  • Posts: 227
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
Re: Every save could update to the updated version of the pakset/.exe
« Reply #84 on: May 03, 2019, 04:22:05 PM »
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.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #85 on: May 04, 2019, 04:02:49 AM »
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.
And this still is the case, minus the auto updating of Java SE.
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).
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.
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.
It runs fine on Windows with the latest Oracle JDK.
@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.

Offline Matthew gb

  • *
  • Posts: 227
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
Re: Every save could update to the updated version of the pakset/.exe
« Reply #86 on: May 09, 2019, 09:33:37 PM »
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.

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.

Quote
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.

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.

Quote
It 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.

Quote
I 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.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Every save could update to the updated version of the pakset/.exe
« Reply #87 on: May 10, 2019, 10:52:35 PM »
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.
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.