Programatically set upgrade server(s)?

Hello,

I am using the AutomaticUpdaterBackend class to automatically upgrade a .NET windows service. We are currently planning our test strategy for this feature. We have 3 distinct environments: dev/staging/production. We would like to roll upgrades out in a phased approach to dev then staging before users are impacted in our production environment.

We looked at the AutomaticUpdaterBackend API and were unable to find a way to set this list before checking for upgrades. We would like to add an optional .config setting to our app which we could use to have our environments point to separate upgrade servers (while testing the same software). Is there any way to accomplish this programatically using AutomaticUpdaterBackend?

One solution that we came up with was to use the hosts file to redirect outgoing requests in our dev and staging environments. This could work, but is not ideal for us.

Regards!Josh Coleman

P.S. Thanks for the help on my previous thread about the service not restarting. I think the issue was that I was using 'sc create' and setting the binpath. Once I deployed with InstallUtil everything started working fine.

Hey Josh,

Is there any way to accomplish this programatically using AutomaticUpdaterBackend?

Yes, use the wyUpdate commandline "server" switch. For example:

automaticUpdater.wyUpdateCommandline = "-server:\"http://yoursite.com/alternative.wys\"";

Does that help?

Yes, Thanks! 🙂

Hey Sam,

I was playing around with this today and it works for getting the list of updates. Unfortunately, It looks like the automatic updater is still trying to go to the upgrade server that is baked into the wys/wyc to download the actual update files.

Is there any option to over-ride this? I would like to use the same set of .wys upgrades for my test and production environments.

Regards!Josh Coleman

The -server commandline switch simply points to an alternative location to download the *.wys file. The *.wys file still contains all the update sites listed in your wyBuild project file.

To specify alternative download sites use the %updatepath% variable and the -updatepath commaneline switch. I.e.

%updatepath%/%file%

then

wyUpdate.exe -updatepath="http://example.com"

Does that make sense?

Yup! thx 🙂

Is it possible to upload to a server selectively using the GUI? Right now it looks like when I add more than one upload server, it just uploads to both. In actuality, I'd like to upload to one as my staging deploy, and the other as a production deploy.

I am also a little unclear on the distinction between upload sites and download sites. When would these ever want to be different?

Is it possible to upload to a server selectively using the GUI? Right now it looks like when I add more than one upload server, it just uploads to both. In actuality, I'd like to upload to one as my staging deploy, and the other as a production deploy.

Right now wyBuild only supports uploading to all servers.

I am also a little unclear on the distinction between upload sites and download sites. When would these ever want to be different?

Let's say your app is a publicly available B2B app. Your download site would be something like http://example.com/updates/%file% and your upload site might be an SFTP server in the "/var/www/example.com/updates" directory.

In this case the download and upload sites are completely "different". I put "different" in quotes because when you upload to an SFTP or FTP site the implication is that you're uploading to a folder that will be accessible by the server that your customers will access.

Even if you're using FTP for both the download and upload sites, you'll want to use different permissions (aka user/passwords). You don't want your download site to have writeability.

Does that make sense?

Ahh, I see! In this case, we are just using it so our servers are updated to the latest software when they are created, so I hadn't thought of it in that sense. It would be nice if they at least shared a UI, but I can work with it this way.

Thanks!