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;
            }
 private string GetFileToInstallPath(string fileFullPath, ReleaseManifest.DeployMode deployMode, uint version)
 {
     if (deployMode == ReleaseManifest.DeployMode.Managed)
     {
         return(String.Format("{0}/managedfiles/{1}/{2}", this.Project.GetFolder(), LeagueInstallation.GetReleaseString(version), fileFullPath));
     }
     else if (deployMode == ReleaseManifest.DeployMode.Deployed)
     {
         return(String.Format("{0}/releases/{1}/deploy/{2}", this.Project.GetFolder(), this.Version, fileFullPath));
     }
     else
     {
         throw new UnsupportedDeployModeException();
     }
 }