using System.Xml.Serialization; namespace NaGet.Packages { /// /// インストーラの種類を表す。 /// public enum InstallerType { /// /// インストーラ /// [XmlEnum(Name="installer")] EXEC_INSTALLER, /// /// Microsoft Software Installer /// [XmlEnum(Name="msi")] MSI_PACKAGE, /// /// 自己解凍書庫を含む書庫一般 /// [XmlEnum(Name="archive")] ARCHIVE, /// /// インストールできない単なるデータ(BIOSなど) /// [XmlEnum(Name="cannotinstall")] CANNOT_INSTALL, } /// /// パッケージ情報を格納するクラス /// public class Package { /// /// パッケージ名 /// public string Name; /// /// バージョン文字列 /// public string Version; /// /// パッケージの概要 /// public string Summary; /// /// パッケージの解説 /// public string Description; /// /// 公式サイトのURL /// public LocationEntry Url; /// /// 製作者の名前 /// public string Author; /// /// インストーラのタイプ /// public InstallerType Type; /// /// インストーラが書庫内に入っているかのフラグ /// public bool ArchivedInstaller = false; /// /// アンインストーラのレジストリのキー /// public string UninstallerKey; /// /// サイレントインストールのための引数。 /// インストーラ形式のみ有効で、nullもしくは空文字列の場合は /// サイレントインストールができないことをあらわす /// public string SilentInstallArguments; /// /// インストールスクリプト(MSBuildドキュメント) /// public string InstallScript; /// /// アーカイブインストーラのときのSystem32のコピー /// public string System32CopyFiles; /// /// インストーラのリソースの配列 /// [XmlElement] public Installer[] Installer; /// /// 必要とされるパッケージの配列 /// [XmlArray(IsNullable=true),XmlArrayItem("Entry")] public Entry[] Requires; /// /// 競合するパッケージの配列 /// [XmlArray(IsNullable=true),XmlArrayItem("Entry")] public Entry[] Conflicts; /// /// タグ /// public string Tags; /// /// ライセンス /// public string License; /// /// 所属するパッケージリスト名称 /// public string PackageListName; } /// /// パッケージ参照を示すクラス /// public class Entry { /// /// パッケージ名 /// [XmlAttribute] public string Name; /// /// パッケージのバージョン比較の式 /// [XmlAttribute] public string Flags; /// /// パッケージのバージョン /// public string Version; } public class Installer { /// /// コンストラクタ /// public Installer() { } public Platform Platform; /// /// ダウンロードリソースURLの配列 /// public LocationEntry Url; /// /// ファイル検証用ハッシュ /// [XmlElement] public HashValue[] Hash; } /// /// リソースの位置を示すクラス /// public class LocationEntry { // TODO LocationEntryは果たして必要なのかの、考察 /// /// コンストラクタ /// public LocationEntry() { } /// /// コンストラクタ /// /// リソースのURL public LocationEntry(string sHref) { Href = sHref; } /// /// リソースのURL /// [XmlAttribute] public string Href; } }