Hopefully fix #6 and fix #5

This commit is contained in:
Zack Rauen 2019-11-22 22:04:08 -05:00
parent b414c33312
commit 6eac7aae77
7 changed files with 36 additions and 11 deletions

View File

@ -169,6 +169,8 @@
//
this.discordPTB.Anchor = System.Windows.Forms.AnchorStyles.None;
this.discordPTB.AutoSize = true;
this.discordPTB.BoxBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.discordPTB.BoxForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(62)))), ((int)(((byte)(130)))), ((int)(((byte)(229)))));
this.discordPTB.Cursor = System.Windows.Forms.Cursors.Hand;
this.discordPTB.ForeColor = global::BandagedBD.Properties.Settings.Default.TextColor;
this.discordPTB.Location = new System.Drawing.Point(9, 124);
@ -183,6 +185,8 @@
//
this.discordCanary.Anchor = System.Windows.Forms.AnchorStyles.None;
this.discordCanary.AutoSize = true;
this.discordCanary.BoxBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.discordCanary.BoxForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(62)))), ((int)(((byte)(130)))), ((int)(((byte)(229)))));
this.discordCanary.Cursor = System.Windows.Forms.Cursors.Hand;
this.discordCanary.ForeColor = global::BandagedBD.Properties.Settings.Default.TextColor;
this.discordCanary.Location = new System.Drawing.Point(9, 82);
@ -197,6 +201,8 @@
//
this.discordStable.Anchor = System.Windows.Forms.AnchorStyles.None;
this.discordStable.AutoSize = true;
this.discordStable.BoxBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(60)))), ((int)(((byte)(60)))));
this.discordStable.BoxForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(62)))), ((int)(((byte)(130)))), ((int)(((byte)(229)))));
this.discordStable.Cursor = System.Windows.Forms.Cursors.Hand;
this.discordStable.ForeColor = global::BandagedBD.Properties.Settings.Default.TextColor;
this.discordStable.Location = new System.Drawing.Point(9, 41);
@ -209,8 +215,8 @@
//
// DiscordLocator
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.Color.Transparent;
this.Controls.Add(this.titleLabel);
this.Controls.Add(this.browsePTB);

View File

@ -46,6 +46,8 @@ namespace BandagedBD {
this.panelDock.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panelDock.AutoScroll = true;
this.panelDock.AutoScrollMinSize = new System.Drawing.Size(700, 300);
this.panelDock.BackColor = System.Drawing.Color.Transparent;
this.panelDock.Location = new System.Drawing.Point(12, 96);
this.panelDock.Name = "panelDock";
@ -164,7 +166,6 @@ namespace BandagedBD {
this.Controls.Add(this.lblTitle);
this.Controls.Add(this.logo);
this.Controls.Add(this.panelDock);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "FormMain";

View File

@ -27,9 +27,12 @@ namespace BandagedBD.Panels {
string[] paths = Config.pathsToDelete;
int chunk = 80 / paths.Length;
int i = 0;
int newValue = 20;
Utilities.DeleteFolders(paths, (message) => {
Append(message);
pbStatus.Value = (chunk * i + chunk) + 20;
newValue = (chunk * i + chunk) + 20;
if (newValue <= 100) pbStatus.Value = newValue;
else pbStatus.Value = 100;
i++;
});
foreach (var exe in exes) {

View File

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// 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.0.1")]
[assembly: AssemblyFileVersion("1.0.1")]
[assembly: AssemblyVersion("1.0.2")]
[assembly: AssemblyFileVersion("1.0.2")]

View File

@ -114,7 +114,7 @@ namespace BandagedBD.Properties {
}
/// <summary>
/// Looks up a localized string similar to 1.0.1.
/// Looks up a localized string similar to 1.0.2.
/// </summary>
internal static string Version {
get {

View File

@ -204,7 +204,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</value>
</data>
<data name="Version" xml:space="preserve">
<value>1.0.1</value>
<value>1.0.2</value>
</data>
<data name="BBDVS" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@ -18,16 +18,19 @@ namespace BandagedBD {
public static string StablePath => LADPath("Discord");
public static string StablePathPD => PDPath("Discord");
public static string StablePathEXE => GetProcess("Discord");
public static string CanaryPath => LADPath("DiscordCanary");
public static string CanaryPathPD => PDPath("DiscordCanary");
public static string CanaryPathEXE => GetProcess("DiscordCanary");
public static string PtbPath => LADPath("DiscordPTB");
public static string PtbPathPD => PDPath("DiscordPTB");
public static string PtbPathEXE => GetProcess("DiscordPTB");
public static string CurrentStablePath = Directory.Exists(StablePathPD) ? StablePathPD : Directory.Exists(StablePath) ? StablePath : null;
public static string CurrentCanaryPath = Directory.Exists(CanaryPathPD) ? CanaryPathPD : Directory.Exists(CanaryPath) ? CanaryPath : null;
public static string CurrentPtbPath = Directory.Exists(PtbPathPD) ? PtbPathPD : Directory.Exists(PtbPath) ? PtbPath : null;
public static string CurrentStablePath = Directory.Exists(StablePathEXE) ? StablePathEXE : Directory.Exists(StablePathPD) ? StablePathPD : Directory.Exists(StablePath) ? StablePath : null;
public static string CurrentCanaryPath = Directory.Exists(CanaryPathEXE) ? CanaryPathEXE : Directory.Exists(CanaryPathPD) ? CanaryPathPD : Directory.Exists(CanaryPath) ? CanaryPath : null;
public static string CurrentPtbPath = Directory.Exists(PtbPathEXE) ? PtbPathEXE : Directory.Exists(PtbPathPD) ? PtbPathPD : Directory.Exists(PtbPath) ? PtbPath : null;
public static void OpenProcess(string url) {
Process.Start(url);
@ -61,6 +64,18 @@ namespace BandagedBD {
}
}
public static string GetProcess(string processName) {
var currentExecutable = string.Empty;
try {
foreach (var process in Process.GetProcessesByName(processName)) {
currentExecutable = process.MainModule.FileName;
break;
}
}
catch { }
return currentExecutable;
}
public static string KillProcess(string processName, Action<string> onMessage = null) {
return KillProcess(processName, (str, boolean) => {
onMessage?.Invoke(str);