Expansion packs download failed..

For test results, bug reports, announcements of new builds etc.

Moderators: another_commander, winston, Getafix

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6554
Joined: Wed Feb 28, 2007 7:54 am

Re: Expansion packs download failed..

Post by another_commander »

hiran wrote: Wed Oct 11, 2023 8:10 am
I was more thinking of a registry entry. Or whatever the 'installed apps' list in Windows is.
The installer creates the key "Install_Dir" with the string value of the installation folder under HKLM\Software\Oolite. You can try searching for that.
User avatar
hiran
Theorethicist
Posts: 2060
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Expansion packs download failed..

Post by hiran »

another_commander wrote: Wed Oct 11, 2023 8:37 am
hiran wrote: Wed Oct 11, 2023 8:10 am
I was more thinking of a registry entry. Or whatever the 'installed apps' list in Windows is.
The installer creates the key "Install_Dir" with the string value of the installation folder under HKLM\Software\Oolite. You can try searching for that.
Now we're talking! :-)

As I dont't have Windows to verify,, could you confirm this command prints the desired path to stdout?

Code: Select all

reg query HKLM\Software\Oolite /v Install_Dir
Sunshine - Moonlight - Good Times - Oolite
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6554
Joined: Wed Feb 28, 2007 7:54 am

Re: Expansion packs download failed..

Post by another_commander »

hiran wrote: Wed Oct 11, 2023 9:08 am
Now we're talking! :-)

As I dont't have Windows to verify,, could you confirm this command prints the desired path to stdout?

Code: Select all

reg query HKLM\Software\Oolite /v Install_Dir
Unfortunately the PC I am on right now is restricted and I can't check (registry access is off-limits due to policy). Will do at first opportunity, but I don't know when that will be - it may take a while.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6554
Joined: Wed Feb 28, 2007 7:54 am

Re: Expansion packs download failed..

Post by another_commander »

I did the test and it was interesting to say the least. Here are the observations, followed by my conclusion.
  • The registry query command yields no results. Apparently, the HKLM\Software\Oolite key is not present.
  • After some further investigation, it turns out that, for some reason - maybe related to the fact that the Windows installer is a 32-bit app - the key we are looking for will be located under HKLM\SOFTWARE\WOW6432Node\Oolite.
  • Following a normal install of the game, the key is still NOT created. The only way to get the installer to successfully write it to the registry is to run it as administrator. This actually makes sense from a security point of view, as you don't want installers to be noodling around with the registry whenever they feel like it. The interesting part is that the uninstaller still works fine and uninstalls using the correct path to the game, even without the registry keys being there.
  • After you have run the installer as administrator, the key is at the location mentioned earlier and the reg query command yields the game's installation path as expected.
  • All the above is on Windows 10 and 11. I do not know what exactly happens with Windows 7 (which we theoretically still support). The registry keys may be different there.
Conclusion: Reading the registry key HKLM\SOFTWARE\WOW6432Node\Oolite can yield the install folder only if the installer has been run as administrator. Most users do not do that, they just execute it normally. So, under normal circumstances, I would not expect the install path to be in the registry. I have a way of making the installer request administrator privileges on startup, but I would really like to avoid that, mainly for security reasons (installers requesting admin rights normally trigger antivirus heuristics a lot and are generally not trusted by users, especially if they are not signed).
User avatar
hiran
Theorethicist
Posts: 2060
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Expansion packs download failed..

Post by hiran »

another_commander wrote: Wed Oct 11, 2023 5:41 pm
I did the test and it was interesting to say the least. Here are the observations, followed by my conclusion.
  • The registry query command yields no results. Apparently, the HKLM\Software\Oolite key is not present.
  • After some further investigation, it turns out that, for some reason - maybe related to the fact that the Windows installer is a 32-bit app - the key we are looking for will be located under HKLM\SOFTWARE\WOW6432Node\Oolite.
  • Following a normal install of the game, the key is still NOT created. The only way to get the installer to successfully write it to the registry is to run it as administrator. This actually makes sense from a security point of view, as you don't want installers to be noodling around with the registry whenever they feel like it. The interesting part is that the uninstaller still works fine and uninstalls using the correct path to the game, even without the registry keys being there.
  • After you have run the installer as administrator, the key is at the location mentioned earlier and the reg query command yields the game's installation path as expected.
  • All the above is on Windows 10 and 11. I do not know what exactly happens with Windows 7 (which we theoretically still support). The registry keys may be different there.
Conclusion: Reading the registry key HKLM\SOFTWARE\WOW6432Node\Oolite can yield the install folder only if the installer has been run as administrator. Most users do not do that, they just execute it normally. So, under normal circumstances, I would not expect the install path to be in the registry. I have a way of making the installer request administrator privileges on startup, but I would really like to avoid that, mainly for security reasons (installers requesting admin rights normally trigger antivirus heuristics a lot and are generally not trusted by users, especially if they are not signed).
That is interesting indeed. How does the uninstaller correctly locate the installation? Or, if the uninstaller easily finds it in it's own install path - how does Windows know where to look for the uninstaller?

