summaryrefslogtreecommitdiff
path: root/src/SMAPI.Installer/InteractiveInstaller.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-11-18 00:51:30 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-11-18 00:51:30 -0500
commit48b9acb074967b03bdacff1fc357d4c8801ec1d6 (patch)
tree0d4f71feae4bd9aa9f7d1db88ee97d766a3c2e3c /src/SMAPI.Installer/InteractiveInstaller.cs
parente5bc00e7a25a98338dd6b3795d6d229a662ab004 (diff)
downloadSMAPI-48b9acb074967b03bdacff1fc357d4c8801ec1d6.tar.gz
SMAPI-48b9acb074967b03bdacff1fc357d4c8801ec1d6.tar.bz2
SMAPI-48b9acb074967b03bdacff1fc357d4c8801ec1d6.zip
add build logic from the custom scripts (#602)
Diffstat (limited to 'src/SMAPI.Installer/InteractiveInstaller.cs')
-rw-r--r--src/SMAPI.Installer/InteractiveInstaller.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/SMAPI.Installer/InteractiveInstaller.cs b/src/SMAPI.Installer/InteractiveInstaller.cs
index 4212418d..d5866c74 100644
--- a/src/SMAPI.Installer/InteractiveInstaller.cs
+++ b/src/SMAPI.Installer/InteractiveInstaller.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
@@ -445,6 +446,8 @@ namespace StardewModdingApi.Installer
if (platform.IsMono())
{
this.PrintDebug("Safely replacing game launcher...");
+
+ // back up & remove current launcher
if (File.Exists(paths.UnixLauncherPath))
{
if (!File.Exists(paths.UnixBackupLauncherPath))
@@ -453,7 +456,20 @@ namespace StardewModdingApi.Installer
this.InteractivelyDelete(paths.UnixLauncherPath);
}
+ // add new launcher
File.Move(paths.UnixSmapiLauncherPath, paths.UnixLauncherPath);
+
+ // mark file executable
+ // (MSBuild doesn't keep permission flags for files zipped in a build task.)
+ new Process
+ {
+ StartInfo = new ProcessStartInfo
+ {
+ FileName = "chmod",
+ Arguments = $"755 \"{paths.UnixLauncherPath}\"",
+ CreateNoWindow = true
+ }
+ }.Start();
}
// create mods directory (if needed)