How can I enable auto-updates in a Qt cross-platform application?

前端 未结 12 544
孤街浪徒
孤街浪徒 2020-12-22 18:37

I love applications that are able to update themselves without any effort from the user (think: Sparkle framework for Mac). Is there any code/library I can leverage to do th

12条回答
  •  孤城傲影
    2020-12-22 19:32

    This is an old question but there is not Squirrel in answers which is BEST SOLUTION , here is what I'm doing in qt 5.12.4 with qt quick "my qml app" you can do this in any other language

    I'm doing this in windows there is mac version of squirrel too, I don't know about Linux

    1. download nuget package explorer release https://github.com/NuGetPackageExplorer/NuGetPackageExplorer/releases
    2. open nuget package explorer and add this directory 'lib/net45' it doesn't matter you have a .net app or not, I did this for my qt application otherwise it won't work.
    3. add all files into this folder specify your version in the metadata
    4. save nupkg file
    5. download squirrel release https://github.com/Squirrel/Squirrel.Windows/releases
    6. add squirrel to windows environment path
    7. open cmd and cd to directory of nupkg file
    8. squirrel --releasify file_name.nupkg -> now inide releases folder, there should be setup.exe file which will install app and other files.
    9. to create new version do 2,3,4,7,8 again if its an update it will create delta file which is only needed file to update, put this files into your service directory for example in updates folder of your website which you need to disable directory browsing in IIS , and to auto-update application you need to call Update.exe which is in parent folder of application root directory appdir/../update.exe --update http://yourserver.com/upates/ after application restart app should start with new version
    10. you can find documentation for squirrel in https://github.com/Squirrel/Squirrel.Windows/blob/develop/docs/getting-started/0-overview.md and nuget package explorer here https://github.com/NuGetPackageExplorer/NuGetPackageExplorer and you can use only nuget.exe too if you don't want to use nuget package explorer which can be used for dynamic generation of versions, which can be download from https://www.nuget.org/downloads

    That easy. Now you have auto-update app which will download updates from the server and auto-update app. For more info you can read documentations.
    note: for iis uses https://github.com/Squirrel/OldSquirrelForWindows/issues/205

提交回复
热议问题