Squirrel.windows: Installation logic by version

Created on 3 Mar 2018  路  4Comments  路  Source: Squirrel/Squirrel.Windows

Hi!!,

I'm going to write the installation logic that I plan to make, so please let me know if it's the correct way.

  1. MyApp v1 is released, and installed for 10 users in the company 'ABC'
  2. MyApp v2 is released, and installed for 5 users in the company 'ZNN'
  3. There is a License API Web Service, which indicates each company to which application version it points to. In this case the company 'ABC' points to v1 and 'ZNN' points to v2.
  4. The setup.exe that is on the host that hosts the update packages will always be the latest version.
  5. If a new user of the company 'ABC' downloads the setup.exe, by default the v2 will be installed, which is the latest available version. Immediately upon starting the application, the license of the company 'ABC' will be validated and the v1 will be downloaded and the v1 will be applied. The application will restart immediately to ensure that you enter the correct version.
  6. The new user starts the application, and the licensing validation logic will validate that the version is correct (v1) and let continue normal. The user will have the appropriate version.

Is this business logic correct? In summary, a user who wants to install the application will always find the latest installer with the latest version available. Once this latest version is installed, the application will download and install the specific version, which may be less or equal.

A thousand thanks for the help you can give me!

Most helpful comment

This is not possible, Squirrel.Windows only allows you to update to higher version numbers so there is no way to revert v2 to v1 in your example. You're better off having two different release folders, one for v1 and one for v2 and then use your License API Web Service to ensure that the version that is installed is indeed the version they have access to. If the user installed the wrong version you can then prompt them to uninstall it and point them to the correct version to download.

All 4 comments

This is not possible, Squirrel.Windows only allows you to update to higher version numbers so there is no way to revert v2 to v1 in your example. You're better off having two different release folders, one for v1 and one for v2 and then use your License API Web Service to ensure that the version that is installed is indeed the version they have access to. If the user installed the wrong version you can then prompt them to uninstall it and point them to the correct version to download.

Hello, @Logikgate

After each publication of a new version, the generated setup.exe would be copied in one folder for each version. The setup.exe always contains the latest full package version.

In that order of ideas the design proposal would be the following:

  1. Distribute the installer of each version in separate folders. Example:
    ../MyApp/MyApp-1.4.5/setup.exe
    ../MyApp/MyApp-1.4.6/setup.exe
    ../MyApp/MyApp-1.4.7/setup.exe
    ../MyApp/MyApp-1.4.8/setup.exe

In this folder [../MyApp/MyApp-x.xx] there would be only the file setup.exe, and not the packages (.nupkg)

  1. Put the update packages (.nupkg) in a single global folder, so that the UpdateManager class always points to this folder.
    ../MyApp/Releases/MyApp-1.4.5-full.nupkg
    ../MyApp/Releases/MyApp-1.4.5-delta.nupkg
    ../MyApp/Releases/MyApp-1.4.6-full.nupkg
    ../MyApp/Releases/MyApp-1.4.6-delta.nupkg
    ../MyApp/Releases/MyApp-1.4.7-full.nupkg
    ../MyApp/Releases/MyApp-1.4.7-delta.nupkg
    ../MyApp/Releases/MyApp-1.4.8-full.nupkg
    ../MyApp/Releases/MyApp-1.4.8-delta.nupkg

What do you think of this business logic?

Thank you

Since you are trying to support two different versions of your program independently (v1 & v2) you need to have two different releases folders, one for all of the v1 releases and one for all of the v2 releases. This is the only way you will be able to update them independently of each other.

The only added logic you need is a check of your license manager to ensure that the current user is using the version (v1 or v2) that they are allowed to. If they aren't, you would notify the user to download the correct version and then close the program.

To illustrate the folder structure in this scenario it would be:
V1
Releases/v1/setup.exe
Releases/v1/RELEASES
Releases/v1/MyApp-1.0.0-full.nupkg
Releases/v1/MyApp-1.0.0-delta.nupkg
Releases/v1/MyApp-1.1.0-full.nupkg
Releases/v1/MyApp-1.1.0-delta.nupkg

V2
Releases/v2/setup.exe
Releases/v2/RELEASES
Releases/v2/MyApp-2.0.0-full.nupkg
Releases/v2/MyApp-2.0.0-delta.nupkg
Releases/v2/MyApp-2.1.0-full.nupkg
Releases/v2/MyApp-2.1.0-delta.nupkg

@estyfen did @Logikgate answer your question? If so, you can close this issue.

Was this page helpful?
0 / 5 - 0 ratings