Skip to content

Commit

Permalink
Fixed missing UPK issue
Browse files Browse the repository at this point in the history
Also gave decompress.exe logging
  • Loading branch information
RobethX committed Oct 19, 2017
1 parent d4d3e80 commit 20ca6b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Patcher/Patcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ 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
ThreadStart patcher = new ThreadStart(main.patch);
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
}
}
}
7 changes: 4 additions & 3 deletions Patcher/Patcher/main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Threading;
using System.Threading.Tasks;
using Popup = System.Windows.MessageBox;
using System.Windows.Forms;

namespace Patcher
{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 20ca6b2

Please sign in to comment.