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

Windows: Resolves #11508: Allow installer to skip uninstallation step after repeated failures #11612

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Jan 9, 2025

Summary

Prior attempts at fixing #11508 have been unsuccessful.

On the forum, users have reported two workarounds:

  1. Uninstalling Joplin, then upgrading.
  2. Deleting the registry key that stores the Joplin uninstaller location.

The second workaround should be equivalent to not uninstalling the old version of Joplin when upgrading. Note: This workaround seems to leave old files application from the previous version of Joplin that may not be needed/expected by the new Joplin version.

This pull request:

  1. allows the user to run the second workaround if uninstallation repeatedly fails,
  2. applies an upstream commit that might fix the issue when future versions of Joplin run an uninstaller created by this version.

May fix #11508.

Screen recording

Screencast.from.2025-01-09.07-59-01.webm

Note: The "System Error" dialogs are an artifact of the testing setup, caused by the intentionally-broken installer. They would not appear in production. See the "Testing plan" section for details.

Show original screen recording (also demonstrates the testing setup)
JoplinUninstallerFix.webm

Testing plan

  1. Build the app using yarn run dist from packages/app-desktop.
  2. Run the just-built installer.
  3. Allow the install to complete. Choose to install Joplin for the current user. On the last screen, don't choose to run Joplin.
    • Verify that the installation completes successfully.
  4. Locate the uninstaller.
    • For me, it was in C:\Users\MyUsernameHere\AppData\Local\Programs\Joplin\.
    • This can also be found from the UninstallString key-value pair in the Windows registry, under Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\ followed by a long ID.
  5. Simulating a broken uninstaller: Rename Uninstall Joplin.exe to Uninstall Joplin.old.exe, then make a copy of Joplin.exe and rename it to Uninstall Joplin.exe.
  6. Run the installer built in step 1.
  7. Observe that a "System Error" dialog that states that ffmpeg.dll can't be found. This is expected because the NSIS installer is running Uninstall Joplin.exe from a temporary directory (not the original directory, which has ffmpeg.dll).
  8. Click "OK".
  9. Repeat step 8 until a different dialog is shown.
    • It may be necessary to repeat step 8 several times as the installer retries running the uninstaller.
  10. In the "The old version of Joplin could not be removed. Click Retry to skip this step" dialog, click "Retry".
  11. Allow the installation to complete.
  12. Verify that Joplin can be launched.
  13. Verify that running the installer again doesn't show the "System Error" or "Could not be removed" dialogs.

…th the

installation process if uninstall fails

Continuing with the installation without uninstalling should be
equivalent to the registry key removal workaround described on the
forum. However, it's possible that skipping the uninstall step will
cause issues. As a result, this change still runs the uninstaller
(and makes continuing anyway an option).
@personalizedrefrigerator personalizedrefrigerator changed the base branch from dev to release-3.2 January 9, 2025 09:27
Comment on lines 65 to 66
- MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "$(appCannotBeClosed)" /SD IDCANCEL IDRETRY OneMoreAttempt
+ MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "$(appCannotBeUninstalled)" /SD IDCANCEL IDRETRY OneMoreAttempt
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If simple, adjust this so that Retry skips the uninstall check and Cancel calls Abort.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has been updated (see the screen recording in the pull request description):
screenshot: The old version of Joplin could not be removed. Click retry to skip this step.

@laurent22 laurent22 merged commit 950ffef into laurent22:release-3.2 Jan 9, 2025
7 checks passed
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.

Cannot install Joplin 3.2 on Windows
2 participants