Code Monkey home page Code Monkey logo

Comments (5)

simonster avatar simonster commented on July 21, 2024

Do you know of any place where Zotero is making use of keys under HKLM\Software\Zotero\Zotero Standalone\<version string>\ or HKLM\Software\Zotero\Zotero Standalone <version string>\bin? I'm reworking the uninstaller so that it no longer needs to read the values of these keys. If they are no longer being used I'll update the installer to stop writing them.

It's been a long time since I looked at this part of the installer code, but as long as these entries aren't necessary for associating files with Zotero, it's fine to remove them. We don't use them anywhere within Zotero itself.

I don't think there's any need to check for and process duplicate entries, but support for that could be added. An example of how this might happen is if someone installs Zotero globally into a publicly writable path such as c:\Zotero. If they run the installer a second time without elevation, and choose the same path two add/remove program entries will exist. Another example of multiple add/remove program entries occurring is where someone installs several versions of Zotero all to the same path, and the installer doesn't clean up entries for previous versions.

So what happens if we don't add explicit support for this? If each uninstaller just uninstalls one of copy of Zotero without asking which copy to uninstall, I think that's fine. If this case breaks the uninstaller, it might be more problematic.

from zotero-standalone-build.

mikesteele81 avatar mikesteele81 commented on July 21, 2024

So what happens if we don't add explicit support for this? If each uninstaller just uninstalls one of copy of Zotero without asking which copy to uninstall, I think that's fine. If this case breaks the uninstaller, it might be more problematic.

Ideally each add/remove programs entry's InstallLocation value should be unique. In this case finding and removing the first matching entry will be enough. I'm using helper.exe's working directory to find which entry needs to be removed. In the case where duplicate entries are left over, users will be able to remove them manually. They will see the following message:

Untitled

This will only cause problems if Zotero is installed once with elevation, and then a second time without elevation to the same path. In that case the uninstaller will fail to do per-user cleanups. The current version of Zotero's uninstaller attempts to remove all registry and file references for both the system and current user, which is why elevation is always required.

The advantage of using registry keys to keep track of the install location is that the uninstaller may be run from any folder. With my change the uninstaller needs to be run from within the installation directory tree. Users will be able to uninstall Zotero by executing helper.exe manually or by using the add/remove programs listing, but if they run helper.exe in such a way that it's working directory is different the uninstaller will simply abort.

from zotero-standalone-build.

mikesteele81 avatar mikesteele81 commented on July 21, 2024

These keys aren't used in supporting file associations. The uninstaller reads them to determine if Zotero has multiple instances installed to different directories.

from zotero-standalone-build.

mikesteele81 avatar mikesteele81 commented on July 21, 2024

This is just an update. I have a branch for this issue ready. In the near future I will become unavailable for a few weeks, so I'm holding off on making a pull request.

The other pull requests I've made recently were all in support of this one. None of them should have changed user-visible behavior.

This branch does change the uninstaller's behavior in a way that users may notice:

  • On Windows 7, removing Zotero from the Programs and Features listing will never trigger a UAC prompt regardless of whether it was installed globally or just for the user. Previously a UAC prompt would be triggered in all cases.
  • The way in which the Programs and Features listing gets updated has changed.
    • Zotero's uninstaller used to use registry entries to keep track of multiple valid instances. It would determine which instance to remove based on the location of the uninstaller executable. If multiple installations existed, various shortcuts and registry keys would be updated to one of the other instances. The uninstaller would search for registry keys and shortcuts to delete wherever it could find them.
    • With this branch the uninstaller assumes that Zotero may be installed on a global bases at most once, or installed within the user's profile at most once. It determines which type of installation was made by scanning both the global and user's programs listing. Elevation will be requested when the global programs listing contains an entry with a path matching the uninstaller's working directory. If the installation was determined to be global, registry keys under HKLM and shortcuts in public locations will be deleted. If the installation was determined to be per-user, registry keys under HKCU and shortcuts in the user's profile will be deleted.
  • A few keys under HKCU are deleted regardless of whether the installation is found to be global or per-user. This is done based on the status of a check box in the uninstallation wizard. Only the profile of the user running the uninstaller is modified.

I don't know how Windows Vista behaves. I think the behavior will be the same as in Windows 7, but with a UAC being prompted when the uninstaller determines that an installation was global. I'll test this before submitting the pull request.

from zotero-standalone-build.

mikesteele81 avatar mikesteele81 commented on July 21, 2024

I've opened another issue with a pull request.

from zotero-standalone-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.