firstlookmedia/gpgsync

Improve upgrade process

micahflee opened this issue · 2 comments

Right now the upgrade UX isn't the best. If an update is available, it pops up an alert telling you to download the new version, but that's it. When the user installed the new .pkg file, if the old version of GPG Sync is running in the background it remains running there, it doesn't close an run the new version, which is confusing.

When there's an update available, instead of popping up an alert with a link, GPG Sync should:

  • Pop up an alert saying an update is available and asking if the user wants to update. Options should be, "Update", "Remind me later", or "Skip this version"
  • When they select "Update":
    • Use requests to download the new .pkg automatically to a temporary folder (updating a progress bar of the download)
    • After the download is complete, prompt the user to "Install" or "Cancel"
    • If they click "Install":
      • Write a simple bash script to the same temporary folder that:
        • Waits 1 second
        • Installs the new .pkg (/usr/sbin/installer -pkg GPGSync-x.pkg -target / as root)
        • Opens GPG Sync
      • Launch the bash script as a background process
      • Quit GPG Sync

This way, when the user clicks "Upgrade", the should just see it download the upgrade. Then when they click "Install", it prompts them for their password, and then the next thing they see is the new version of GPG Sync running.

I'm trying to make the pkg include a preinstall script that closes GPG Sync, and a postinstall script that opens it again. So far this is the best documentation I can find on the rat's nest of pkgbuild, productbuild, and pkgutil: https://stackoverflow.com/questions/11487596/making-os-x-installer-packages-like-a-pro-xcode-developer-id-ready-pkg/11487658#11487658

Rather than provider a full upgrader, a simplified version that will still make the upgrade process much smoother is to just add preinstall and postinstall scripts. When installing a new packaging, it should first close GPG Sync, and after the package is installed, it should open it.