FoxPro Programming
Auto Updater
Gravatar is a globally recognized avatar based on your email address. Auto Updater
  Michael Hogan (Ideate Hosting)
  All
  Aug 11, 2017 @ 12:01pm

I was just about to tackle automatic updating of a VFP desktop application (again). In this case, getting the latest version from a specified network location. wThen I saw Rick's whitepaper: Updating Windows Applications and Installers for non-Admin Installation.

When I've done updaters in the past, I always hit a permission problem in recent versions of Windows when trying to update from a non-admin user account. Rick's paper is making me consider:

  • Create a loader program which is installed conventionally using InnoSetup. It will check it's own registry settings for file locations.
  • Have the loader install or update the program in the USER's %LocalAppData% folder if it's not already there and up to date, and then run it from that directory.

Of course it would mean that I'd have duplicate copies of the program - one for each user - but it would seem to solve the permissions problems.

It would still need permissions to update the loader - unless the loader just passes this off to another loader in the program directory... but that's probably too recursive.

Thoughts?

Gravatar is a globally recognized avatar based on your email address. re: Auto Updater
  Rick Strahl
  Michael Hogan (Ideate Hosting)
  Aug 12, 2017 @ 05:00pm

If you install your application completely in %LocalAppData% as I do with Markdown Monster, you can run both the loader and the application payload out of the %LocalAppData% folder, which means you can update and overwrite the existing application from the loader and just restart.

The main issue with that is that it can be considered malware by AV that figures out what the code is doing, as you can essentially hotswap executable code in place without the user even knowing.

Personally though I think it's always more polite to update your application by prompting users to download the installer again (or an updater) on their own and then uninstalling reinstalling. This way there's nothing suspicious plus you can ensure that you update everything that needs updating properly rather than updating a few files and perhaps missing something.

Doing hotswap updates seemed like a good idea in the past but these days it's really frowned upon for the potential security issues and non-transparency.

For all of my desktop software, I have an online version file that the application checks and if a newer version is available pops up a dialog to download the latest version along with release notes of what's new. With today's internet download speeds, unless your app is massive (Markdown Monster and HelpBuilder are ~11 megs each which isn't small) downloads take only a few seconds and running a full uninstaller/installer is just easier to manage, especially if integrated into a repeatable build setup.

+++ Rick ---

© 1996-2024