Ideas for an auto-updater

Post your Gambas programming questions here.
Post Reply
monteiro
Posts: 7
Joined: Monday 26th September 2016 11:40am

Ideas for an auto-updater

Post by monteiro » Tuesday 21st June 2022 11:06am

Hi, folks
-------------------------------------------------- The Scenery ---------------------------
I've made at about 20 integrated programs for the same company (sales, production, invoicing, laboratory, etc) using gambas and postgres. The database runs on a local network server and each program on the user's desktop.

At least once a week I need to update one or more programs. I do so and upload the gambas program to the server.,

------------------------------------------------- The needs and what I've done --------------
Each time I upload an updated program, I has to feed a table named "versions" with the name and version number of the program.
Each program has a initial login form. At the form.open sub it searches for a higher version of itself and, if positive, calls another little program to close the first one, grab the newer version and open it. All of with the user's permition.

------------------------------------------------ The problem --------------------------------------------
One updater for each program.
If I forget to feed the versions table nothing happens.

Does anyone have any ideas?

User avatar
cogier
Site Admin
Posts: 883
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Ideas for an auto-updater

Post by cogier » Tuesday 21st June 2022 1:29pm

Have a look at a program I wrote some time ago to update a program on different computer(s). I used Dropbox which allowed for remote updates, but any folder can be setup. The program was only designed for a single program update, see the help files. It could be modified to suit multiple updates, perhaps by setting up a different settings file for each program. The program is 'AutoUpdater', it is on the Farm or available here. Let me know how you get on.

BruceSteers
Posts: 792
Joined: Thursday 23rd July 2020 5:20pm

Re: Ideas for an auto-updater

Post by BruceSteers » Tuesday 21st June 2022 8:24pm

monteiro wrote:
Tuesday 21st June 2022 11:06am
Hi, folks
-------------------------------------------------- The Scenery ---------------------------
I've made at about 20 integrated programs for the same company (sales, production, invoicing, laboratory, etc) using gambas and postgres. The database runs on a local network server and each program on the user's desktop.

At least once a week I need to update one or more programs. I do so and upload the gambas program to the server.,

------------------------------------------------- The needs and what I've done --------------
Each time I upload an updated program, I has to feed a table named "versions" with the name and version number of the program.
Each program has a initial login form. At the form.open sub it searches for a higher version of itself and, if positive, calls another little program to close the first one, grab the newer version and open it. All of with the user's permition.

------------------------------------------------ The problem --------------------------------------------
One updater for each program.
If I forget to feed the versions table nothing happens.

Does anyone have any ideas?
For things like that i'd utilise the "run command" option when making an exe.
you could set it to run a script that updates the version table when as new version is compiled.
I have one that auto-changes the version strings in my help files on compile.
note, on my gambas i have both a "Run before compile" and a "Run after compile" option as i find it quite useful.

and possibly turn the separate updater program into a class that you can add to each app?

monteiro
Posts: 7
Joined: Monday 26th September 2016 11:40am

Re: Ideas for an auto-updater

Post by monteiro » Tuesday 28th June 2022 9:03am

Thank you guys.
I've downloaded the auto-uploader program and will also study the suggestion of a specific class inside the project. The user's machines are now allowed to upload to the server.

User avatar
Quincunxian
Posts: 145
Joined: Sunday 25th June 2017 12:14am
Location: Western Australia

Re: Ideas for an auto-updater

Post by Quincunxian » Tuesday 28th June 2022 10:35pm

Something to note based on building something similar a few years ago.
Make sure that your process allows for updating the updater on the client machine.
You can normally do this centrally.
Cheers - Quin.
I code therefore I am

Post Reply