Fetches version information from the internet and raises an UpdateAvailable event if a new version is available for download. More...
Public Member Functions | |
| bool | Install () |
| Updater (IReleaseInfo releaseInfo) | |
| void | Dispose () |
| override bool | Execute () |
| This method may be called by a ProcessViewModelBase-derived class in a worker task that wraps this method in a try...catch structure. More... | |
Public Member Functions inherited from Bovender.Mvvm.Models.ProcessModel | |
| void | Cancel () |
| Cancels the current process More... | |
Protected Member Functions | |
| void | Dispose (bool disposing) |
| virtual string | GetDestinationFileName () |
| Builds the destination file name from the download URI and the destination folder (which is stored in a public property and could be set by a view that subscribes to this view model). More... | |
| virtual string | GetInstallerCommand () |
| Returns the command to execute in the shell to install the update. More... | |
| virtual string | GetInstallerParameters () |
| Returns commandline parameters for the update installer. More... | |
| virtual bool | CheckAuthorization () |
| Determines whether the current user is authorized to write to the folder where the addin files are stored. More... | |
| virtual bool | Verify () |
| Compares the actual and expected checksum hashes and sets the IsVerifiedDownload property accordingly. More... | |
| override void | OnCancelling () |
Properties | |
| UpdaterStatus | Status [get, protected set] |
| Exception | Exception [get, protected set] |
| IReleaseInfo | ReleaseInfo [get, set] |
| string | DestinationFolder [get, set] |
| SemanticVersion | CurrentVersion [get, set] |
| int | PercentDownloaded [get, protected set] |
| long | DownloadBytesTotal [get, protected set] |
| long | DownloadBytesReceived [get, protected set] |
Properties inherited from Bovender.Mvvm.Models.ProcessModel | |
| ProcessModel | Dependent [get, set] |
| bool | IsCancellationRequested [get, set] |
| This property is set to true by the Cancel() method. More... | |
Additional Inherited Members | |
Events inherited from Bovender.Mvvm.Models.ProcessModel | |
| EventHandler< ProcessModelEventArgs > | Cancelling |
Fetches version information from the internet and raises an UpdateAvailable event if a new version is available for download.
The current version information resides in a simple text file which contains four lines: e.g. 1) Current version 7.0.0-alpha.1 2) Download URL http://sourceforge.net/projects/xltoolbox/files/XL_Toolbox_7.0.0-alpha.1.exe 3) Sha1 of executable 1234abcd... 4) Version description This is the first release of the next generation Toolbox
Definition at line 41 of file Updater.cs.
|
inlineprotectedvirtual |
Determines whether the current user is authorized to write to the folder where the addin files are stored.
If the user does not have write permissions, he/she cannot update the addin by herself/hisself.
Definition at line 261 of file Updater.cs.
|
inlinevirtual |
This method may be called by a ProcessViewModelBase-derived class in a worker task that wraps this method in a try...catch structure.
The implementation does not need to and should not handle tasks or threads itself.
Implements Bovender.Mvvm.Models.ProcessModel.
Definition at line 158 of file Updater.cs.
|
inlineprotectedvirtual |
Builds the destination file name from the download URI and the destination folder (which is stored in a public property and could be set by a view that subscribes to this view model).
Derived classes will typically want to override this, as the base method uses a simple generic file name that contains the version number.
Definition at line 210 of file Updater.cs.
|
inlineprotectedvirtual |
Returns the command to execute in the shell to install the update.
Definition at line 242 of file Updater.cs.
|
inlineprotectedvirtual |
Returns commandline parameters for the update installer.
Definition at line 250 of file Updater.cs.
|
inlineprotectedvirtual |
Compares the actual and expected checksum hashes and sets the IsVerifiedDownload property accordingly.
Automatically switches between SHA-256 and the obsolete SHA-1 algorithms.
Definition at line 291 of file Updater.cs.