Guide: Automatic Updates
JWrapper can automatically check for updates before launching your application and can then download and update your application automatically so it is up to date each time it is launched.
To enable updates you need only specify an <UpdateURL> tag with its contents being the update URL. This may be an HTTPS or HTTP URL.
<UpdateURL>http://myserver.com/myDownloadFolder</UpdateURL>
This URL should be a standard folder on a web server which contains the output build files that JWrapper produces. These files include a small version file for your application which will be checked on each run. To update to a new version you can then overwrite these files with your latest JWrapper build and all apps will automatically discover the new version and update before launching.
We recommend that you implement the JWrapperUpdateApp to perform any additional verification of your server before downloading and installing updates.
We also recommend that unless you are using JW Signed Updates you always have your update URL be HTTPS as the site would then require a valid SSL certificate to provide updates.
To enable updates you need only specify an <UpdateURL> tag with its contents being the update URL. This may be an HTTPS or HTTP URL.
<UpdateURL>http://myserver.com/myDownloadFolder</UpdateURL>
This URL should be a standard folder on a web server which contains the output build files that JWrapper produces. These files include a small version file for your application which will be checked on each run. To update to a new version you can then overwrite these files with your latest JWrapper build and all apps will automatically discover the new version and update before launching.
We recommend that you implement the JWrapperUpdateApp to perform any additional verification of your server before downloading and installing updates.
We also recommend that unless you are using JW Signed Updates you always have your update URL be HTTPS as the site would then require a valid SSL certificate to provide updates.
Atomic updates for stability
JWrapper downloads and applies updates atomically. The entire update is downloaded, then extracted to a temporary folder, then a sanity check is run, then only if this entire process has been successful is the new version renamed into place.
This prevents network problems, corrupted files or virtually any other issues from breaking an existing working installation during the update process.
This prevents network problems, corrupted files or virtually any other issues from breaking an existing working installation during the update process.
Managing old versions
JWrapper will automatically delete old versions when the new version has run for the 2nd time.
Matching the app to the server version
If your app connects to the update server and its version must exactly match the remote server version to function properly (e.g. if your app and server use a particular protocol and old versions are not supported) then you can have JWrapper ensure that it only launches the exact version (rather than the latest ever downloaded) for the update URL server by adding a top level tag <MatchClientVersionToServerVersion> with a value of “true”.
<MatchClientVersionToServerVersion>true</MatchClientVersionToServerVersion>
This is particularly useful for apps which are closely linked to an online service but where it is preferable that all apps are kept in sync with the server.
Note that if this option is specified then if the server is not available or the app cannot connect to the server to check its version it will not run and it will produce an error.
<MatchClientVersionToServerVersion>true</MatchClientVersionToServerVersion>
This is particularly useful for apps which are closely linked to an online service but where it is preferable that all apps are kept in sync with the server.
Note that if this option is specified then if the server is not available or the app cannot connect to the server to check its version it will not run and it will produce an error.