Update From local File Help

Good afternoon wybuild team, maybe you would be able to help me with a problem I am having. I am trying to add a piece that allows users to choose to update from a local update file that they were emailed or sent on a disk (*.wyu). When I use the command line parameters and use the -updatepath switch (my wybuild.exe was build using %updatepath%/%file%) it wants the .wys server file and not the .wyu update file I would like to send. I am using the following to call the update:

UpdateFromLocal("C:\\Updates\testupdate.1.0.to.1.1.wyu");

public void UpdateFromLocal(string filePath) //.wyu file path { Initialize(UpdateType.Automatic); string commandLineParameter = string.Format("wyUpdate.exe -updatepath=\"{0}\"", filePath); _automaticUpdaterBackend.wyUpdateCommandline = commandLineParameter ; _automaticUpdaterBackend.ForceCheckForUpdate(); }

Would you be able to show me the proper way of doing this? In the end I am hoping to just send a .wyu file to the customers who can't use the internet while the rest of the users can update like usual from our server.

Thank you,

Your download site in wyBuild should look like this:

%updatepath%/%file%

And when you pass the updatepath to wyUpdate you need to do it like this:

UpdateFromLocal("file:///C:/Updates");

And inside the "C:\Updates" folder will site the *.wys file and the *.wyu files. Does that make sense?

Hi Wyatt,

What you are saying makes sense but I can not get it to work. I have the update path how you show it and to verify if I click the wyupdate.exe it cant find the download site. That is good. But in my application it wont work for the manual download.

Everytime I try it throws an error saying it can't download from my website url (I turned it off until I get this working) even though I am telling it to look at a file path.

the following is my adjusted manual update code.

UpdateStatus = UpdateStatus.Installing; StatusMessage = "Installing.."; _receivedStuff.Set(); Initialize(UpdateType.Automatic); string commandLineParameter = string.Format("wyUpdate.exe -updatepath=\"file:///C:/Updates\""); _automaticUpdaterBackend.wyUpdateCommandline = commandLineParameter; _automaticUpdaterBackend.ForceCheckForUpdate();

The folder it is pointing to contains the .wys file and the .wyu files.

I am stuck here.

string commandLineParameter =string.Format("wyUpdate.exe -updatepath=\"file:///C:/Updates\"");

That's the problem. Remove the "wyUpdate.exe" portion:

string commandLineParameter =string.Format("-updatepath=\"file:///C:/Updates\"");

Hi Wyatt, I have gotten it to work. I had tried removing the wyUpdate.exe before but it didn't work then. Must have been something else.

One thing I notice now, after using the switch to set the update path if I update locally or use the switch to point back at the server, after restarting there is always a command window left open. The command window is blank with no typing in it and you cannot type into it yourself. The address in the header of this command window is c:\Windows\system32\cmd.exe. This seems like it might be a bug. Can you confirm or deny this?

I have also noticed that occasionally when switching between local and internet updating for testing purposes I have to delete the 'c' folder from 'C:\users\wc\' because other wise it will ignore the switch and try to update from the wrong source. Have you run into this before?

Yes, wyUpdate caches information. So you can't just freely switch between sites while there is still an update pending.

That makes sense, I can handle that. What about the command window that gets left over after the updater has run? Is there a way to avoid this?

It seems when using the command line switch to point to a download site or local area, after the update has finished running and just before the app restarts a blank command window is displayed and does not go away unit it is manually closed.

Did you start a batch file that didn't close? wyUpdate doesn't show any command windows.