Writing a GUI that can Check for Updates

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
Posts: 4
Joined: Wed Apr 12, 2017 9:43 am

Writing a GUI that can Check for Updates

Post by bmccarty »

I've created and am now adding new functions to a GUI application using PowerShell Studio that will likely be distributed to multiple machines across several states.

I would like to add a function for the GUI check for an updated version of the GUI and then provide the facility for downloading and relaunching the application.

I have not experience with this, but what I was considering thus far is to have a URL with an XML file that the gui would consult. It would then pull down an updater .exe file from the site and launch it and close the main app. Once the updater launches it would pull down the latest version of the GUI and then launch it and close.

Is this the best way to approach this, and more importantly is there someplace I can reference how to pull this off?

How does can I check the running .exe for version and compare it to the xml?
I'm not even sure what other questions to even ask.

Thanks very much.

Posts: 14452
Joined: Tue May 22, 2007 9:57 am

Re: Writing a GUI that can Check for Updates

Post by jvierra »

The current process has the version and file information. You can reference that. You will not be able to save the new copy from a running copy so you will have to quit the program after scheduling a task that will copy the new exe into its home.

I recommend searching fro solutions to see the many ways you can accomplish this. An installer would be the best method as the installer can check for a running copy and prompt for it to be closed.