public void InstallFile(string gamePath, string filePath, LeagueDeployRules deployRules) { FileInfo fileToInstall = new FileInfo(filePath); if (!fileToInstall.Exists) { throw new FileToInstallNotFoundException(); } // Getting the matching file entry (null if new file) and finding the deploy mode to use ReleaseManifest.ReleaseManifestFileEntry fileEntry = this.GameManifest.GetFile(gamePath, false); ReleaseManifest.DeployMode deployMode = deployRules.GetTargetDeployMode(this.Project.Name, fileEntry); // Installing file string installPath = this.GetFileToInstallPath(gamePath, deployMode, LeagueInstallation.FantomeFilesVersion); Directory.CreateDirectory(Path.GetDirectoryName(installPath)); if ((fileEntry != null) && deployMode == ReleaseManifest.DeployMode.Deployed) { // Backup deployed file BackupFile(fileEntry, installPath); } File.Copy(filePath, installPath, true); // Setting manifest values if (fileEntry == null) { fileEntry = this.GameManifest.GetFile(gamePath, true); } fileEntry.DeployMode = deployMode; fileEntry.SizeRaw = (int)fileToInstall.Length; fileEntry.SizeCompressed = fileEntry.SizeRaw; fileEntry.Version = LeagueInstallation.FantomeFilesVersion; this.HasChanged = true; }
public LeagueManager(string gamePath) { this.Installation = new LeagueInstallation(gamePath); this.Installation.LoadOriginalManifests(); this.DeployRules = new LeagueDeployRules(LeagueFileDeployMode.Managed); }