Identify installed version

News and discussion of the PC port of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Identify installed version

Post by hiran »

As far as I know Oolite shows it's version number in the window title.

What's the way to identify the installed version without having a human being reading the version after it has been started?
On Linux I can read a file with the complete version number. On MacOS I can at least read Info.plist and find major/minor version numbers.
But on Windows no such file exists, and in the prereleases we generate I can also not see special properties to be set on the executable.
Sunshine - Moonlight - Good Times - Oolite
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Identify installed version

Post by phkb »

The "oolite.app/Resources/manifest.plist" file has the Oolite version number inside.

Code: Select all

{
	title = "Oolite core";
	identifier = "org.oolite.oolite";
	
	version = "1.91";
	required_oolite_version = "1.91";
	
	license = "GPL 2+ / CC-BY-NC-SA 3.0 - see LICENSE.TXT for details";
	author = "Giles Williams, Jens Ayton and contributors";
	information_url = "http://www.oolite.org/";
}
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Identify installed version

Post by hiran »

phkb wrote: Sat Jul 08, 2023 4:07 am
The "oolite.app/Resources/manifest.plist" file has the Oolite version number inside.

Code: Select all

{
	title = "Oolite core";
	identifier = "org.oolite.oolite";
	
	version = "1.91";
	required_oolite_version = "1.91";
	
	license = "GPL 2+ / CC-BY-NC-SA 3.0 - see LICENSE.TXT for details";
	author = "Giles Williams, Jens Ayton and contributors";
	information_url = "http://www.oolite.org/";
}
That works. Thank you. :-)
Sunshine - Moonlight - Good Times - Oolite
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Identify installed version

Post by Switeck »

Latest.log ( found at C:\Oolite-Trunk\oolite.app\Logs on my install ) returns at least the major version number but not the internal build number.
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Identify installed version

Post by hiran »

Switeck wrote: Tue Jul 11, 2023 9:11 pm
Latest.log ( found at C:\Oolite-Trunk\oolite.app\Logs on my install ) returns at least the major version number but not the internal build number.
Another option, true. But it requires that Oolite has at least run once before.
On Linux, different Oolite installations would write to the same logfile $HOME/.Oolite/Logs/Latest.log so it would still be unknown what version that was...
Sunshine - Moonlight - Good Times - Oolite
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Identify installed version

Post by hiran »

hiran wrote: Sat Jul 08, 2023 5:36 am
phkb wrote: Sat Jul 08, 2023 4:07 am
The "oolite.app/Resources/manifest.plist" file has the Oolite version number inside.

Code: Select all

{
	title = "Oolite core";
	identifier = "org.oolite.oolite";
	
	version = "1.91";
	required_oolite_version = "1.91";
	
	license = "GPL 2+ / CC-BY-NC-SA 3.0 - see LICENSE.TXT for details";
	author = "Giles Williams, Jens Ayton and contributors";
	information_url = "http://www.oolite.org/";
}
That works. Thank you. :-)
I am coming back to this now. The version "1.91" is not good enough. I'd like to have the full version, such as "1.91.0.7541-231106-19bfb7d".
The reason is the sheer amount of 1.91s that we produce.

In Linux, after installation I find files like these

Code: Select all

GNUstep/Applications/Oolite-trunk/release.txt
GNUstep/Applications/Oolite/release.txt
And their content is like

Code: Select all

1.90.0.7282-200829-0b1ff49
What would be the equivalent on Windows? I suppose there is nothing in the registry, but is there also no such file on disk?
How difficult could it be to have a --version command line parameter?
Sunshine - Moonlight - Good Times - Oolite
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Identify installed version

Post by another_commander »

hiran wrote: Mon Nov 06, 2023 10:47 am
In Linux, after installation I find files like these

Code: Select all

GNUstep/Applications/Oolite-trunk/release.txt
GNUstep/Applications/Oolite/release.txt
And their content is like

Code: Select all

