UpdateManagerはDeadlineによって作成されました。このライブラリは無料で開発されました。
このライブラリは、アプリケーションの更新を確認するために使用できます。 WPFおよびWindowsフォームアプリケーション用に設計されています。それを使用するには、更新クラスを表すリモートまたはローカルサーバー上のXMLまたはJSONファイルが必要です。
UpdateManagerは、Nugetパッケージとして利用できます。ここで見つけることができます:
https://www.nuget.org/packages/codedead.updatemanager/
サンプルプロジェクトはこちらにあります:
https://github.com/codedead/updatemanager/tree/master/updatemanager.sample
https://github.com/codedead/updatemanager/tree/master/updatemanager.sample.wpf
このような新しいUpdateManagerオブジェクトを作成します。
// Import statement
using CodeDead . UpdateManager . Classes ;
// Initialize a new UpdateManager object
UpdateManager updateManager = new UpdateManager ( ) ;このような更新を確認できます。
try
{
// Retrieve the latest Update object from the remote location
Update update = updateManager . GetLatestVersion ( ) ;
}
catch ( Exception ex )
{
MessageBox . Show ( ex . Message , "Application title" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
} 更新は、 JSONまたはXMLの2つの異なる形式で保存および解析できます。デフォルトでは、 DataTypeプロパティはJSONに設定されます。 UpdateManagerオブジェクトに適切なプロパティを設定することにより、 DatAtypeプロパティを変更できます。
// Initialize a new UpdateManager object
UpdateManager updateManager = new UpdateManager ( ) ;
// Set the data type of the remote Update object representation
updateManager . DataType = DataType . Json ; // Initialize a new UpdateManager object
UpdateManager updateManager = new UpdateManager ( ) ;
// Set the data type of the remote Update object representation
updateManager . DataType = DataType . Xml ;{
"MajorVersion" : 1 ,
"MinorVersion" : 0 ,
"BuildVersion" : 0 ,
"RevisionVersion" : 0 ,
"UpdateUrl" : " https://codedead.com/update.exe " ,
"InfoUrl" : " https://codedead.com " ,
"UpdateInfo" : " A new version is now available. Please click the download button to download version 1.0.0.0 "
}<? xml version = " 1.0 " ?>
< Update xmlns : xsd = " http://www.w3.org/2001/XMLSchema " xmlns : xsi = " http://www.w3.org/2001/XMLSchema-instance " >
< MajorVersion >1</ MajorVersion >
< MinorVersion >0</ MinorVersion >
< BuildVersion >0</ BuildVersion >
< RevisionVersion >0</ RevisionVersion >
< UpdateUrl >https://example.com/update.exe</ UpdateUrl >
< InfoUrl >https://codedead.com/</ InfoUrl >
< UpdateInfo >A new version is now available. Please click the download button to download version 1.0.0.0</ UpdateInfo >
</ Update >このライブラリはCodeDeadによって維持されています。次のリンクを使用して、私たちについて詳しく知ることができます。
また、ジェットブレーンが、ライダーやResharperなどの素晴らしいツールを使用するように私たちに与えてくれたオープンソースライセンスについても感謝したいと思います。