Page 1 of 1

Issues with Latest Build

Posted: Mon Jan 30, 2017 5:06 pm
by labgnome
I've been playing with the test builds lately. I have a windows 8 system on a Toshiba laptop. Build 2017-01-23.d3d9204 has issues with the uninstaller running after the game is installed uninstalling the new game. I've tried modding and had to re-install a few times and noticed this issue. Last night the game crashed my laptop.

Re: Issues with Late4st Build

Posted: Mon Jan 30, 2017 5:13 pm
by Geoff the Medio
labgnome wrote:Last night the game crashed my laptop.
This is useless without details of when it happens/happened, steps to reproduce, or saves, log files, etc.

Re: Issues with Latest Build

Posted: Mon Jan 30, 2017 6:17 pm
by labgnome
Here is what I can manage here. It keeps telling me everything else is too big.

Re: Issues with Latest Build

Posted: Mon Jan 30, 2017 6:37 pm
by Geoff the Medio
config.xml alone is not helpful. Try zipping the logs, or posting them at pastebin or a similar site. Or link to a dropbox document. Or cut out part of the log (the start probably) so just the end is left. Or describe in a post what you did to get a crash.

Re: Issues with Latest Build

Posted: Mon Jan 30, 2017 6:43 pm
by dbenage-cx
issues with the uninstaller running after the game is installed
Please clarify this, it almost sounds like the uninstaller starts up and completes on its own.
If that is not the case, knowing the issues you have with the windows installer/uninstaller would be very helpful.

Re: Issues with Latest Build

Posted: Mon Jan 30, 2017 7:11 pm
by labgnome
dbenage-cx wrote:
issues with the uninstaller running after the game is installed
Please clarify this, it almost sounds like the uninstaller starts up and completes on its own.
If that is not the case, knowing the issues you have with the windows installer/uninstaller would be very helpful.
I'll try to give more details. Full disclosure: this is also an "I should have payed closer attention" kind of thing.

Here is the sequence of events:
  1. I try to install the file
  2. It recommends I uninstall previous versions & I click "yes"
  3. The uninstall program begins
  4. The installation program window pops up & I start installation
  5. Installation completes.
  6. Uninstall completes, uninstalling the new build I had just tried to install.
I hadn't noticed this kind of issue before so I wanted to say something in case it's the result of something new. This even happened one time while I had the game up and running, and I thought I had correctly waited for the uninstall to complete. When my computer crashed last night I decided I should probably say something.

Re: Issues with Latest Build

Posted: Tue Jan 31, 2017 12:41 pm
by Vezzra
labgnome wrote:Here is the sequence of events:
  1. I try to install the file
  2. It recommends I uninstall previous versions & I click "yes"
  3. The uninstall program begins
  4. The installation program window pops up & I start installation
  5. Installation completes.
  6. Uninstall completes, uninstalling the new build I had just tried to install.
Um, you must not start the installation (step 4) before the uninstall process has completed. Otherwise you might end up with a botched installation. So, when installing a new version: start the installer; when it detects an old version and asks if you want to uninstall that old version click "Yes", then wait until the uninstall process has completed. Only then continue with the installation of the new version.
This even happened one time while I had the game up and running
I don't understand, what happened while you had a game up and running? I assume you didn't try to do an install/uninstall with the game up and running, did you...?

Re: Issues with Latest Build

Posted: Tue Jan 31, 2017 3:21 pm
by labgnome
Vezzra wrote:Um, you must not start the installation (step 4) before the uninstall process has completed. Otherwise you might end up with a botched installation. So, when installing a new version: start the installer; when it detects an old version and asks if you want to uninstall that old version click "Yes", then wait until the uninstall process has completed. Only then continue with the installation of the new version.
I've just never had it prompt me/pop-up to install the new version before the uninstall was complete before. It wasn't something I had to look out for until now. So I thought the issues might be connected.
Vezzra wrote:
This even happened one time while I had the game up and running
I don't understand, what happened while you had a game up and running? I assume you didn't try to do an install/uninstall with the game up and running, did you...?
uninstalling the game. The uninstall completed while the game was running.

Re: Issues with Latest Build

Posted: Wed Feb 08, 2017 3:53 pm
by Vezzra
labgnome wrote:The uninstall completed while the game was running.
Oh... ok, that means, you started the install, then confirmed the message box that asked if you wanted to uninstall the previous version, continued with the installation, which completed, then started a game, and the uninstall completed only after you had already been playing for a while...?

Re: Issues with Latest Build

Posted: Wed Feb 08, 2017 5:02 pm
by adrian_broher
It is certainly not optimal to run both branches (uninstaller + installer) at the same time. We should prevent this by blocking the installer until the uninstaller is finished.

http://nsis.sourceforge.net/When_I_use_ ... ninstaller

Should help here.

Re: Issues with Latest Build

Posted: Wed Feb 08, 2017 5:31 pm
by Vezzra
Yep, definitely agree.

Re: Issues with Latest Build

Posted: Wed Feb 08, 2017 8:37 pm
by dbenage-cx
Thanks to https://nsis-dev.github.io/NSIS-Forums/ ... 79035.html this works:

Code: Select all

uninst_onInit:
ClearErrors
InitPluginsDir
CopyFiles "$R0" "$pluginsdir"
ExecWait '$pluginsdir\Uninstall.exe _?=$pluginsdir'
fin_onInit:
Anyone know a way to separate the filename from a registry string($R0) in this context?
Using the filename from registry would help in case of later changes (e.g. using a batch file)

Re: Issues with Latest Build

Posted: Thu Feb 09, 2017 12:03 pm
by Vezzra
dbenage-cx wrote:

Code: Select all

uninst_onInit:
ClearErrors
InitPluginsDir
CopyFiles "$R0" "$pluginsdir"
ExecWait '$pluginsdir\Uninstall.exe _?=$pluginsdir'
fin_onInit:
That does not work at all... when I change the NSIS installer script as suggested here, the installer indeed paused until the uninstaller completes, however, apparently other than removing the uninstaller registry key the uninstaller doesn't do anything, it exits practically immediately, and the FO installation remains apparently untouched.

The solution suggestion Marcel linked to works far better, but still not entirely satisfactorily. The old FO installation is almost completely removed - the FreeOrion folder itself in the Windows programs directory and the uninstall.exe within don't get deleted. Which shouldn't be a big issue since usually the new installation should overwrite these leftovers immediately afterwards, but still, it's not perfect (e.g. when a user decides put the new installation into a different location).

So I put up a PR with a fix that more or less follows that solution with request for reviews/opinions/objections:

https://github.com/freeorion/freeorion/pull/1299

Re: Issues with Latest Build

Posted: Thu Feb 09, 2017 12:22 pm
by dbenage-cx
Doh :/
"_?=" Is an argument to the uninstaller and should be the installation directory, not $pluginsdir.

The issue with this approach is separating the filename from the directory name, as the previous versions stored the one value.

Re: Issues with Latest Build

Posted: Thu Feb 09, 2017 4:53 pm
by Vezzra
dbenage-cx wrote:The issue with this approach is separating the filename from the directory name, as the previous versions stored the one value.
As the filename of the uninstaller executable hasn't been changed since the dawn of time, I consider this issue a very minor one. Certainly less serious than the problem with the installer continuing before the uninstaller completes.

So I updated my PR with the approach you suggested here, rebased and merged it. Once someone comes up with a proper solution for separating filename from directory name, we can commit that fix then.

@labgnome, things should work smoothly for you now. :)