コード例 #1
0
        /// <exception cref = "ArgumentException">An argument is empty</exception>
        public SimplePatchTool(string rootPath, string versionInfoURL)
        {
            rootPath       = rootPath.Trim();
            versionInfoURL = versionInfoURL.Trim();

            if (string.IsNullOrEmpty(rootPath))
            {
                throw new ArgumentException(Localization.Get(StringId.E_XCanNotBeEmpty, "'rootPath'"));
            }

            if (string.IsNullOrEmpty(versionInfoURL))
            {
                throw new ArgumentException(Localization.Get(StringId.E_XCanNotBeEmpty, "'versionInfoURL'"));
            }

            comms = new PatchIntercomms(this, PatchUtils.GetPathWithTrailingSeparatorChar(rootPath));
            this.versionInfoURL = versionInfoURL;

            canIncrementalPatch = true;
            canRepair           = true;

            incrementalPatches     = new List <IncrementalPatch>();
            incrementalPatchesInfo = new List <PatchInfo>();
            filesInVersion         = new HashSet <string>();

            UseCustomDownloadHandler(null);
            UseCustomFreeSpaceCalculator(null);

            IsRunning = false;
            Result    = PatchResult.Failed;
        }
コード例 #2
0
        public IncrementalPatchApplier(PatchIntercomms comms, PatchInfo patchInfo)
        {
            this.comms     = comms;
            this.patchInfo = patchInfo;

            string patchVersion = patchInfo.PatchVersion();

            patchDownloadPath   = comms.GetDownloadPathForPatch(patchVersion);
            patchDecompressPath = comms.GetDecompressPathForPatch(patchVersion);
        }
コード例 #3
0
        /// <exception cref = "ArgumentException">An argument is empty</exception>
        public SimplePatchTool(string rootPath, string versionInfoURL)
        {
            rootPath       = rootPath.Trim();
            versionInfoURL = versionInfoURL.Trim();

            if (string.IsNullOrEmpty(rootPath))
            {
                throw new ArgumentException(Localization.Get(StringId.E_XCanNotBeEmpty, "'rootPath'"));
            }

            if (string.IsNullOrEmpty(versionInfoURL))
            {
                throw new ArgumentException(Localization.Get(StringId.E_XCanNotBeEmpty, "'versionInfoURL'"));
            }

            Localization.Get(StringId.Done);               // Force the localization system to be initialized with the current culture/language

            for (int i = 0; i < ROOT_PATH_PLACEHOLDERS.Length; i++)
            {
                if (rootPath.IndexOf(ROOT_PATH_PLACEHOLDERS[i]) >= 0)
                {
                    rootPath.Replace(ROOT_PATH_PLACEHOLDERS[i], Path.GetDirectoryName(PatchUtils.GetCurrentExecutablePath()));
                }
            }

            comms = new PatchIntercomms(this, PatchUtils.GetPathWithTrailingSeparatorChar(rootPath));
            this.versionInfoURL = versionInfoURL;

            canRepairPatch      = true;
            canIncrementalPatch = true;
            canInstallerPatch   = true;

            checkForMultipleRunningInstances = true;

            incrementalPatches     = new List <IncrementalPatch>();
            incrementalPatchesInfo = new List <IncrementalPatchInfo>();
            filesInVersion         = new HashSet <string>();

            UseCustomDownloadHandler(null);
            UseCustomFreeSpaceCalculator(null);

            IsRunning   = false;
            Operation   = PatchOperation.CheckingForUpdates;
            PatchMethod = PatchMethod.None;
            Result      = PatchResult.Failed;
        }
コード例 #4
0
 public RepairPatchApplier(PatchIntercomms comms) : base(comms)
 {
 }
コード例 #5
0
 public RepairApplier(PatchIntercomms comms)
 {
     this.comms = comms;
 }
コード例 #6
0
 public PatchDownloadManager(PatchIntercomms comms)
 {
     this.comms = comms;
 }
コード例 #7
0
 public InstallerPatchApplier(PatchIntercomms comms) : base(comms)
 {
 }
コード例 #8
0
 public IncrementalPatchApplier(PatchIntercomms comms, IncrementalPatchInfo patchInfo) : base(comms)
 {
     this.patchInfo = patchInfo;
 }