Browse Source

Attempt to make more robust.

tags/3.1a
Eusth 7 years ago
parent
commit
a0e2310b8a
2 changed files with 14 additions and 2 deletions
  1. +3
    -0
      IPA/PatchContext.cs
  2. +11
    -2
      IPA/Program.cs

+ 3
- 0
IPA/PatchContext.cs View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;

namespace IPA
@@ -28,6 +29,7 @@ namespace IPA
public string ProjectRoot { get; private set; }
public string IPARoot { get; private set; }
public string ShortcutPath { get; private set; }
public string IPA { get; private set; }

private PatchContext() { }

@@ -39,6 +41,7 @@ namespace IPA
context.Executable = args[0];
context.ProjectRoot = Path.GetDirectoryName(context.Executable);
context.IPARoot = Path.Combine(context.ProjectRoot, "IPA");
context.IPA = Assembly.GetExecutingAssembly().Location ?? Path.Combine(context.ProjectRoot, "IPA.exe");
context.LauncherPathSrc = Path.Combine(context.IPARoot, "Launcher.exe");
context.DataPathSrc = Path.Combine(context.IPARoot, "Data");
context.PluginsFolder = Path.Combine(context.ProjectRoot, "Plugins");


+ 11
- 2
IPA/Program.cs View File

@@ -92,8 +92,17 @@ namespace IPA
// Creating shortcut
if(!File.Exists(context.ShortcutPath))
{
Console.Write("Creating shortcut... ");
Shortcut.Create(context.ShortcutPath, Assembly.GetExecutingAssembly().Location, Args(context.Executable, "--launch"), context.ProjectRoot, "Launches the game and makes sure it's in a patched state", "", context.Executable);
Console.Write("Creating shortcut to IPA ({0})... ", context.IPA);
Shortcut.Create(
fileName: context.ShortcutPath,
targetPath: context.IPA,
arguments: Args(context.Executable, "--launch"),
workingDirectory: context.ProjectRoot,
description: "Launches the game and makes sure it's in a patched state",
hotkey: "",
iconPath: context.Executable
);
Console.WriteLine("Created");
}
}


Loading…
Cancel
Save