UpdateCheckInfo Class
Represents detailed update information obtained through a call to CheckForDetailedUpdate.
Assembly: System.Deployment (in System.Deployment.dll)
| Name | Description | |
|---|---|---|
![]() | AvailableVersion | Gets the version number of the latest uninstalled version. |
![]() | IsUpdateRequired | Gets a value indicating whether the update must be installed. |
![]() | MinimumRequiredVersion | Gets the minimum version that the user must have installed on the computer. |
![]() | UpdateAvailable | Gets whether an uninstalled update is available. |
![]() | UpdateSizeBytes | Gets the size of the available update. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
With UpdateCheckInfo, you can decide whether to upgrade your ClickOnce application based on information about the newest version. UpdateAvailable will return a Boolean value indicating whether there is a new update at all. The AvailableVersion property provides the version number of the new version, while MinimumRequiredVersion provides the earliest version that the user should have installed. IsUpdateRequired expresses whether the latest available update is required of the user. Finally, UpdateSizeBytes expresses the total size of the update.
Note |
|---|
Visual Studio adds the <deploymentProvider> element to the manifest only if the application is set to check for updates, so you either have to check The application should check for updates or specify an update URL in Update location in the Application Updates Dialog Box. |
The following code example uses UpdateAvailable to determine if there is a new application update, and IsUpdateRequired to determine whether to ask the user to install the update.
public: void InstallUpdateSync() { if (ApplicationDeployment::IsNetworkDeployed) { bool isUpdateAvailable = false; ApplicationDeployment^ appDeployment = ApplicationDeployment::CurrentDeployment; try { isUpdateAvailable = appDeployment->CheckForUpdate(); } catch (InvalidOperationException^ ex) { MessageBox::Show("The update check failed. Error: {0}", ex->Message); return; } if (isUpdateAvailable) { try { appDeployment->Update(); MessageBox::Show( "The application has been upgraded, and will now " + "restart."); Application::Restart(); } catch (Exception^ ex) { MessageBox::Show("The update failed. Error: {0}", ex->Message); return; } } } }
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.



