Changing Update Server

Hi,

I have a scenario where we are delivering our app to a client that is going to deploy it in house. They would like to be able to specify the update server on their end, so I wanted to find out if there was a way to change the update URL after the fact? We would still obviously have to build the update packages for them and deliver those to them to drop on their server but we would not know the URL at the time of building the update package. Just wondering if this would be possible? I did see a response to an earlier question where you mentioned changing the URL in the .wys file manually but I wasn't sure if this would work.

Thanks

They would like to be able to specify the update server on their end, so I wanted to find out if there was a way to change the update URL after the fact?

Yes. Either rebuild the client.wyc file and include that in your update (thus when the user updates they'll get the new client.wyc file and thus the new download sites.)

Or, manually override the download sites: -server="<url>", -updatepath="<url>".

Hi Sam,

Thanks for the reply. I have looked at the client.wyc file and tried to open this file with a text editor but when I open it, it looks to be encoded or a binary file. What editor can I use to manually edit the file?

Thanks

Ok - It just took a little bit of digging on the site for me to find this. Just want to make sure that I have this correct.

I am using the automatic updater so I just need to give the user an interface that they can specify their server and/or updatepath URLs and then set the appropriate property of the automatic updater in my code using the wyUpdateCommandline property. My only question is how can I set multiple options with this? Do I separate them with a semicolon, etc.

Thanks

You mean multiple commandline options? You'd specify them like you'd pass to an executable. For example:

au.wyUpdateCommandline = "-cdata=\"C:\\Location\\To\\client.wyc\" -updatepath=\"http://example.com/updates\"";

In that example I used both a cdata and an updatepath.

Tell me if that helps.

Thanks Sam - that's exactly what I was looking for!

Hi Sam,

Ok after getting everything in place for this, I am having issues setting the wyCommandline parameter for the automatic updater. What it boils down to is this code.

strParameters = String.Format(@"-server=""{0}\wyserver.zip"" -updatepath=""{0}""", m_AutoUpdateConfiguration.FullURL);

automaticUpdater1.wyUpdateCommandline = strParameters;

(sorry didn't know how to put in a code block)

Where m_AutoUpdateConfiguration is my class that holds different properties, one being FullURL which equates to http://localhost:8080/updates

I have a local webserver running on my development machine on port 8080. After executing the above code, I try the update again and the error I'm seeing is that is it still looking at the server specified in the .wyc file and not the newly specified location. Is there something I'm missing?

Also, and this isn't as important; is there something I can do to clear these settings in the automatic udpater without having to restart the app?

Thanks for any help you can give me.

Well, for starters make sure your download site uses the %updatepath% variable or nothing will be replaced. Then make sure you rebuild wyUpdate and include the latest client.wyc with your app.

Lastly, make sure you set the wyUpdateCommandline property in the constructor of your app before you make any AutomaticUpdater calls.

Ok - I'm really banging my head against the wall now.

I changed my download site to %updatepath%/%file% and rebuilt wyUpdate and included the latest client.wyc with the app. I even took out my default server path for updates and only have the above. I'm not sure if this is even valid but I figured if I'm going to specify this at run-time then it should be valid.

I also moved my code to set the command line to the constructor of the form. I did this after the InitializeComponent() call since the control would probably balk at me if I tried before. I did read in an earlier post that someone was having an issue with setting command line parameters and there was some discussion as to if the control would pick this up after the InitializeComponent() call since it should already be started but you can't set them after it is started so it seemed like a catch-22 - anyway not to digress.

I took out the -server portion so as not to muddy the waters too much and only have to deal with the -updatepath. The code that I'm using to set that value is:

string strParameters = String.Format(@"-updatepath=""{0}""", m_AutoUpdateConfiguration.FullURL);

which equates to: -updatepath=\"http://127.0.0.1:8080/updates\"

When I run my program the error that I'm seeing is:

Error trying to save file: Error downloading "http://192.168.2.13/updates/myapp.1.0.to.1.1.zip": The remote server returned an error: (404) Not Found.

which is the previous server that I had specified for downloads but had removed it from my project. So I couldn't understand why it was giving me this error.

So next I blew my project away - no biggie - just getting started with it - and created a new project and did not specify the old server location at all. I don't have anything in the project as far as updates - just the 1.0 version. I put the wyUpdate.exe and client.wyc files from the new project in with my app and put the update files in the proper location.

When I run the app, I'm getting the exact same error and now I'm really puzzled as to why it is telling me it is getting a 404 error from a server that it should not even know about and specifying an update package that it shouldn't even know about as well.

So finally I decided to comment out my code where I am setting the command line parameter in my code and just put the wyCommandline value in the control properties at design time. (The value I put in the property is: -updatepath="http://127.0.0.1:8080/updates") (copy and pasted from the properties dialog in VS) and ran the app.

Same exact error. I'm kind of at a loss of what to try next. Any suggestions is greatly appreciated.

Error trying to save file: Error downloading "http://192.168.2.13/updates/myapp.1.0.to.1.1.zip": The remote server returned an error: (404) Not Found.

OK, it sounds like the *.wys is downloading fine, the problem is that the *.wys file is referencing your old download site. Did you rebuild your updates? Did you re-upload them to your server?

Ok - that was the missing piece to my puzzle.

I did rebuild the project and have my latest builds in my updates folder but for some reason it was still failing. I did a search for the wyserver.wys file and found it in a couple of places and deleted it. After that it worked like a champ! So it seemed as if that file was not being updated for some reason. I am working on a Windows 8 box so I'm not sure if it has something to do with that. Anyways, I know my clients are not and I have some extensive testing to do before I put out any releases.

As a follow up question, how does the updater know if there is an update available? Is this through the wyserver file? The reason I'm asking is for my testing purposes. I'm going to want to continually test the update function and I need to roll back my app to the last version so will I need to replace the wyserver file to the previous version as well?

Thanks for all your help on this!

Disregard my last question. I figured it out. Thanks for everything so far...