Skip to content

Commit

Permalink
Add more debug lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Dyvinia committed Feb 15, 2023
1 parent 2ebe824 commit f8d12fc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
31 changes: 17 additions & 14 deletions DatapathFix/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ static void Main(string[] args) {

// EA Desktop will always launch without arguments
if (args.Length == 0) {
try
{
try {
File.Move(currentPath, currentPath.Replace(".exe", ".old"));
File.Move(origPath, currentPath);
}
catch (IOException e)
{
Process.Start(new ProcessStartInfo
{
catch (IOException e) {
Console.WriteLine($"Error While Launching: Unable to Move Files");
Console.WriteLine(e);
Console.WriteLine($"Restarting as Administrator...");
AnyKeyToContinue();

Process.Start(new ProcessStartInfo {
FileName = currentPath,
Arguments = BuildArgs(args),
UseShellExecute = true,
Expand All @@ -35,14 +37,16 @@ static void Main(string[] args) {
// Old games require .par file with same name
string parPath = origPath.Replace(".exe", ".par");
if (File.Exists(parPath)) {
try
{
try {
File.Delete(parPath);
}
catch (IOException e)
{
Process.Start(new ProcessStartInfo
{
catch (IOException e) {
Console.WriteLine($"Error While Launching: Unable to Delete File");
Console.WriteLine(e);
Console.WriteLine($"Restarting as Administrator...");
AnyKeyToContinue();

Process.Start(new ProcessStartInfo {
FileName = currentPath,
Arguments = BuildArgs(args),
UseShellExecute = true,
Expand Down Expand Up @@ -110,8 +114,7 @@ void AnyKeyToContinue() {
static string BuildArgs(string[] args)
{
StringBuilder sb = new StringBuilder();
foreach (string arg in args)
{
foreach (string arg in args) {
sb.Append(arg + " ");
}
return sb.ToString();
Expand Down
4 changes: 2 additions & 2 deletions DatapathFix/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Dyvinia")]
[assembly: AssemblyProduct("DatapathFix")]
[assembly: AssemblyCopyright("Copyright © Dyvinia 2022")]
[assembly: AssemblyCopyright("Copyright © Dyvinia 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -35,4 +35,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0")]
[assembly: AssemblyVersion("1.5.0")]
2 changes: 1 addition & 1 deletion DatapathFixPlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

[assembly: PluginDisplayName("DatapathFix")]
[assembly: PluginAuthor("Dyvinia")]
[assembly: PluginVersion("1.4.0")]
[assembly: PluginVersion("1.5.0")]

[assembly: RegisterOptionsExtension(typeof(LaunchOptions), PluginManagerType.Both)]
[assembly: RegisterExecutionAction(typeof(LaunchExecutionAction))]

0 comments on commit f8d12fc

Please sign in to comment.