Skip to content
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

PICARD-2186: Fix detection of running app in Windows (un)installer #2275

Conversation

phw
Copy link
Member

@phw phw commented Aug 14, 2023

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

The Windows installer attempts to detect the Picard Window to stop installation / uninstallation while Picard is running. This detection was broken since Qt at some point changed from a static window class name of "Qt5QWindowIcon" to a version specific one like "Qt512QWindowIcon".

Solution

The Qt window class name changed from a generic one to a version specific one. Use a function to search for partial matches.

Compare:

https://nsis.sourceforge.io/Enhanced_FindWindow_for_variable_window_title_names

https://nsis.sourceforge.io/Check_whether_your_application_is_running#Using_a_window_class_or_title

The Qt window class name changed from a generic one to a version specific
one. Use a function to search for partial matches.
@phw phw requested review from zas and rdswift August 14, 2023 06:51
@phw phw added the Bug fix label Aug 14, 2023
Copy link
Collaborator

@rdswift rdswift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an expert with NSIS installer because I use InnoScript for all my Windows application installations, but from my limited understanding this looks good to me.

@phw
Copy link
Member Author

phw commented Aug 14, 2023

Thanks for checking. I tested it on two systems and it worked. This method is not 100% fool proof, but when it was still working (in older Picard versions of the 1.x era) it was doing its job :)

@phw phw merged commit 9d72ffb into metabrainz:master Aug 14, 2023
52 checks passed
@phw phw deleted the PICARD-2186-fix-windows-installer-instance-detection branch August 14, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants