From f3eaa2b8c1fcf1bbe5617da0e8be4236f5e890ca Mon Sep 17 00:00:00 2001 From: Aaron Maslen Date: Sat, 19 Aug 2023 12:41:10 +1000 Subject: [PATCH 1/3] Convert to SDK-style project and change target framework to .NET 6 --- Wrath2Debug/App.config | 11 --- Wrath2Debug/Wrath2Debug.csproj | 122 ++++++--------------------------- 2 files changed, 21 insertions(+), 112 deletions(-) delete mode 100644 Wrath2Debug/App.config diff --git a/Wrath2Debug/App.config b/Wrath2Debug/App.config deleted file mode 100644 index c4e91cc..0000000 --- a/Wrath2Debug/App.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/Wrath2Debug/Wrath2Debug.csproj b/Wrath2Debug/Wrath2Debug.csproj index 42aed25..8144011 100644 --- a/Wrath2Debug/Wrath2Debug.csproj +++ b/Wrath2Debug/Wrath2Debug.csproj @@ -1,130 +1,46 @@ - - - + - Debug - AnyCPU - {93F9C131-B1D5-4452-BE33-69449453C3D9} + net6-windows WinExe - Wrath2Debug - Wrath2Debug - v4.7.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + false + true + true - - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - - - - - - - - - - - - - - Form - - - StartWarning.cs - - - Form - - - Wrath2Debug.cs - - - - - StartWarning.cs - - - Wrath2Debug.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - + Always - + Always - + Always - + Always - + Always - + Always - + Always - + Always - + Always - + Always - - + Always - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - @@ -291,5 +207,9 @@ Always - + + + + + \ No newline at end of file From ece30dada1e88de2f68f576192515d8b35eef066 Mon Sep 17 00:00:00 2001 From: Aaron Maslen Date: Sat, 19 Aug 2023 13:45:55 +1000 Subject: [PATCH 2/3] Fix StartWarning window size --- Wrath2Debug/StartWarning.Designer.cs | 86 ++++++++++++++-------------- Wrath2Debug/StartWarning.resx | 50 ++++++++-------- 2 files changed, 69 insertions(+), 67 deletions(-) diff --git a/Wrath2Debug/StartWarning.Designer.cs b/Wrath2Debug/StartWarning.Designer.cs index aae186e..9f7fa90 100644 --- a/Wrath2Debug/StartWarning.Designer.cs +++ b/Wrath2Debug/StartWarning.Designer.cs @@ -29,60 +29,62 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.label1 = new System.Windows.Forms.Label(); - this.ProceedButton = new System.Windows.Forms.Button(); - this.WarnCancelButton = new System.Windows.Forms.Button(); - this.SuspendLayout(); + label1 = new System.Windows.Forms.Label(); + ProceedButton = new System.Windows.Forms.Button(); + WarnCancelButton = new System.Windows.Forms.Button(); + SuspendLayout(); // // label1 // - this.label1.AutoSize = true; - this.label1.ForeColor = System.Drawing.Color.Red; - this.label1.Location = new System.Drawing.Point(12, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(501, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Warning: Everything in the debug folder will be deleted. Your mod folder will b" + - "e backed up and restored."; + label1.AutoSize = true; + label1.ForeColor = System.Drawing.Color.Red; + label1.Location = new System.Drawing.Point(14, 10); + label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(562, 15); + label1.TabIndex = 0; + label1.Text = "Warning: Everything in the debug folder will be deleted. Your mod folder will be backed up and restored."; // // ProceedButton // - this.ProceedButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.ProceedButton.Location = new System.Drawing.Point(178, 44); - this.ProceedButton.Name = "ProceedButton"; - this.ProceedButton.Size = new System.Drawing.Size(75, 23); - this.ProceedButton.TabIndex = 1; - this.ProceedButton.Text = "Proceed"; - this.ProceedButton.UseVisualStyleBackColor = true; - this.ProceedButton.Click += new System.EventHandler(this.ProceedButton_Click); + ProceedButton.DialogResult = System.Windows.Forms.DialogResult.OK; + ProceedButton.Location = new System.Drawing.Point(208, 51); + ProceedButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + ProceedButton.Name = "ProceedButton"; + ProceedButton.Size = new System.Drawing.Size(88, 27); + ProceedButton.TabIndex = 1; + ProceedButton.Text = "Proceed"; + ProceedButton.UseVisualStyleBackColor = true; + ProceedButton.Click += ProceedButton_Click; // // WarnCancelButton // - this.WarnCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.WarnCancelButton.Location = new System.Drawing.Point(259, 44); - this.WarnCancelButton.Name = "WarnCancelButton"; - this.WarnCancelButton.Size = new System.Drawing.Size(75, 23); - this.WarnCancelButton.TabIndex = 2; - this.WarnCancelButton.Text = "Cancel"; - this.WarnCancelButton.UseVisualStyleBackColor = true; + WarnCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + WarnCancelButton.Location = new System.Drawing.Point(302, 51); + WarnCancelButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + WarnCancelButton.Name = "WarnCancelButton"; + WarnCancelButton.Size = new System.Drawing.Size(88, 27); + WarnCancelButton.TabIndex = 2; + WarnCancelButton.Text = "Cancel"; + WarnCancelButton.UseVisualStyleBackColor = true; // // StartWarning // - this.AcceptButton = this.ProceedButton; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.WarnCancelButton; - this.ClientSize = new System.Drawing.Size(520, 79); - this.ControlBox = false; - this.Controls.Add(this.WarnCancelButton); - this.Controls.Add(this.ProceedButton); - this.Controls.Add(this.label1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Name = "StartWarning"; - this.Text = "StartWarning"; - this.ResumeLayout(false); - this.PerformLayout(); - + AcceptButton = ProceedButton; + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + CancelButton = WarnCancelButton; + ClientSize = new System.Drawing.Size(607, 91); + ControlBox = false; + Controls.Add(WarnCancelButton); + Controls.Add(ProceedButton); + Controls.Add(label1); + FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + Name = "StartWarning"; + Text = "StartWarning"; + ResumeLayout(false); + PerformLayout(); } #endregion diff --git a/Wrath2Debug/StartWarning.resx b/Wrath2Debug/StartWarning.resx index 1af7de1..af32865 100644 --- a/Wrath2Debug/StartWarning.resx +++ b/Wrath2Debug/StartWarning.resx @@ -1,17 +1,17 @@  - From cb1d916afd9b2874f649961f00dff3697bfb779d Mon Sep 17 00:00:00 2001 From: Aaron Maslen Date: Sat, 19 Aug 2023 13:59:16 +1000 Subject: [PATCH 3/3] Add "Symlink Large Directories" checkbox: Symlinks Bundles, StreamingAssets, and DigitalRewards instead of copying. This significantly reduces the time spent copying if the source or destination folders are not on an SSD --- Wrath2Debug/Wrath2Debug.Designer.cs | 274 +++++++++++++++------------- Wrath2Debug/Wrath2Debug.cs | 47 ++++- Wrath2Debug/Wrath2Debug.resx | 50 ++--- 3 files changed, 217 insertions(+), 154 deletions(-) diff --git a/Wrath2Debug/Wrath2Debug.Designer.cs b/Wrath2Debug/Wrath2Debug.Designer.cs index 9ab6372..0f5a914 100644 --- a/Wrath2Debug/Wrath2Debug.Designer.cs +++ b/Wrath2Debug/Wrath2Debug.Designer.cs @@ -29,175 +29,200 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.VanillaWrathButton = new System.Windows.Forms.Button(); - this.VanillaPath = new System.Windows.Forms.TextBox(); - this.DebugPathButton = new System.Windows.Forms.Button(); - this.DebugPath = new System.Windows.Forms.TextBox(); - this.StartButton = new System.Windows.Forms.Button(); - this.FolderPathWarning = new System.Windows.Forms.Label(); - this.InstallDialog = new System.Windows.Forms.FolderBrowserDialog(); - this.LogBox = new System.Windows.Forms.TextBox(); - this.DotPeekPathButton = new System.Windows.Forms.Button(); - this.DotPeekPath = new System.Windows.Forms.TextBox(); - this.dnSpyPathButton = new System.Windows.Forms.Button(); - this.dnSpyPath = new System.Windows.Forms.TextBox(); - this.UnityPathButton = new System.Windows.Forms.Button(); - this.UnityPath = new System.Windows.Forms.TextBox(); - this.InstallFileDialog = new System.Windows.Forms.OpenFileDialog(); - this.SuspendLayout(); + VanillaWrathButton = new System.Windows.Forms.Button(); + VanillaPath = new System.Windows.Forms.TextBox(); + DebugPathButton = new System.Windows.Forms.Button(); + DebugPath = new System.Windows.Forms.TextBox(); + StartButton = new System.Windows.Forms.Button(); + FolderPathWarning = new System.Windows.Forms.Label(); + InstallDialog = new System.Windows.Forms.FolderBrowserDialog(); + LogBox = new System.Windows.Forms.TextBox(); + DotPeekPathButton = new System.Windows.Forms.Button(); + DotPeekPath = new System.Windows.Forms.TextBox(); + dnSpyPathButton = new System.Windows.Forms.Button(); + dnSpyPath = new System.Windows.Forms.TextBox(); + UnityPathButton = new System.Windows.Forms.Button(); + UnityPath = new System.Windows.Forms.TextBox(); + InstallFileDialog = new System.Windows.Forms.OpenFileDialog(); + SymlinkCheckbox = new System.Windows.Forms.CheckBox(); + SuspendLayout(); // // VanillaWrathButton // - this.VanillaWrathButton.Location = new System.Drawing.Point(16, 22); - this.VanillaWrathButton.Name = "VanillaWrathButton"; - this.VanillaWrathButton.Size = new System.Drawing.Size(131, 23); - this.VanillaWrathButton.TabIndex = 1; - this.VanillaWrathButton.Text = "Release Wrath"; - this.VanillaWrathButton.UseVisualStyleBackColor = true; - this.VanillaWrathButton.Click += new System.EventHandler(this.VanillaWrathButton_Click); + VanillaWrathButton.Location = new System.Drawing.Point(19, 25); + VanillaWrathButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + VanillaWrathButton.Name = "VanillaWrathButton"; + VanillaWrathButton.Size = new System.Drawing.Size(153, 27); + VanillaWrathButton.TabIndex = 1; + VanillaWrathButton.Text = "Release Wrath"; + VanillaWrathButton.UseVisualStyleBackColor = true; + VanillaWrathButton.Click += VanillaWrathButton_Click; // // VanillaPath // - this.VanillaPath.Location = new System.Drawing.Point(153, 25); - this.VanillaPath.Name = "VanillaPath"; - this.VanillaPath.Size = new System.Drawing.Size(562, 20); - this.VanillaPath.TabIndex = 2; - this.VanillaPath.Text = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Pathfinder Second Adventure"; - this.VanillaPath.TextChanged += new System.EventHandler(this.VanillaPath_TextChanged); + VanillaPath.Location = new System.Drawing.Point(178, 29); + VanillaPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + VanillaPath.Name = "VanillaPath"; + VanillaPath.Size = new System.Drawing.Size(655, 23); + VanillaPath.TabIndex = 2; + VanillaPath.Text = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Pathfinder Second Adventure"; + VanillaPath.TextChanged += VanillaPath_TextChanged; // // DebugPathButton // - this.DebugPathButton.Location = new System.Drawing.Point(16, 51); - this.DebugPathButton.Name = "DebugPathButton"; - this.DebugPathButton.Size = new System.Drawing.Size(131, 23); - this.DebugPathButton.TabIndex = 3; - this.DebugPathButton.Text = "Debug Wrath"; - this.DebugPathButton.UseVisualStyleBackColor = true; - this.DebugPathButton.Click += new System.EventHandler(this.DebugPathButton_Click); + DebugPathButton.Location = new System.Drawing.Point(19, 59); + DebugPathButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + DebugPathButton.Name = "DebugPathButton"; + DebugPathButton.Size = new System.Drawing.Size(153, 27); + DebugPathButton.TabIndex = 3; + DebugPathButton.Text = "Debug Wrath"; + DebugPathButton.UseVisualStyleBackColor = true; + DebugPathButton.Click += DebugPathButton_Click; // // DebugPath // - this.DebugPath.Location = new System.Drawing.Point(153, 54); - this.DebugPath.Name = "DebugPath"; - this.DebugPath.Size = new System.Drawing.Size(562, 20); - this.DebugPath.TabIndex = 4; - this.DebugPath.Text = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Pathfinder Second Adventure Debug"; - this.DebugPath.TextChanged += new System.EventHandler(this.DebugPath_TextChanged); + DebugPath.Location = new System.Drawing.Point(178, 62); + DebugPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + DebugPath.Name = "DebugPath"; + DebugPath.Size = new System.Drawing.Size(655, 23); + DebugPath.TabIndex = 4; + DebugPath.Text = "C:\\Program Files (x86)\\Steam\\steamapps\\common\\Pathfinder Second Adventure Debug"; + DebugPath.TextChanged += DebugPath_TextChanged; // // StartButton // - this.StartButton.Location = new System.Drawing.Point(326, 167); - this.StartButton.Name = "StartButton"; - this.StartButton.Size = new System.Drawing.Size(75, 23); - this.StartButton.TabIndex = 11; - this.StartButton.Text = "Start Conversion"; - this.StartButton.UseVisualStyleBackColor = true; - this.StartButton.Click += new System.EventHandler(this.StartButton_Click); + StartButton.Location = new System.Drawing.Point(380, 193); + StartButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + StartButton.Name = "StartButton"; + StartButton.Size = new System.Drawing.Size(88, 27); + StartButton.TabIndex = 11; + StartButton.Text = "Start Conversion"; + StartButton.UseVisualStyleBackColor = true; + StartButton.Click += StartButton_Click; // // FolderPathWarning // - this.FolderPathWarning.AutoSize = true; - this.FolderPathWarning.Location = new System.Drawing.Point(13, 9); - this.FolderPathWarning.Name = "FolderPathWarning"; - this.FolderPathWarning.Size = new System.Drawing.Size(255, 13); - this.FolderPathWarning.TabIndex = 8; - this.FolderPathWarning.Text = "If file path is red it means the folder path is not found."; + FolderPathWarning.AutoSize = true; + FolderPathWarning.Location = new System.Drawing.Point(15, 10); + FolderPathWarning.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + FolderPathWarning.Name = "FolderPathWarning"; + FolderPathWarning.Size = new System.Drawing.Size(290, 15); + FolderPathWarning.TabIndex = 8; + FolderPathWarning.Text = "If file path is red it means the folder path is not found."; // // LogBox // - this.LogBox.Location = new System.Drawing.Point(16, 199); - this.LogBox.Multiline = true; - this.LogBox.Name = "LogBox"; - this.LogBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.LogBox.Size = new System.Drawing.Size(699, 328); - this.LogBox.TabIndex = 12; + LogBox.Location = new System.Drawing.Point(19, 230); + LogBox.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + LogBox.Multiline = true; + LogBox.Name = "LogBox"; + LogBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + LogBox.Size = new System.Drawing.Size(815, 378); + LogBox.TabIndex = 12; // // DotPeekPathButton // - this.DotPeekPathButton.Location = new System.Drawing.Point(16, 109); - this.DotPeekPathButton.Name = "DotPeekPathButton"; - this.DotPeekPathButton.Size = new System.Drawing.Size(131, 23); - this.DotPeekPathButton.TabIndex = 7; - this.DotPeekPathButton.Text = "DotPeek Path"; - this.DotPeekPathButton.UseVisualStyleBackColor = true; - this.DotPeekPathButton.Click += new System.EventHandler(this.DotPeekPathButton_Click); + DotPeekPathButton.Location = new System.Drawing.Point(19, 126); + DotPeekPathButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + DotPeekPathButton.Name = "DotPeekPathButton"; + DotPeekPathButton.Size = new System.Drawing.Size(153, 27); + DotPeekPathButton.TabIndex = 7; + DotPeekPathButton.Text = "DotPeek Path"; + DotPeekPathButton.UseVisualStyleBackColor = true; + DotPeekPathButton.Click += DotPeekPathButton_Click; // // DotPeekPath // - this.DotPeekPath.Location = new System.Drawing.Point(153, 112); - this.DotPeekPath.Name = "DotPeekPath"; - this.DotPeekPath.Size = new System.Drawing.Size(562, 20); - this.DotPeekPath.TabIndex = 8; - this.DotPeekPath.Text = "\\AppData\\Local\\JetBrains\\Installations\\dotPeek231\\dotPeek64.exe"; - this.DotPeekPath.TextChanged += new System.EventHandler(this.DotPeekPath_TextChanged); + DotPeekPath.Location = new System.Drawing.Point(178, 129); + DotPeekPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + DotPeekPath.Name = "DotPeekPath"; + DotPeekPath.Size = new System.Drawing.Size(655, 23); + DotPeekPath.TabIndex = 8; + DotPeekPath.Text = "\\AppData\\Local\\JetBrains\\Installations\\dotPeek231\\dotPeek64.exe"; + DotPeekPath.TextChanged += DotPeekPath_TextChanged; // // dnSpyPathButton // - this.dnSpyPathButton.Location = new System.Drawing.Point(16, 138); - this.dnSpyPathButton.Name = "dnSpyPathButton"; - this.dnSpyPathButton.Size = new System.Drawing.Size(131, 23); - this.dnSpyPathButton.TabIndex = 9; - this.dnSpyPathButton.Text = "dnSpy Path"; - this.dnSpyPathButton.UseVisualStyleBackColor = true; - this.dnSpyPathButton.Click += new System.EventHandler(this.dnSpyPathButton_Click); + dnSpyPathButton.Location = new System.Drawing.Point(19, 159); + dnSpyPathButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + dnSpyPathButton.Name = "dnSpyPathButton"; + dnSpyPathButton.Size = new System.Drawing.Size(153, 27); + dnSpyPathButton.TabIndex = 9; + dnSpyPathButton.Text = "dnSpy Path"; + dnSpyPathButton.UseVisualStyleBackColor = true; + dnSpyPathButton.Click += dnSpyPathButton_Click; // // dnSpyPath // - this.dnSpyPath.Location = new System.Drawing.Point(153, 141); - this.dnSpyPath.Name = "dnSpyPath"; - this.dnSpyPath.Size = new System.Drawing.Size(562, 20); - this.dnSpyPath.TabIndex = 10; - this.dnSpyPath.Text = "Path to dnSpy..."; - this.dnSpyPath.TextChanged += new System.EventHandler(this.dnSpyPath_TextChanged); + dnSpyPath.Location = new System.Drawing.Point(178, 163); + dnSpyPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + dnSpyPath.Name = "dnSpyPath"; + dnSpyPath.Size = new System.Drawing.Size(655, 23); + dnSpyPath.TabIndex = 10; + dnSpyPath.Text = "Path to dnSpy..."; + dnSpyPath.TextChanged += dnSpyPath_TextChanged; // // UnityPathButton // - this.UnityPathButton.Location = new System.Drawing.Point(16, 80); - this.UnityPathButton.Name = "UnityPathButton"; - this.UnityPathButton.Size = new System.Drawing.Size(131, 23); - this.UnityPathButton.TabIndex = 5; - this.UnityPathButton.Text = "Unity Path"; - this.UnityPathButton.UseVisualStyleBackColor = true; - this.UnityPathButton.Click += new System.EventHandler(this.UnityPathButton_Click); + UnityPathButton.Location = new System.Drawing.Point(19, 92); + UnityPathButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + UnityPathButton.Name = "UnityPathButton"; + UnityPathButton.Size = new System.Drawing.Size(153, 27); + UnityPathButton.TabIndex = 5; + UnityPathButton.Text = "Unity Path"; + UnityPathButton.UseVisualStyleBackColor = true; + UnityPathButton.Click += UnityPathButton_Click; // // UnityPath // - this.UnityPath.Location = new System.Drawing.Point(153, 83); - this.UnityPath.Name = "UnityPath"; - this.UnityPath.Size = new System.Drawing.Size(562, 20); - this.UnityPath.TabIndex = 6; - this.UnityPath.Text = "C:\\Program Files\\Unity\\Hub\\Editor\\2020.3.48f1"; - this.UnityPath.TextChanged += new System.EventHandler(this.UnityPath_TextChanged); + UnityPath.Location = new System.Drawing.Point(178, 96); + UnityPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + UnityPath.Name = "UnityPath"; + UnityPath.Size = new System.Drawing.Size(655, 23); + UnityPath.TabIndex = 6; + UnityPath.Text = "C:\\Program Files\\Unity\\Hub\\Editor\\2020.3.48f1"; + UnityPath.TextChanged += UnityPath_TextChanged; // // InstallFileDialog // - this.InstallFileDialog.ValidateNames = false; + InstallFileDialog.ValidateNames = false; + // + // SymlinkCheckbox + // + SymlinkCheckbox.AutoSize = true; + SymlinkCheckbox.Location = new System.Drawing.Point(19, 198); + SymlinkCheckbox.Name = "SymlinkCheckbox"; + SymlinkCheckbox.Size = new System.Drawing.Size(159, 19); + SymlinkCheckbox.TabIndex = 13; + SymlinkCheckbox.Text = "Symlink Large Directories"; + SymlinkCheckbox.UseVisualStyleBackColor = true; // // Wrath2Debug // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(727, 535); - this.Controls.Add(this.UnityPath); - this.Controls.Add(this.UnityPathButton); - this.Controls.Add(this.LogBox); - this.Controls.Add(this.FolderPathWarning); - this.Controls.Add(this.StartButton); - this.Controls.Add(this.dnSpyPath); - this.Controls.Add(this.DotPeekPath); - this.Controls.Add(this.DebugPath); - this.Controls.Add(this.dnSpyPathButton); - this.Controls.Add(this.DotPeekPathButton); - this.Controls.Add(this.DebugPathButton); - this.Controls.Add(this.VanillaPath); - this.Controls.Add(this.VanillaWrathButton); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; - this.Name = "Wrath2Debug"; - this.Text = "Wrath2Debug"; - this.Load += new System.EventHandler(this.Wrath2Debug_Load); - this.ResumeLayout(false); - this.PerformLayout(); - + AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + ClientSize = new System.Drawing.Size(848, 617); + Controls.Add(SymlinkCheckbox); + Controls.Add(UnityPath); + Controls.Add(UnityPathButton); + Controls.Add(LogBox); + Controls.Add(FolderPathWarning); + Controls.Add(StartButton); + Controls.Add(dnSpyPath); + Controls.Add(DotPeekPath); + Controls.Add(DebugPath); + Controls.Add(dnSpyPathButton); + Controls.Add(DotPeekPathButton); + Controls.Add(DebugPathButton); + Controls.Add(VanillaPath); + Controls.Add(VanillaWrathButton); + FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + Name = "Wrath2Debug"; + Text = "Wrath2Debug"; + Load += Wrath2Debug_Load; + ResumeLayout(false); + PerformLayout(); } #endregion @@ -216,6 +241,7 @@ private void InitializeComponent() private System.Windows.Forms.Button UnityPathButton; private System.Windows.Forms.TextBox UnityPath; private System.Windows.Forms.OpenFileDialog InstallFileDialog; + private System.Windows.Forms.CheckBox SymlinkCheckbox; } } diff --git a/Wrath2Debug/Wrath2Debug.cs b/Wrath2Debug/Wrath2Debug.cs index cfdf71f..e7552a7 100644 --- a/Wrath2Debug/Wrath2Debug.cs +++ b/Wrath2Debug/Wrath2Debug.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.Drawing; using System.IO; +using System.Linq; using System.Windows.Forms; namespace Wrath2Debug @@ -185,7 +186,7 @@ private void StartButton_Click(object sender, EventArgs e) Directory.CreateDirectory(DebugPath.Text); LogBox.AppendText("Cloning Vanilla Copy: This will take a while." + Environment.NewLine); - CopyFilesRecursively(VanillaPath.Text, DebugPath.Text); + CopyFilesRecursively(VanillaPath.Text, DebugPath.Text, SymlinkCheckbox.Checked); if (Directory.Exists($".\\Mods")) { @@ -261,21 +262,57 @@ private void StartButton_Click(object sender, EventArgs e) } } - private static void CopyFilesRecursively(string sourcePath, string targetPath) + static readonly string[] SymlinkFolderNames = new string[] + { + @"Bundles", + @"Wrath_Data\StreamingAssets", + @"DigitalRewards" + }; + + static IEnumerable GetSymlinkFolders(string basePath) => SymlinkFolderNames.Select(n => Path.Join(basePath, n)); + + static IEnumerable GetParentDirectories(string path) + { + var parent = Path.GetDirectoryName(path); + + if (parent is null) yield break; + + yield return parent; + + foreach (var ancestor in GetParentDirectories(parent)) + yield return ancestor; + } + + private static void CopyFilesRecursively(string sourcePath, string targetPath, bool symlink = false) { //Now Create all of the directories foreach (string dirPath in Directory.GetDirectories(sourcePath, "*", SearchOption.AllDirectories)) { - Directory.CreateDirectory(@"\\?\" + dirPath.Replace(sourcePath, targetPath)); + var path = @"\\?\" + dirPath.Replace(sourcePath, targetPath); + + if (symlink) + { + if (GetSymlinkFolders(sourcePath).Contains(dirPath)) + { + Directory.CreateSymbolicLink(path, dirPath); + continue; + } + + if (GetSymlinkFolders(sourcePath).Any(symlinkPath => GetParentDirectories(dirPath).Contains(symlinkPath))) + continue; + } + + Directory.CreateDirectory(path); } //Copy all the files & Replaces any files with the same name foreach (string newPath in Directory.GetFiles(sourcePath, "*.*", SearchOption.AllDirectories)) { + if (symlink && GetSymlinkFolders(sourcePath).Any(symlinkPath => GetParentDirectories(newPath).Contains(symlinkPath))) + continue; + File.Copy(newPath, newPath.Replace(sourcePath, targetPath), true); } } - - } } diff --git a/Wrath2Debug/Wrath2Debug.resx b/Wrath2Debug/Wrath2Debug.resx index ac92618..f3f7bd4 100644 --- a/Wrath2Debug/Wrath2Debug.resx +++ b/Wrath2Debug/Wrath2Debug.resx @@ -1,17 +1,17 @@  -