ApplicationDeployment.CheckForDetailedUpdate メソッド
アセンブリ: System.Deployment (system.deployment.dll 内)

Dim instance As ApplicationDeployment Dim returnValue As UpdateCheckInfo returnValue = instance.CheckForDetailedUpdate
利用可能な更新の UpdateCheckInfo。


CheckForDetailedUpdate メソッドを使用すると、同期呼び出し元は、非同期呼び出し元が CheckForUpdateCompletedEventArgs クラスを使用して取得する拡張情報と同じ情報を取得できます。

CheckForDetailedUpdate を使用して、最新の更新に関する情報を取得するコード例を次に示します。更新が存在する場合は、その更新が必須の更新の場合にだけ自動的にインストールされます。それ以外の場合は、ユーザーに確認のプロンプトが表示されます。
Dim WithEvents ADLaunchAppUpdate As ApplicationDeployment Public Sub LaunchAppUpdate() If (ApplicationDeployment.IsNetworkDeployed) Then ADLaunchAppUpdate = ApplicationDeployment.CurrentDeployment End If End Sub Sub ADLaunchAppUpdate_UpdateCompleted(ByVal sender As Object, ByVal e As AsyncCompletedEventArgs) Handles ADLaunchAppUpdate.UpdateCompleted If Not (e.Error Is Nothing) Then MessageBox.Show("Could not install application update. Please try again later, or contact a system administrator.", "Application Update Error") Exit Sub Else If (e.Cancelled) Then MessageBox.Show("The application update has been cancelled.", "Application Update Cancelled") Exit Sub End If End If ' Process successful update. Dim dr As DialogResult = MessageBox.Show("The application has been updated. Restart?", "Restart Application", MessageBoxButtons.OKCancel) If (System.Windows.Forms.DialogResult.OK = dr) Then Application.Restart() End If End Sub
public void LaunchAppUpdate() { if (ApplicationDeployment.IsNetworkDeployed) { ApplicationDeployment appDeploy = ApplicationDeployment.CurrentDeployment; appDeploy.UpdateCompleted += new AsyncCompletedEventHandler(appDeploy_UpdateCompleted); } } void appDeploy_UpdateCompleted(object sender, AsyncCompletedEventArgs e) { if (e.Error != null) { MessageBox.Show("Could not install application update. Please try again later, or contact a system administrator.", "Application Update Error"); return; } else if (e.Cancelled) { MessageBox.Show("The application update has been cancelled.", "Application Update Cancelled"); return; } // Process successful update. DialogResult dr = MessageBox.Show("The application has been updated. Restart?", "Restart Application", MessageBoxButtons.OKCancel); if (DialogResult.OK == dr) { Application.Restart(); } }
public: void InstallUpdateSyncWithInfo() { if (ApplicationDeployment::IsNetworkDeployed) { ApplicationDeployment^ deployment = ApplicationDeployment::CurrentDeployment; UpdateCheckInfo^ updateInfo = nullptr; try { updateInfo = deployment->CheckForDetailedUpdate(); } catch (Exception^ ex) { MessageBox::Show("The update failed. Error: {0}", ex->Message); return; } if (updateInfo->UpdateAvailable) { bool doUpdate = true; if (!updateInfo->IsUpdateRequired) { System::Windows::Forms::DialogResult dr = MessageBox::Show( "An update is available. Would you like to " + "update the application now?", "Update Available", MessageBoxButtons::OKCancel); if (!(System::Windows::Forms::DialogResult::OK == dr)) { doUpdate = false; } } if (doUpdate) { try { deployment->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; } } } } }


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からApplicationDeployment.CheckForDetailedUpdate メソッドを検索する場合は、下記のリンクをクリックしてください。

- ApplicationDeployment.CheckForDetailedUpdate メソッドのページへのリンク