Updated Installer with 2 New options and fixed PTB Installing for latest Build
This commit is contained in:
parent
df542fe3c9
commit
40262cd068
|
@ -9,4 +9,4 @@
|
||||||
</requestedPrivileges>
|
</requestedPrivileges>
|
||||||
</security>
|
</security>
|
||||||
</trustInfo>
|
</trustInfo>
|
||||||
</assembly>
|
</assembly>
|
|
@ -33,7 +33,7 @@
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationIcon>BetterDiscord-icon.ico</ApplicationIcon>
|
<ApplicationIcon>Resources\BetterDiscord-icon.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
<None Include="Resources\bd_logo_large_nobg.png" />
|
<None Include="Resources\bd_logo_large_nobg.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="BetterDiscord-icon.ico" />
|
<Content Include="Resources\BetterDiscord-icon.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
this.tbPath = new BetterDiscordWI.components.CTextBox();
|
this.tbPath = new BetterDiscordWI.components.CTextBox();
|
||||||
this.label3 = new System.Windows.Forms.Label();
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
this.cbRestart = new System.Windows.Forms.CheckBox();
|
this.cbRestart = new System.Windows.Forms.CheckBox();
|
||||||
|
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||||
|
this.checkBox2 = new System.Windows.Forms.CheckBox();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// label1
|
// label1
|
||||||
|
@ -94,10 +96,35 @@
|
||||||
this.cbRestart.Text = "Restart Discord after installation";
|
this.cbRestart.Text = "Restart Discord after installation";
|
||||||
this.cbRestart.UseVisualStyleBackColor = true;
|
this.cbRestart.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
|
// checkBox1
|
||||||
|
//
|
||||||
|
this.checkBox1.AutoSize = true;
|
||||||
|
this.checkBox1.Location = new System.Drawing.Point(23, 140);
|
||||||
|
this.checkBox1.Name = "checkBox1";
|
||||||
|
this.checkBox1.Size = new System.Drawing.Size(137, 17);
|
||||||
|
this.checkBox1.TabIndex = 7;
|
||||||
|
this.checkBox1.Text = "Install to DiscordCanary";
|
||||||
|
this.checkBox1.UseVisualStyleBackColor = true;
|
||||||
|
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
|
||||||
|
//
|
||||||
|
// checkBox2
|
||||||
|
//
|
||||||
|
this.checkBox2.AutoSize = true;
|
||||||
|
this.checkBox2.Location = new System.Drawing.Point(23, 163);
|
||||||
|
this.checkBox2.Name = "checkBox2";
|
||||||
|
this.checkBox2.Size = new System.Drawing.Size(436, 17);
|
||||||
|
this.checkBox2.TabIndex = 8;
|
||||||
|
this.checkBox2.Text = "Install to DiscordPTB (Can break at any time)(Installer will be updated frequentl" +
|
||||||
|
"y for this)";
|
||||||
|
this.checkBox2.UseVisualStyleBackColor = true;
|
||||||
|
this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
|
||||||
|
//
|
||||||
// Panel1
|
// Panel1
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.Controls.Add(this.checkBox2);
|
||||||
|
this.Controls.Add(this.checkBox1);
|
||||||
this.Controls.Add(this.cbRestart);
|
this.Controls.Add(this.cbRestart);
|
||||||
this.Controls.Add(this.label3);
|
this.Controls.Add(this.label3);
|
||||||
this.Controls.Add(this.tbPath);
|
this.Controls.Add(this.tbPath);
|
||||||
|
@ -119,5 +146,7 @@
|
||||||
private System.Windows.Forms.Label label3;
|
private System.Windows.Forms.Label label3;
|
||||||
private System.Windows.Forms.CheckBox cbRestart;
|
private System.Windows.Forms.CheckBox cbRestart;
|
||||||
internal components.CTextBox tbPath;
|
internal components.CTextBox tbPath;
|
||||||
|
private System.Windows.Forms.CheckBox checkBox1;
|
||||||
|
private System.Windows.Forms.CheckBox checkBox2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,5 +69,121 @@ namespace BetterDiscordWI.panels
|
||||||
|
|
||||||
tbPath.Text = fbd.SelectedPath;
|
tbPath.Text = fbd.SelectedPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkBox1_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (checkBox1.Checked == true)
|
||||||
|
{
|
||||||
|
checkBox2.Checked = false;
|
||||||
|
String[] directories = Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\DiscordCanary");
|
||||||
|
|
||||||
|
String highestVersion = null;
|
||||||
|
|
||||||
|
foreach (String s in directories)
|
||||||
|
{
|
||||||
|
Debug.Print(s);
|
||||||
|
if (!s.Contains("app-")) continue;
|
||||||
|
if (String.IsNullOrEmpty(highestVersion))
|
||||||
|
{
|
||||||
|
highestVersion = s;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (String.CompareOrdinal(s, highestVersion) > 0)
|
||||||
|
{
|
||||||
|
highestVersion = s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tbPath.Text = highestVersion;
|
||||||
|
}
|
||||||
|
if (checkBox1.Checked == false)
|
||||||
|
{
|
||||||
|
if (checkBox2.Checked == false)
|
||||||
|
{
|
||||||
|
String[] directories = Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Discord");
|
||||||
|
|
||||||
|
String highestVersion = null;
|
||||||
|
|
||||||
|
foreach (String s in directories)
|
||||||
|
{
|
||||||
|
Debug.Print(s);
|
||||||
|
if (!s.Contains("app-")) continue;
|
||||||
|
if (String.IsNullOrEmpty(highestVersion))
|
||||||
|
{
|
||||||
|
highestVersion = s;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (String.CompareOrdinal(s, highestVersion) > 0)
|
||||||
|
{
|
||||||
|
highestVersion = s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tbPath.Text = highestVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBox2_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (checkBox2.Checked == true)
|
||||||
|
{
|
||||||
|
checkBox1.Checked = false;
|
||||||
|
String[] directories = Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\DiscordPTB");
|
||||||
|
|
||||||
|
String highestVersion = null;
|
||||||
|
|
||||||
|
foreach (String s in directories)
|
||||||
|
{
|
||||||
|
Debug.Print(s);
|
||||||
|
if (!s.Contains("app-")) continue;
|
||||||
|
if (String.IsNullOrEmpty(highestVersion))
|
||||||
|
{
|
||||||
|
highestVersion = s;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (String.CompareOrdinal(s, highestVersion) > 0)
|
||||||
|
{
|
||||||
|
highestVersion = s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tbPath.Text = highestVersion;
|
||||||
|
}
|
||||||
|
if (checkBox2.Checked == false)
|
||||||
|
{
|
||||||
|
if (checkBox1.Checked == false)
|
||||||
|
{
|
||||||
|
String[] directories = Directory.GetDirectories(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Discord");
|
||||||
|
|
||||||
|
String highestVersion = null;
|
||||||
|
|
||||||
|
foreach (String s in directories)
|
||||||
|
{
|
||||||
|
Debug.Print(s);
|
||||||
|
if (!s.Contains("app-")) continue;
|
||||||
|
if (String.IsNullOrEmpty(highestVersion))
|
||||||
|
{
|
||||||
|
highestVersion = s;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (String.CompareOrdinal(s, highestVersion) > 0)
|
||||||
|
{
|
||||||
|
highestVersion = s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tbPath.Text = highestVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,13 +234,13 @@ namespace BetterDiscordWI.panels
|
||||||
}
|
}
|
||||||
if (GetParent().DiscordPath.Contains("DiscordPTB\\"))
|
if (GetParent().DiscordPath.Contains("DiscordPTB\\"))
|
||||||
{
|
{
|
||||||
//"mainWindow = new _browserWindow2"
|
|
||||||
if (line.Contains("var _discord_overlay2"))
|
if (line.Contains("var _discord_overlay2"))
|
||||||
{
|
{
|
||||||
lines.Add(line);
|
lines.Add(line);
|
||||||
lines.Add("var _betterDiscord = require('betterdiscord');");
|
lines.Add("var _betterDiscord = require('betterdiscord');");
|
||||||
}
|
}
|
||||||
else if (line.Contains("mainWindow = new _browserWindow2"))
|
//"mainWindow = new _browserWindow2" was changed in DiscordPTB v0.0.6
|
||||||
|
else if (line.Contains("mainWindow = new _electron.BrowserWindow"))
|
||||||
{
|
{
|
||||||
lines.Add(line);
|
lines.Add(line);
|
||||||
lines.Add(File.ReadAllText("splice"));
|
lines.Add(File.ReadAllText("splice"));
|
||||||
|
|
Loading…
Reference in New Issue