public void Install(PackageStatusContext context) { var farmhandBinary = Path.Combine(InstallationContext.OutputPath, "Stardew Farmhand.exe"); var temporaryDirectory = Path.Combine(InstallationContext.OutputPath, "FarmhandInstallTemp"); var workingDirectory = Path.Combine(temporaryDirectory, "WorkingDirectory"); var binDirectory = Path.Combine(temporaryDirectory, "Bin"); context.SetState(10, "Cleaning Output Directory"); DirectoryUtility.EnsureDirectoryExists(InstallationContext.OutputPath); DirectoryUtility.CleanDirectory(InstallationContext.OutputPath); DirectoryUtility.EnsureDirectoryExists(temporaryDirectory); context.SetState(25, "Extracting Package File"); PackageManager.ExtractPackageFile(PackageFile, temporaryDirectory); context.SetState(40, "Copying Stardew Valley Files"); DirectoryUtility.CopyAll(InstallationContext.StardewPath, InstallationContext.OutputPath, ".*\\.exe"); context.SetState(50, "Copying SMAPI Files"); DirectoryUtility.CopyAll(workingDirectory, InstallationContext.OutputPath); StardewPatcher.Patch(farmhandBinary, binDirectory, true, context); context.SetState(100, "Deleting Temporary Directory"); Directory.Delete(temporaryDirectory, true); }
public void Install(PackageStatusContext context) { var workingDir = Path.Combine(InstallationContext.OutputPath, "WorkingDirectory"); var farmhandBinary = Path.Combine(workingDir, "Stardew Farmhand.exe"); var assemblyDirectory = Path.Combine(InstallationContext.OutputPath, "Bin"); context.SetState(10, "Cleaning Output Directory"); DirectoryUtility.EnsureDirectoryExists(InstallationContext.OutputPath); DirectoryUtility.CleanDirectory(InstallationContext.OutputPath); PackageManager.ExtractPackageFile(PackageFile, InstallationContext.OutputPath); this.EditSolution(context); context.SetState(50, "Copying SMAPI Files"); DirectoryUtility.CopyAll(InstallationContext.StardewPath, workingDir, ".*\\.exe"); StardewPatcher.Patch(farmhandBinary, assemblyDirectory, true, context); }