I'm developing a software and I want, for several reasons, to develop my own auto-update feature. The program is a full GUI, written with PyQt, and uses icons, data files, etc. It will be frozen with cx_freeze or pyinstaller.
The auto-update part will download the new version (a zip) on a remote server. Then, it gets complicated:
The software is running, and has downloaded the new version. What does it do with the new version ? Can the software extract the files from the zip, and overwrite the files of the running version ?
Or should I store the new version aside, quit the running version, and somehow use the new version ? If so, how do I do the exchange between the old and new version ?
EDIT:
Here is for example the closeEvent
method of my class QMainWindow:
def closeEvent(self, event):
"""Method to perform actions before exiting.
Allows to save the prefs in a file"""
...Do some stuff...
QtGui.qApp.quit()
self.logger.info("Closing the program")
Can I use this method to perform the exchange ?