-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
install: Enhance windows installer - detect running gridcoinresearch(d).exe and ask to close before continuing #2672
Conversation
We are willingly diverging from Bitcoin here. I think this needs some extra scrutiny... |
Scrutinize away. This PR is trivial and essentially just detects whether an instance of Gridcoin is running and prompts the user to shut it down before continuing. While we follow Bitcoin Core on many things, it doesn't mean that we are bound to stupid decisions that they make. Their installer should be doing this too. |
Approach NACK, we should not be adding binary blobs even if only to the installer. |
Then we need to ensure the module is installed on the build machines for the Windows build as an alternative approach. That will work just fine. Nsprocess is a very commonly used module for this purpose and is usually available as part of the NSIS install set, although it may be in a separate package. It is on OpenSUSE. I will check on our Ubuntu OS versions we use for the build environment. |
Eh, that can do. Alternatively, https://nsis.sourceforge.io/Check_whether_your_application_is_running also lists a way to do it without plugins by using |
That was the very page I referenced to do this quick PR. The thing I dislike about that method is the external exec call to the tasklist. If we think that is preferable it wouldn't be too hard to use that instead. We don't support anything less than Windows 7, so it should be available for every Windows version we support. |
Actually, the ExecCmd plugin has been superseded by the ExecDos plugin. I have to check whether this plugin is provided in the default NSIS packages. |
The ExecDos plugin is not installed by the base NSIS package on Ubuntu. So that makes that approach equivalent in the packaging problem to my original approach. |
Wouldn't the |
That will cause a command window to flash I think, which is definitely "hacky" and will raise questions. |
I am going to try ExecWait, but if it repeatedly flashes command windows, I am not going to use that. |
BTW this is a typical example of a BS change that is taking up an enormous amount of time. I may just close it. :|. |
Hmm. I have fiddled around for several hours and cannot get ExecWait to work reliably. This in a windows cmd does...
and then
putting a purposefully non-matching exe name in the find part returns nothing and the %errorlevel% is then 1. This part of the NSIS script should work then...
But it doesn't. The ExecWaits appear to be doing nothing. |
The source code for the nsProcess plugin is difficult to find. OpenSUSE has it for their OBS mingw packages, and I got it from there and can compile, but reliably downloading from source in a depends package for example is going to be difficult. |
…Windows This commit introduces the use of ExecWait in combination with tasklist and find to detect a running Gridcoin wallet, either GUI or daemon, and prompt to shut it down before installation proceeds.
a45a2cd
to
888e23f
Compare
Ok. I got it to work after fiddling around with ExecWait for hours with magic incantations on the quoting... :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK, seems to not work under Wine as tasklist is a stub but works on Windows.
Yeah. That doesn't surprise me and I think we can ignore that corner case. Running a wallet under WINE on Linux works of course but is more of a stunt or purely for testing of a Windows binary on a Linux machine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post merge TACK
Added - install: Enhance windows installer - detect running gridcoinresearch(d).exe and ask to close before continuing gridcoin-community#2672 (@jamescowens) - gui: Add one minute QTimer to update beacon age/expiration in tooltip gridcoin-community#2671 (@jamescowens) Changed none Removed none Fixed - util: Implement workaround for backupwallet to deal with Boost 1.74 regression on copy_file gridcoin-community#2669 (@jamescowens) - banman: use GetPerformanceCounter instead of GetRandBytes gridcoin-community#2668 (@div72)
Detect and prompt for shutdown of Gridcoin wallet during install for Windows
This commit introduces the use of ExecWait in combination with tasklist and find to detect a running Gridcoin wallet, either GUI or daemon, and prompt to shut it down before installation proceeds.
This method does not require the use of NSIS plugins, but has the disadvantage that two command windows momentarily appear during the check (one for gridcoinresearch.exe and the other for gridcoinresearchd.exe).
Closes #2662.