commit
288b401b26
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
|
||||||
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="BetterDiscord Installer"/>
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
</assembly>
|
Binary file not shown.
After Width: | Height: | Size: 170 KiB |
|
@ -32,9 +32,16 @@
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationIcon>BetterDiscord-icon.ico</ApplicationIcon>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup />
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationManifest>App.manifest</ApplicationManifest>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="asardotnet">
|
<Reference Include="asardotnet">
|
||||||
<HintPath>..\..\..\..\..\VSProjects\asardotnet\asardotnet\bin\Release\asardotnet.dll</HintPath>
|
<HintPath>bin\dlls\asardotnet.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
@ -109,6 +116,7 @@
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<None Include="App.manifest" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
@ -135,6 +143,9 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Resources\bd_logo_large_nobg.png" />
|
<None Include="Resources\bd_logo_large_nobg.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="BetterDiscord-icon.ico" />
|
||||||
|
</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.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|
|
@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("Jiiks")]
|
[assembly: AssemblyCompany("Jiiks")]
|
||||||
[assembly: AssemblyProduct("BetterDiscordWI")]
|
[assembly: AssemblyProduct("BetterDiscordWI")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
[assembly: AssemblyCopyright("Copyright © 2015-2016")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.2.0.0")]
|
[assembly: AssemblyVersion("0.2.6.0")]
|
||||||
[assembly: AssemblyFileVersion("0.2.0.0")]
|
[assembly: AssemblyFileVersion("0.2.6.0")]
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 170 KiB |
|
@ -116,8 +116,8 @@
|
||||||
private System.Windows.Forms.Label label1;
|
private System.Windows.Forms.Label label1;
|
||||||
private System.Windows.Forms.Button btnBrowser;
|
private System.Windows.Forms.Button btnBrowser;
|
||||||
private System.Windows.Forms.Label label2;
|
private System.Windows.Forms.Label label2;
|
||||||
private components.CTextBox tbPath;
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ namespace BetterDiscordWI.panels
|
||||||
{
|
{
|
||||||
public partial class Panel2 : UserControl, IPanel
|
public partial class Panel2 : UserControl, IPanel
|
||||||
{
|
{
|
||||||
|
|
||||||
private String _dataPath, _tempPath;
|
private String _dataPath, _tempPath;
|
||||||
private Utils _utils;
|
private Utils _utils;
|
||||||
|
|
||||||
|
@ -31,12 +30,30 @@ namespace BetterDiscordWI.panels
|
||||||
GetParent().btnCancel.Enabled = false;
|
GetParent().btnCancel.Enabled = false;
|
||||||
|
|
||||||
_utils = new Utils();
|
_utils = new Utils();
|
||||||
|
if (GetParent().DiscordPath.Contains("Discord\\"))
|
||||||
|
{
|
||||||
AppendLog("Killing Discord");
|
AppendLog("Killing Discord");
|
||||||
foreach (var process in Process.GetProcessesByName("Discord"))
|
foreach (var process in Process.GetProcessesByName("Discord"))
|
||||||
{
|
{
|
||||||
process.Kill();
|
process.Kill();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (GetParent().DiscordPath.Contains("DiscordCanary\\"))
|
||||||
|
{
|
||||||
|
AppendLog("Killing DiscordCanary");
|
||||||
|
foreach (var process in Process.GetProcessesByName("DiscordCanary"))
|
||||||
|
{
|
||||||
|
process.Kill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (GetParent().DiscordPath.Contains("DiscordPTB\\"))
|
||||||
|
{
|
||||||
|
AppendLog("Killing DiscordPTB");
|
||||||
|
foreach (var process in Process.GetProcessesByName("DiscordPTB"))
|
||||||
|
{
|
||||||
|
process.Kill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CreateDirectories();
|
CreateDirectories();
|
||||||
}
|
}
|
||||||
|
@ -88,15 +105,25 @@ namespace BetterDiscordWI.panels
|
||||||
|
|
||||||
private void DeleteDirs()
|
private void DeleteDirs()
|
||||||
{
|
{
|
||||||
|
int errors = 0;
|
||||||
Thread t = new Thread(() =>
|
Thread t = new Thread(() =>
|
||||||
{
|
{
|
||||||
String dir = GetParent().DiscordPath + "\\resources\\app";
|
String dir = GetParent().DiscordPath + "\\resources\\app";
|
||||||
|
|
||||||
if (Directory.Exists(dir))
|
if (Directory.Exists(dir))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
AppendLog("Deleting " + dir);
|
AppendLog("Deleting " + dir);
|
||||||
Directory.Delete(dir, true);
|
Directory.Delete(dir, true);
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
AppendLog("Error Failed to Delete the '" + dir + "\\resources\\app' Directory.");
|
||||||
|
errors = 1;
|
||||||
|
Finalize(errors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while (Directory.Exists(dir))
|
while (Directory.Exists(dir))
|
||||||
{
|
{
|
||||||
|
@ -123,14 +150,22 @@ namespace BetterDiscordWI.panels
|
||||||
|
|
||||||
Directory.Move(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BetterDiscord\\temp\\BetterDiscordApp-stable", GetParent().DiscordPath + "\\resources\\node_modules\\BetterDiscord");
|
Directory.Move(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BetterDiscord\\temp\\BetterDiscordApp-stable", GetParent().DiscordPath + "\\resources\\node_modules\\BetterDiscord");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
AppendLog("Extracting app.asar");
|
AppendLog("Extracting app.asar");
|
||||||
|
|
||||||
AsarArchive archive = new AsarArchive(GetParent().DiscordPath + "\\resources\\app.asar");
|
AsarArchive archive = new AsarArchive(GetParent().DiscordPath + "\\resources\\app.asar");
|
||||||
|
|
||||||
AsarExtractor extractor = new AsarExtractor();
|
AsarExtractor extractor = new AsarExtractor();
|
||||||
extractor.ExtractAll(archive, GetParent().DiscordPath + "\\resources\\app\\");
|
extractor.ExtractAll(archive, GetParent().DiscordPath + "\\resources\\app\\");
|
||||||
|
|
||||||
Splice();
|
Splice();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
AppendLog("Error Extracting app.asar: Newtonsoft.Json.dll might not be present in the Installer Folder. Installation cannot Continue.");
|
||||||
|
errors = 1;
|
||||||
|
Finalize(errors);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -154,24 +189,21 @@ namespace BetterDiscordWI.panels
|
||||||
|
|
||||||
Thread t = new Thread(() =>
|
Thread t = new Thread(() =>
|
||||||
{
|
{
|
||||||
|
|
||||||
List<String> lines = new List<string>();
|
List<String> lines = new List<string>();
|
||||||
|
|
||||||
AppendLog("Spicing index");
|
AppendLog("Spicing index");
|
||||||
|
|
||||||
using (FileStream fs = new FileStream(indexloc, FileMode.Open))
|
using (FileStream fs = new FileStream(indexloc, FileMode.Open))
|
||||||
{
|
{
|
||||||
using (StreamReader reader = new StreamReader(fs))
|
using (StreamReader reader = new StreamReader(fs))
|
||||||
{
|
{
|
||||||
String line = "";
|
String line = "";
|
||||||
while((line = reader.ReadLine()) != null)
|
while((line = reader.ReadLine()) != null)
|
||||||
|
{
|
||||||
|
if (GetParent().DiscordPath.Contains("Discord\\"))
|
||||||
{
|
{
|
||||||
if (line.Contains("var _overlay2"))
|
if (line.Contains("var _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"))
|
else if (line.Contains("mainWindow = new _BrowserWindow2"))
|
||||||
{
|
{
|
||||||
|
@ -183,6 +215,42 @@ namespace BetterDiscordWI.panels
|
||||||
lines.Add(line);
|
lines.Add(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (GetParent().DiscordPath.Contains("DiscordCanary\\"))
|
||||||
|
{
|
||||||
|
if (line.Contains("var _overlay2"))
|
||||||
|
{
|
||||||
|
lines.Add(line);
|
||||||
|
lines.Add("var _betterDiscord = require('betterdiscord');");
|
||||||
|
}
|
||||||
|
else if (line.Contains("mainWindow = new _BrowserWindow2"))
|
||||||
|
{
|
||||||
|
lines.Add(line);
|
||||||
|
lines.Add(File.ReadAllText("splice"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lines.Add(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (GetParent().DiscordPath.Contains("DiscordPTB\\"))
|
||||||
|
{
|
||||||
|
//"mainWindow = new _browserWindow2"
|
||||||
|
if (line.Contains("var _discord_overlay2"))
|
||||||
|
{
|
||||||
|
lines.Add(line);
|
||||||
|
lines.Add("var _betterDiscord = require('betterdiscord');");
|
||||||
|
}
|
||||||
|
else if (line.Contains("mainWindow = new _browserWindow2"))
|
||||||
|
{
|
||||||
|
lines.Add(line);
|
||||||
|
lines.Add(File.ReadAllText("splice"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lines.Add(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,9 +309,20 @@ namespace BetterDiscordWI.panels
|
||||||
});
|
});
|
||||||
|
|
||||||
if (GetParent().RestartDiscord)
|
if (GetParent().RestartDiscord)
|
||||||
|
{
|
||||||
|
if (GetParent().DiscordPath.Contains("\\Discord\\"))
|
||||||
{
|
{
|
||||||
Process.Start(GetParent().DiscordPath + "\\Discord.exe");
|
Process.Start(GetParent().DiscordPath + "\\Discord.exe");
|
||||||
}
|
}
|
||||||
|
if (GetParent().DiscordPath.Contains("\\DiscordCanary\\"))
|
||||||
|
{
|
||||||
|
Process.Start(GetParent().DiscordPath + "\\DiscordCanary.exe");
|
||||||
|
}
|
||||||
|
if (GetParent().DiscordPath.Contains("\\DiscordPTB\\"))
|
||||||
|
{
|
||||||
|
Process.Start(GetParent().DiscordPath + "\\DiscordPTB.exe");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public FormMain GetParent()
|
public FormMain GetParent()
|
||||||
|
|
Loading…
Reference in New Issue