And please let me have a concise command that I can invoke. Now I need to guess which line to execute:

Code: Select all

reg query HKLM\Software\Oolite /v Install_Dir
reg query HKLM\SOFTWARE\WOW6432Node\Oolite /v Install_Dir
reg query HKLM\SOFTWARE\WOW6432Node\Oolite
Also I have no clue about process exit codes and what output to expect on stdout/stderr so I can start parsing.
Sunshine - Moonlight - Good Times - Oolite
User avatar
hiran
Theorethicist
Posts: 2060
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Expansion packs download failed..

Post by hiran »

hiran wrote: Tue Oct 10, 2023 12:52 pm
ihaveamo wrote: Tue Oct 10, 2023 10:01 am
Interestingly, the file browse windows for the "activate" and "import" work beautifully and instantly, just not the "browse" buttons when filling out the oolite paths for different oolite instances.
That might be a good hint. I will try something...
I have changed something in OoliteStarter v0.1.21-elul.7.
Would you like to check if the file browse function is faster now?
Sunshine - Moonlight - Good Times - Oolite
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4653
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Expansion packs download failed..

Post by phkb »

hiran wrote: Wed Oct 11, 2023 5:52 pm
And please let me have a concise command that I can invoke. Now I need to guess which line to execute:
It may be prudent to invest in a Windows VM of some sort. I've used VirtualBox with a Windows VM quite successfully. It would at least allow you to debug the installer on Windows and see the results directly.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6554
Joined: Wed Feb 28, 2007 7:54 am

Re: Expansion packs download failed..

Post by another_commander »

hiran wrote: Wed Oct 11, 2023 5:52 pm

That is interesting indeed. How does the uninstaller correctly locate the installation? Or, if the uninstaller easily finds it in it's own install path - how does Windows know where to look for the uninstaller?
My guess is that the uninstaller (filename UninstOolite.exe) simply runs from the folder it's in if no specific paths are given and that folder happens to be the game's base install one so it just works. A shortcut to the uninstaller is also placed in the Start menu entry for the game and this is how it is normally executed so Windows has no issue finding it.

And please let me have a concise command that I can invoke. Now I need to guess which line to execute:

Code: Select all

reg query HKLM\Software\Oolite /v Install_Dir
reg query HKLM\SOFTWARE\WOW6432Node\Oolite /v Install_Dir
reg query HKLM\SOFTWARE\WOW6432Node\Oolite
Also I have no clue about process exit codes and what output to expect on stdout/stderr so I can start parsing.
I will do that in a few hours, once I am back at a PC with registry access. I still think that this way of locating the game's installation is not very reliable though, simply because I don't expect most users to have the required keys written to the registry. It's maybe ok as a backup method, but as a primary one, I am not sure...
User avatar
hiran
Theorethicist
Posts: 2060
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Expansion packs download failed..

Post by hiran »

phkb wrote: Wed Oct 11, 2023 9:35 pm
hiran wrote: Wed Oct 11, 2023 5:52 pm
And please let me have a concise command that I can invoke. Now I need to guess which line to execute:
It may be prudent to invest in a Windows VM of some sort. I've used VirtualBox with a Windows VM quite successfully. It would at least allow you to debug the installer on Windows and see the results directly.
Been there, done that.
https://bb.oolite.space/viewtopic.php?p=289848#p289848

But for whatever reasons Virtualbox has stopped working for me. Not only on the Windows VM but completely, and all attempts I took so far did not restore it.

I believe the system needs to be reinstalled - something I am more scared of than having no virtualization.
Sunshine - Moonlight - Good Times - Oolite
User avatar
hiran
Theorethicist
Posts: 2060
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Expansion packs download failed..

Post by hiran »

another_commander wrote: Thu Oct 12, 2023 5:19 am
hiran wrote: Wed Oct 11, 2023 5:52 pm

That is interesting indeed. How does the uninstaller correctly locate the installation? Or, if the uninstaller easily finds it in it's own install path - how does Windows know where to look for the uninstaller?
My guess is that the uninstaller (filename UninstOolite.exe) simply runs from the folder it's in if no specific paths are given and that folder happens to be the game's base install one so it just works. A shortcut to the uninstaller is also placed in the Start menu entry for the game and this is how it is normally executed so Windows has no issue finding it.
That would be a reasonable pattern. But I remember uninstalling Oolite through Windows Control panel (if that is still the correct name).
Given that we have a menu entry pointing to the uninstaller, how can Windows know/find the uninstaller? Somewhere the installer must have registered something.
another_commander wrote: Thu Oct 12, 2023 5:19 am
I will do that in a few hours, once I am back at a PC with registry access. I still think that this way of locating the game's installation is not very reliable though, simply because I don't expect most users to have the required keys written to the registry. It's maybe ok as a backup method, but as a primary one, I am not sure...
No worries, OoliteStarter will still scan the full disk. But I can bias it with locations to check first - and these values may come from the registry as well.
Sunshine - Moonlight - Good Times - Oolite
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6554
Joined: Wed Feb 28, 2007 7:54 am

