using System; using System.IO; namespace NaGet { /// /// 環境変数などを取り扱うクラス /// public sealed class Env { /// /// 呼び出し禁止 /// private Env() { } /// /// ファイルリスト提供サーバのリストファイル /// public static readonly string ProviderListFile = "provider.list.txt"; /// /// ファイルリストから読み込まれたパッケージのリストファイル /// public static readonly string PackageListFile = "packages.list.xml"; /// /// 本ソフトウェアを介してインストールされたパッケージのリストファイル /// public static readonly string ArchiveInstalledPackageListFile = "packages.envinstalled.xml"; /// /// システムから検出されたパッケージのリストファイル /// public static readonly string SystemInstalledPackageListFile = "packages.sysinstalled.xml"; /// /// インストールログファイル /// public static readonly string SystemInstalledPackageLogFile = "packages.sysinstalled.log.xml"; private static string appDataFolderPath = null; /// /// アプリケーションデータを保存するフォルダのパス /// public static string AppDataFolderPath { get { if (appDataFolderPath == null) { // string progFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); // if (Path.GetDirectoryName(Environment.CurrentDirectory) == progFiles) { // string appData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); // return Path.Combine(appData, "AppliStation"); // } else { return Environment.CurrentDirectory; // } } else { return appDataFolderPath; } } set { appDataFolderPath = value; } } /// /// インストーラの一時置き場の親ディレクトリ /// public static string ArchiveFolderPath { get { return Path.Combine(AppDataFolderPath, "Cache"); } } /// /// アーカイバ方式のパッケージのインストール先フォルダ /// public static string ArchiveProgramFiles { get { return Path.Combine(AppDataFolderPath, "progs"); } } /// /// アーカイバ方式のパッケージのプログラムグループフォルダ /// public static string ArchiveProgramGroup { get { return Path.Combine(AppDataFolderPath, "programs"); } } /// /// アーカイバ方式のパッケージのSystem32のフォルダ /// public static string ArchiveSystem32 { get { return Path.Combine(ArchiveProgramFiles, ".system32"); } } } }