Possible to update from local media?

Hi, Wyatt.

My application is sometimes installed on board container ships where internet access often isn't available. In those cases my customers needs to update from a DVD, USB stick or other local media instead. The local media would then hold the necessary update files (*.wys, *.wyu).

In a test I have tried to change the wyUpdateCommandLine property of the AutomaticUpdater control to:

" -server= file://H:/FolderHoldingUpdateFiles/wyserver.wys".

As a result the AutomaticUpdater in fact discovers and reports the update, but when I afterwards call the InstallUpdate() method, it tries to update from the Internet (which fails, naturally!) and not from the local media.

Is there a way to go around this?

Hey Martin,

Yes this can done with a new commandline argument that was introduced in wyUpdate 2.5.22: "-updatepath". For instance in your update sites list add this:

%updatepath%/%file%

Right click it to make it "just an update site". Then pass the updatepath argument to wyUpdate, e.g.:

wyUpdate.exe -updatepath="file://H:/FolderHoldingUpdateFiles"

or this for regular updates:

wyUpdate.exe -updatepath="http://yoursite.com/updates"

Now, since you're delivering updates where there's no internet connection, you'll also have to supply the latest version of wyUpdate with your app. That is, wyUpdate won't be able to self-update via the internet, so you'll have to install the latest wyUpdate.exe (a simple replace operation).

I'd make a script or a quicky exe (using NSIS or a similar tool) that does 2 things:

  1. Copies the latest wyUpdate.exe over the existing wyUpdate.
  2. Execute wyUpdate with correct paths & commanline arguments.

Does this help?

Hi, Wyatt.

No, it doesn't really help.

1) In wyBuild: I specify %updatepath%/%file% (as you say) and build client.wyc

2) In my app: I let the user browse to the folder holding the update files - in this case it is H:\updates. I use the folder name to construct the command line arguments in step 3.

3) I programmatically change the wyUpdateCommandLine property of AutomaticUpdater control in my app to -updatepath="file://H:/updates" -server="file://H:/updates/wyserver.wys"

4) I call the ForceCheckForUpdates() method.

The ForceCheckForUpdates() methods returns OK, but the AutomaticUpdater control doesn't fire any events at all, which I think it should (and normally does - telling about the outcome of the update check).

I have trid to call wyUpdate.exe directly with the exact same command line parameters, and then wyUpdate.exe updates fine.

What am I doing wrong? Have I misunderstood something?

By

Martin.

That looks right. I'll try to reproduce this problem. I'll get back to you.

Hi, Wyatt.

The problem seems to be connected with cached data, somehow. I finally got it to work by deleting all cached data ("wyUpdate AU" and "wc" folders) every time my app starts. However, I don't like this approach, especially because it depends heavily on the inner behaviour of AutomaticUpdater and wyUpdate.

I thought this hint would be helpful for you in your research.

-Martin.

The problem seems to be connected with cached data, somehow. I finally got it to work by deleting all cached data ("wyUpdate AU" and "wc" folders) every time my app starts.

Deleting the cache everytime you start your app is the only way your app can update? Is there any chance that I could see your source code. Or perhaps a simplified version that exhibits the same behavior?

By the way, if you delete the cache everytime your app starts then you're removing a large part of the usefulness of the AutomaticUpdater. Namely, the only way an update will be able to be installed is if it's downloaded, extracted, and installed all while your program is running.

That is, you'll be wasting a TON of bandwidth on users re-downloading the same update over and over again.

So, we should really get to the bottom of this. Can you reproduce the problem? If so, can I see how you integrate the AutomaticUpdater in your app?