A poor man's app updater

J. Landman Gay jacque at hyperactivesw.com
Sun Mar 18 15:57:11 EDT 2018


On 3/18/18 6:44 AM, Graham Samuel via use-livecode wrote:
> Now, here is the primitive bit: if the user selects the update option, he/she is invited to carry out the following sequence:
> 
> - quit the current version (actually this can of course be done automatically via an “OK” button);

I'd automate this. The fewer steps the user needs to follow, the better.

> - delete the current version using the facilities of the OS (just trash it from the Applications folder on a Mac, or use the Control Panel on Windows): there is no reliable way of doing this from within an LC standalone, AFAIK;

I think you'd benefit from distributing some type of installer. When the 
user clicks the "OK" button, launch the URL of your web site where they 
can download it. Matthias' LC installer is ready (and the signing 
version is close to ready) so you could use that while staying within 
the LC environment. It does all the work for you.

Users know how to use installers and many Windows users don't understand 
anything else. There are more users than you think who don't know how to 
find a file or where apps are stored on their drive. The OS and/or the 
installer will manage older versions so you don't have to.

> - download and run a special “Uninstall Helper” program that gets rid of the Working Stack in the writeable area, plus preference files and the like - I don’t see any way of making this happen automatically, since logically it needs to be done **after** the main program is deleted;

Instead of a helper, I'd put some logic into your app itself. The 
working stack would have a custom property with its current version 
number. The standalone would check on launch if the working stack 
exists, and if so, if its custom version property matches the one it 
expects. If not, overwrite the existing one with the new one. The new 
one could either be downloaded from the internet on demand, or stored as 
a binary in a custom property of the standalone. Either way, overwriting 
is just a matter of putting the binary content into the existing stack 
file path on disk.

> - use the information given at the time of purchase to download the appropriate installer from the server;
> 
> - reinstall the program and input the registration data from the original purchase.

So, it sounds like you are already using an installer. If so, they're 
mostly done. I wouldn't remove the user registration file or 
preferences; unless it's changed there's no reason to make the user find 
their registration info again (and many will lose or misplace it, which 
will increase support requests.)

The short summary: The user only has to click "OK", the app quits, and 
the user is taken to a web site to download the update installer. Once 
they launch that and run the install, everything else is automatic. On 
first launch, the app replaces any necessary files.


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com





More information about the use-livecode mailing list