clowd / Clowd.Squirrel

Quick and easy installer and automatic updates for cross-platform dotnet applications
427 stars 39 forks source link

system Wide Installer and updates #154

Closed cupper1 closed 1 year ago

cupper1 commented 1 year ago

Hi So I have a question and I think unexpected behavior. I have compiled multiple versions and put them on a cloud space where a standard url can get to them (s3). This works great and all updates work.

Then a customer asked for a system wide installer for all users. I then compiled with the --msi "x64" option and it works great. You run it, then logout and login and the app installs, great!

Now I published an update, but the system wide installer version is not updating. I am just not sure why. Any ideas?

Thank you so much for the product and support!!

Here is the update in my app that works:

using var mgr = new UpdateManager("https://xxxx/produpdates");

        var newVersion = await mgr.UpdateApp();

        // optionally restart the app automatically, or ask the user if/when they want to restart
        if (newVersion != null)
        {
            DialogResult dotheywantto = MessageBox.Show("xxxhas released a new version. Your application has been automatically updated! Would you like to restart now?", "Complete Upgrade", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (dotheywantto == DialogResult.Yes)
            { UpdateManager.RestartApp(); }

        } 
caesay commented 1 year ago

The MSI does not automatically update. The MSI is designed to get deployed and updated via ad group policies etc by your ad administrator. When the MSI is installed on the system it will automatically deploy the software on a per-user basis on each user login. If an old version of the MSI is installed (eg. if this was installed manually instead of through group policy) the local app will auto-update on first run so your apps will still stay up to date.

cupper1 commented 1 year ago

Sorry that sounds like its conflicting to me, can you please explain? "The MSI does not automatically update" and then you say "the local app will auto-update on the first run".

so I build my MSI with version 3.0.1, its deployed by one time install. All works well for the user, they login and its deploys 3.0.1

Next month I release 3.0.2 with nuget package, delta, etc. The user logs in and starts their 3.0.1, should it not pull 3.0.2 and update just like normal?

caesay commented 1 year ago

The local app will always auto-update. The MSI itself will never auto-update itself.

"system wide" installs are not supported at all by Squirrel. Each user on a computer gets their own version of your app, and they can be at different versions. The MSI you get only allows you to auto-install the app for each user who logs in to the system.

Here's an example:

You install MSI v3.0.1. User AAA logs in, and the MSI will install v3.0.1 of the local app automatically. All works well. You deploy v3.0.2 to S3 (or similar), and the next time AAA runs v3.0.1 it will be auto-updated to v3.0.2.

If user BBB now logs in on the same computer, the installed MSI is still v3.0.1, so BBB will get version v3.0.1 installed even though there is a newer version available. At this point, user AAA has v3.0.2 and user BBB has v3.0.1. When v3.0.1 runs for BBB, it should then auto-update to v3.0.2 (depending on how you've configured updates for your application - this is up to your code).

Since the MSI never updates automatically, it will always install v3.0.1 of your app when a new user logs in. However, your users will always eventually get the latest version through standard Squirrel updates.

The MSI was designed to be deployed through AD group policies, and this is how you should update it. For example, when you deploy v3.0.2 of your app, you should upload your nupkg and installer to your S3 bucket so that local user installs will be updated - but you should ideally also deploy the new version of the MSI to AD/group policy, so on joined computers new users will get the latest version when they sign in.