Page 1 of 1

Identify installed version

Posted: Fri Jul 07, 2023 10:29 pm
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.

Re: Identify installed version

Posted: Sat Jul 08, 2023 4:07 am
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/";
}

Re: Identify installed version

Posted: Sat Jul 08, 2023 5:36 am
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. :-)

Re: Identify installed version

Posted: Tue Jul 11, 2023 9:11 pm
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.

Re: Identify installed version

Posted: Tue Jul 11, 2023 9:15 pm
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...

Re: Identify installed version

Posted: Mon Nov 06, 2023 10:47 am
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?

Re: Identify installed version

Posted: Mon Nov 06, 2023 11:12 am
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.

Re: Identify installed version

Posted: Mon Nov 06, 2023 11:32 am
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

Re: Identify installed version

Posted: Tue Nov 07, 2023 6:56 am
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.

Re: Identify installed version

Posted: Tue Nov 07, 2023 7:13 am
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"

Re: Identify installed version

Posted: Tue Nov 07, 2023 8:52 pm
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.

Re: Identify installed version

Posted: Wed Nov 08, 2023 6:53 am
by another_commander
Tested it. It works as expected.

Re: Identify installed version

Posted: Wed Nov 08, 2023 10:40 am
by hiran
another_commander wrote: Wed Nov 08, 2023 6:53 am
Tested it. It works as expected.
Thank you.
I merged the changes. 🙂