Re: Expansion packs download failed..

Post by another_commander »

OK, here are some more results.

The reg command variants that are of interest to us are these two:

Code: Select all

reg query HKLM\SOFTWARE\WOW6432Node\Oolite
reg query HKLM\SOFTWARE\WOW6432Node\Oolite /v Install_Dir
The first lists all the subkeys under HKLM\SOFTWARE\WOW6432Node\Oolite, the second shows only the one we specify after /v. In this particular case, the output is the same for both because we only have one subkey.

The game has been installed in the path C:\OoliteTest01.

If the game is installed without admin rights, both above commands yield this output to stdout:

Code: Select all

C:\ooinst>reg query HKLM\SOFTWARE\WOW6432Node\Oolite
ERROR: The system was unable to find the specified registry key or value.

C:\ooinst>reg query HKLM\SOFTWARE\WOW6432Node\Oolite /v Install_Dir
ERROR: The system was unable to find the specified registry key or value.
If the game is installed by running the installer as administrator, the same commands ooutput to stdout this:

Code: Select all

C:\ooinst>reg query HKLM\SOFTWARE\WOW6432Node\Oolite

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Oolite
    Install_Dir    REG_SZ    C:\OoliteTest01


C:\ooinst>reg query HKLM\SOFTWARE\WOW6432Node\Oolite /v Install_Dir

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Oolite
    Install_Dir    REG_SZ    C:\OoliteTest01
I don't see any output going to stderr in any of those cases. As for return values, reg's /? command line switch gives us this:

Code: Select all

Return Code: (Except for REG COMPARE)

  0 - Successful
  1 - Failed


Finally, for completeness sake, I should mention that there are also two more registry keys generated by the installer (again, only if run as administrator). Their location is HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Oolite. The reg query command tells us this about them (note that the install folder has been changed to C:\Oolite0001 here):

Code: Select all

C:\ooinst>reg query HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Oolite

HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Oolite
    DisplayName    REG_SZ    Oolite 1.91.0.7499-230913-4549f87-dev
    UninstallString    REG_SZ    "C:\Oolite0001\UninstOolite.exe"
Of those two, the first one is there only for information purposes and the second one is used for automatically checking whether there is a previous version of the game in the install path, in which case the installer offers to remove it automatically before proceeding to install the new one.
User avatar
hiran
Theorethicist
Posts: 2060
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Expansion packs download failed..

Post by hiran »

another_commander wrote: Thu Oct 12, 2023 4:25 pm
OK, here are some more results.
Thank you. That investigation is really complete.

A first attempt to use this is in OoliteStarter v0.1.21-elul.8.
I'm happy if someone could test this on Windows and let me know
- if scanning for Oolite works
- let me have the logfile
Sunshine - Moonlight - Good Times - Oolite
ihaveamo
Above Average
Above Average
Posts: 28
Joined: Mon Feb 01, 2016 10:56 am

Re: Expansion packs download failed..

Post by ihaveamo »

A first attempt to use this is in OoliteStarter v0.1.21-elul.8.
I'm happy if someone could test this on Windows and let me know
- if scanning for Oolite works
- let me have the logfile
Unfortunately, scanning didn't work for me.

"Select OOlite Home Directory" window, with
"So you don't know where you installed Oolite? No worries, I can help you find it?

Then an "installations" sub-window that is blank

I do want to add though - the manual add , then "Browse" buttons now work really well (They were freezing before) - and everything auto-populates properly, including the version number now. Well done :)
User avatar
hiran
Theorethicist
Posts: 2060
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Expansion packs download failed..

Post by hiran »

ihaveamo wrote: Tue Oct 24, 2023 9:17 am
Unfortunately, scanning didn't work for me.

"Select OOlite Home Directory" window, with
"So you don't know where you installed Oolite? No worries, I can help you find it?

Then an "installations" sub-window that is blank
Hmmm. Could you provide a logfile? I added a bias where to look first but that seems not to work.
ihaveamo wrote: Tue Oct 24, 2023 9:17 am
I do want to add though - the manual add , then "Browse" buttons now work really well (They were freezing before) - and everything auto-populates properly, including the version number now. Well done :)
Thank you for the feedback. :-)
Sunshine - Moonlight - Good Times - Oolite
ihaveamo
Above Average
Above Average
Posts: 28
Joined: Mon Feb 01, 2016 10:56 am

Re: Expansion packs download failed..

Post by ihaveamo »

Hmmm. Could you provide a logfile? I added a bias where to look first but that seems not to work.
Sure - Does your app have a logfile? What files would you like?
Post Reply