1.90.0.7282-200829-0b1ff49
What would be the equivalent on Windows? I suppose there is nothing in the registry, but is there also no such file on disk?
How difficult could it be to have a --version command line parameter?
In Windows we have the registry entry HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Oolite
with the subkey DisplayName (REG_SZ) and example content Oolite 1.91.0.7499-230913-4549f87-dev, which includes the entire version string.

The problem with that is that it gets written in the registry only if the installer is run as admin.
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Identify installed version

Post by hiran »

another_commander wrote: Mon Nov 06, 2023 11:12 am
In Windows we have the registry entry HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Oolite
with the subkey DisplayName (REG_SZ) and example content Oolite 1.91.0.7499-230913-4549f87-dev, which includes the entire version string.

The problem with that is that it gets written in the registry only if the installer is run as admin.
That is pretty close. The '-dev' part in the end is new to me but would not be a problem.
More problematic is the fact that it is not always there.

Could we change the installer so it writes the version into a file, just like on Linux?
The change does not look complicated, but I would only do it if I can also test the installer.
https://nsis.sourceforge.io/Write_text_to_a_file
Sunshine - Moonlight - Good Times - Oolite
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Identify installed version

Post by hiran »

In the latest build run I changed the Windows installation.
Could someone with a Windows machine check if the intended file 'release.txt' is created in the installation folder?

https://github.com/OoliteProject/oolite ... 6776156032
This is neither a release nor a prerelease so you have to access the workflow run asset.
Sunshine - Moonlight - Good Times - Oolite
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Identify installed version

Post by another_commander »

hiran wrote: Tue Nov 07, 2023 6:56 am
In the latest build run I changed the Windows installation.
Could someone with a Windows machine check if the intended file 'release.txt' is created in the installation folder?

https://github.com/OoliteProject/oolite ... 6776156032
This is neither a release nor a prerelease so you have to access the workflow run asset.
Yes, it works and the file containing the release string is there at the installation root. Just a minor problem - it does not get deleted when uninstalling. That's very easy to fix though, just add a deletion command somewhere around lines 309-314 where the uninstaller deletes the other root folder files

Code: Select all

RMDir /r "$INSTDIR\oolite.app\oolite.app"
RMDir /r "$INSTDIR\oolite.app\Resources"
RMDir /r "$INSTDIR\oolite.app\Logs"
Delete "$INSTDIR\release.txt"			<--------- add this somewhere here
Delete "$INSTDIR\Oolite.ico"
Delete "$INSTDIR\Oolite-HDR.ico"
Delete "$INSTDIR\Oolite_Readme.txt"
Delete "$INSTDIR\OoliteRS.pdf"
Delete "$INSTDIR\AdviceForNewCommanders.pdf"
Delete "$INSTDIR\OoliteReadMe.pdf"
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Identify installed version

Post by hiran »

another_commander wrote: Tue Nov 07, 2023 7:13 am
hiran wrote: Tue Nov 07, 2023 6:56 am
In the latest build run I changed the Windows installation.
Could someone with a Windows machine check if the intended file 'release.txt' is created in the installation folder?

https://github.com/OoliteProject/oolite ... 6776156032
This is neither a release nor a prerelease so you have to access the workflow run asset.
Yes, it works and the file containing the release string is there at the installation root. Just a minor problem - it does not get deleted when uninstalling.
Thank you for the feedback. I added the uninstall instruction. Once the build has finished, please check the windows installer at
https://github.com/OoliteProject/oolite ... 6790152101

If it is good, I'll do a PR.
Sunshine - Moonlight - Good Times - Oolite
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Identify installed version

Post by another_commander »

Tested it. It works as expected.
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Identify installed version

Post by hiran »

another_commander wrote: Wed Nov 08, 2023 6:53 am
Tested it. It works as expected.
Thank you.
I merged the changes. 🙂
Sunshine - Moonlight - Good Times - Oolite
Post Reply