From 20ca6b22ac9dc713080e7782933ac59bda21aace Mon Sep 17 00:00:00 2001 From: Rob Chiocchio Date: Wed, 18 Oct 2017 23:29:00 -0400 Subject: [PATCH] Fixed missing UPK issue Also gave decompress.exe logging --- Patcher/Patcher/MainWindow.xaml.cs | 4 ++-- Patcher/Patcher/main.cs | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Patcher/Patcher/MainWindow.xaml.cs b/Patcher/Patcher/MainWindow.xaml.cs index 6e4e218..61f5e69 100644 --- a/Patcher/Patcher/MainWindow.xaml.cs +++ b/Patcher/Patcher/MainWindow.xaml.cs @@ -22,7 +22,7 @@ public MainWindow() //tGUI.Name = "GUIThread"; } - private void button_Click(object sender, RoutedEventArgs e) // patch borderlands2 + public void button_Click(object sender, RoutedEventArgs e) // patch borderlands2 { buttonPatch.IsEnabled = false; //disable button //main.patch(); //run the patch function @@ -30,7 +30,7 @@ private void button_Click(object sender, RoutedEventArgs e) // patch borderlands Thread patcherThread = new Thread(patcher); patcherThread.SetApartmentState(ApartmentState.STA); patcherThread.Start(); //run the patch function - buttonPatch.IsEnabled = true; //enable button when done + //buttonPatch.IsEnabled = true; //enable button when done } } } diff --git a/Patcher/Patcher/main.cs b/Patcher/Patcher/main.cs index 9a58dd1..30fb57a 100644 --- a/Patcher/Patcher/main.cs +++ b/Patcher/Patcher/main.cs @@ -6,6 +6,7 @@ using System.Threading; using System.Threading.Tasks; using Popup = System.Windows.MessageBox; +using System.Windows.Forms; namespace Patcher { @@ -89,9 +90,9 @@ public static void patch() //the main function // -- DECOMPRESS UPK -- //var decompressing = System.Diagnostics.Process.Start(decompress, "-game=border -out=" + outputDir + @"\\WillowGame\\CookedPCConsole\\ " + iUPK.FullName); //decompress WillowGame.UPK - var decompressing = System.Diagnostics.Process.Start(decompress, "-game=border " + iUPK.FullName); //decompress WillowGame.UPK + var decompressing = System.Diagnostics.Process.Start(decompress, "-game=border -log=decompress.log " + '"' + iUPK.FullName + '"'); //decompress WillowGame.UPK decompressing.WaitForExit(); //wait for decompress.exe to finish - FileInfo decompressedUPK = new FileInfo(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), "unpacked", iUPK.Name)); + FileInfo decompressedUPK = new FileInfo(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), @"unpacked\\", iUPK.Name)); try { decompressedUPK.CopyTo(oUPK.FullName, true); //move upk to cookedpcconsole @@ -149,7 +150,7 @@ public static void patch() //the main function // -- CREATE SHORTCUT -- WshShell shell = new WshShell(); IWshRuntimeLibrary.IWshShortcut shortcut = shell.CreateShortcut( - Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\\Borderlands 2 COOP.lnk") as IWshRuntimeLibrary.IWshShortcut; + Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\\Borderlands 2 COOP.lnk") as IWshShortcut; shortcut.Arguments = "-log -debug -codermode -nosplash"; shortcut.TargetPath = oBL2.FullName; shortcut.WindowStyle = 1;