Found some bugs???

Topics: Updater Application Block
Apr 7, 2004 at 9:03 AM
originally posted by: glenn122

If you attempt to not use validation and instead trigger program restart from the DownloadCompleted event everything works properly except the old version doesn't end and the new version doesn't start. Ive traced the problem down to the following:

In the MS.AB.ApplicationUpdater - DownloaderManager.vb module the OnDownloadCompleted method is raising the DownLoadCompleted event (line 184) but the secondparameter is being created with the wrong constructor:

RaiseEvent DownloadCompleted(Me, New UpdaterActionEventArgs(_application.Name))

should be (I think):

RaiseEvent DownloadCompleted(Me, New UpdaterActionEventArgs(server,application.Name))

The other events just above it follow that pattern and this would explain why the StartNewVersion fails on the reference to Server.AvailableVersion reference. This is important if you don't use validation and use the OnUpdaterDownloadCompletedHandler event to launch the new program, if you come off of the validated event you wouldn't notice it.

Secondly I think the StartNewVersion method in the SelfUpdating example is wrong:

The statement:

newProcess.WorkingDirectory = newDir + server.AvailableVersion

creates a workingdirectory with the exe embedded in the middle of it (newDir at that point is: Path.Combine(basePath, "AppStart.exe") ).

I think the correct statement is:

newProcess.WorkingDirectory = Path.Combine(basePath, server.AvailableVersion)

If anyone has a chance to validate this I'd appreciate it. If it proves itself out how do I get the bug fixed in the versions available for download. This might solve bug #1 that's out there too.