Skip to content

Commit

Permalink
Funktion added to register the Browser as default
Browse files Browse the repository at this point in the history
  • Loading branch information
UndertakerBen committed Jun 12, 2020
1 parent a029030 commit b3021d0
Show file tree
Hide file tree
Showing 46 changed files with 1,640 additions and 399 deletions.
345 changes: 333 additions & 12 deletions Form1.Designer.cs

Large diffs are not rendered by default.

712 changes: 464 additions & 248 deletions Form1.cs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down
163 changes: 163 additions & 0 deletions Langfile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
using System.Globalization;

namespace Chrome_Updater
{
public partial class Langfile
{
public static string Texts(string langText)
{
CultureInfo culture1 = CultureInfo.CurrentUICulture;
switch (culture1.TwoLetterISOLanguageName)
{
case "ru":
switch (langText)
{
case "Button10":
return "Выход";
case "Button9":
return "Установить все";
case "Button9UAll":
return "Обновить все";
case "Label10":
return "Установить все версии x86 и/или x64";
case "checkBox4":
return "Игнорировать проверку версии";
case "checkBox1":
return "Разные версии в отдельных папках";
case "checkBox5":
return "Создать ярлык на рабочем столе";
case "downUnpstart":
return "Распаковка";
case "downUnpfine":
return "Распакованный";
case "infoLabel":
return "Доступна новая версия";
case "laterButton":
return "нет";
case "updateButton":
return "Да";
case "downLabel":
return "ОБНОВИТЬ";
case "MeassageVersion":
return "Данная версия уже установлена";
case "MeassageRunning":
return "Необходимо закрыть Google Chrome перед обновлением.";
case "Register":
return "регистр";
case "Remove":
return "Удалить";
case "Standard":
return " как браузер по умолчанию";
case "Extra":
return "отде́льно";
case "VInfo":
return "О версиях";
case "AppDescriptFull":
return "Google Chrome – это быстрый и удобный браузер для работы с веб-страницами и приложениями. Он надежен и прост в использовании. Вы можете просматривать страницы в Интернете, положившись на систему защиту от вредоносного ПО и фишинга, которая уже встроена в Google Chrome.";
case "AppDescriptShort":
return "доступ в Интернет";
}
break;
case "de":
switch (langText)
{
case "Button10":
return "Beenden";
case "Button9":
return "Alle Installieren";
case "Button9UAll":
return "Alle Updaten";
case "Label10":
return "Alle x86 und oder x64 installieren";
case "checkBox4":
return "Versionkontrolle ignorieren";
case "checkBox1":
return "Für jede Version einen eigenen Ordner";
case "checkBox5":
return "Eine Verknüpfung auf dem Desktop erstellen";
case "downUnpstart":
return "Entpacken";
case "downUnpfine":
return "Entpackt";
case "infoLabel":
return "Eine neue Version ist verfügbar";
case "laterButton":
return "Nein";
case "updateButton":
return "Ja";
case "downLabel":
return "Jetzt Updaten";
case "MeassageVersion":
return "Die selbe Version ist bereits installiert";
case "MeassageRunning":
return "Bitte schließen Sie den laufenden Google Chromebrowser, bevor Sie den Browser aktualisieren.";
case "Register":
return "Registrieren";
case "Remove":
return "Entfernen";
case "Standard":
return " als Standardbrowser";
case "Extra":
return "Extras";
case "VInfo":
return "Versions Info";
case "AppDescriptFull":
return "Google Chrome ist ein Webbrowser, der Webseiten und Apps in Sekundenschnelle lädt und dabei äußerst stabil und nutzerfreundlich ist. Dank des integrierten Malware- und Phishing-Schutzes können Sie bedenkenlos im Internet surfen.";
case "AppDescriptShort":
return "Internetzugriff";
}
break;
default:
switch (langText)
{
case "Button10":
return "Quit";
case "Button9":
return "Install all";
case "Button9UAll":
return "Update all";
case "Label10":
return "Install all x86 and or x64";
case "checkBox4":
return "Ignore version check";
case "checkBox1":
return "Create a Folder for each version";
case "checkBox5":
return "Create a shortcut on the desktop";
case "downUnpstart":
return "Unpacking";
case "downUnpfine":
return "Unpacked";
case "infoLabel":
return "A new version is available";
case "laterButton":
return "No";
case "updateButton":
return "Yes";
case "downLabel":
return "Update now";
case "MeassageVersion":
return "The same version is already installed";
case "MeassageRunning":
return "Please close the running Google Chrome before updating the browser.";
case "Register":
return "Register";
case "Remove":
return "Remove";
case "Standard":
return " as default browser";
case "Extra":
return "Extras";
case "VInfo":
return "Version Info";
case "AppDescriptFull":
return "Google Chrome is a web browser that runs webpages and applications with lightning speed. It's fast, stable, and easy to use. Browse the web more safely with malware and phishing protection built into Google Chrome.";
case "AppDescriptShort":
return "Access the Internet";
}
break;
}
return "";
}
}
}
1 change: 1 addition & 0 deletions Launcher/Chrome Beta x64 Launcher/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Launcher/Chrome Beta x64 Launcher/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Chrome_Beta_x64_Launcher
{
public partial class Form1 : Form
{
string applicationPath = Application.StartupPath;
public Form1()
{
CultureInfo culture = CultureInfo.CurrentUICulture;
Expand Down Expand Up @@ -33,17 +34,17 @@ private void Button1_Click(object sender, System.EventArgs e)
{
if (radioButton1.Checked)
{
System.IO.File.WriteAllText(@"Chrome Beta x64\Profile.txt", "--user-data-dir=\"profile\"");
System.IO.File.WriteAllText(applicationPath + "\\Chrome Beta x64\\Profile.txt", "--user-data-dir=\"profile\"");
this.Close();
}
if (radioButton2.Checked)
{
System.IO.File.WriteAllText(@"Chrome Beta x64\Profile.txt", "--user-data-dir=\"Chrome Beta x64\\profile\"");
System.IO.File.WriteAllText(applicationPath + "\\Chrome Beta x64\\Profile.txt", "--user-data-dir=\"Chrome Beta x64\\profile\"");
this.Close();
}
if (radioButton3.Checked)
{
System.IO.File.WriteAllText(@"Chrome Beta x64\Profile.txt", "");
System.IO.File.WriteAllText(applicationPath + "\\Chrome Beta x64\\Profile.txt", "");
this.Close();
}
}
Expand Down
56 changes: 45 additions & 11 deletions Launcher/Chrome Beta x64 Launcher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,81 @@ static class Program
static void Main()
{
CultureInfo culture1 = CultureInfo.CurrentUICulture;
if (File.Exists(@"Chrome Beta x64\Chrome.exe"))
string applicationPath = Application.StartupPath;
if (File.Exists(applicationPath + "\\Chrome Beta x64\\Chrome.exe"))
{
var sb = new System.Text.StringBuilder();
string[] CommandLineArgs = Environment.GetCommandLineArgs();
for (int i = 1; i < CommandLineArgs.Length; i++)
{
if (CommandLineArgs[i].Contains("="))
{
string[] test = CommandLineArgs[i].Split(new char[] { '=' }, 2);
sb.Append(" " + test[0] + "=\"" + test[1] + "\"");
if (CommandLineArgs[i].Contains("LinkID"))
{
sb.Append(" " + CommandLineArgs[i]);
}
else if (CommandLineArgs[i].Contains("http"))
{
sb.Append(" \"" + CommandLineArgs[i] + "\"");
}
else
{
string[] test = CommandLineArgs[i].Split(new char[] { '=' }, 2);
sb.Append(" " + test[0] + "=\"" + test[1] + "\"");
}
}
else if (CommandLineArgs[i].Contains(".pdf"))
{
sb.Append(" \"" + CommandLineArgs[i] + "\"");
}
else
{
sb.Append(" " + CommandLineArgs[i]);
}
}
if (!File.Exists(@"Chrome Beta x64\Profile.txt"))
if (!File.Exists(applicationPath + "\\Chrome Beta x64\\Profile.txt"))
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
String Arguments = File.ReadAllText(@"Chrome Beta x64\Profile.txt") + sb.ToString();
_ = Process.Start(@"Chrome Beta x64\Chrome.exe", Arguments);
String Arguments = File.ReadAllText(applicationPath + "\\Chrome Beta x64\\Profile.txt") + sb.ToString();
if (Arguments.Contains("--user-data-dir="))
{
string[] Arguments2 = Arguments.Split(new char[] { '=' }, 2);
string Arguments3 = Arguments2[0] + "=\"" + applicationPath + "\\" + Arguments2[1].Remove(0, 1);
Process.Start(applicationPath + "\\Chrome Beta x64\\Chrome.exe", Arguments3);
}
else
{
Process.Start(applicationPath + "\\Chrome Beta x64\\Chrome.exe", Arguments);
}
}
else
{
String Arguments = File.ReadAllText(@"Chrome Beta x64\Profile.txt") + sb.ToString();
_ = Process.Start(@"Chrome Beta x64\Chrome.exe", Arguments);
String Arguments = File.ReadAllText(applicationPath + "\\Chrome Beta x64\\Profile.txt") + sb.ToString();
if (Arguments.Contains("--user-data-dir="))
{
string[] Arguments2 = Arguments.Split(new char[] { '=' }, 2);
string Arguments3 = Arguments2[0] + "=\"" + applicationPath + "\\" + Arguments2[1].Remove(0, 1);
Process.Start(applicationPath + "\\Chrome Beta x64\\Chrome.exe", Arguments3);
}
else
{
Process.Start(applicationPath + "\\Chrome Beta x64\\Chrome.exe", Arguments);
}
}
}
else if (culture1.TwoLetterISOLanguageName == "de")
{
_ = MessageBox.Show("Chrome ist nicht installiert", "Chrome Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
MessageBox.Show("Chrome ist nicht installiert", "Chrome Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
else if (culture1.TwoLetterISOLanguageName == "ru")
{
_ = MessageBox.Show("Google Chrome Portable не найден", "Chrome Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
MessageBox.Show("Google Chrome Portable не найден", "Chrome Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
else
{
_ = MessageBox.Show("Chrome is not installed", "Chrome Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
MessageBox.Show("Chrome is not installed", "Chrome Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Launcher/Chrome Beta x64 Launcher/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.5.1")]
[assembly: AssemblyFileVersion("1.1.5.1")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
1 change: 1 addition & 0 deletions Launcher/Chrome Beta x86 Launcher/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Launcher/Chrome Beta x86 Launcher/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Chrome_Beta_x86_Launcher
{
public partial class Form1 : Form
{
private readonly string applicationPath = Application.StartupPath;
public Form1()
{
CultureInfo culture = CultureInfo.CurrentUICulture;
Expand Down Expand Up @@ -33,17 +34,17 @@ private void Button1_Click(object sender, System.EventArgs e)
{
if (radioButton1.Checked)
{
System.IO.File.WriteAllText(@"Chrome Beta x86\Profile.txt", "--user-data-dir=\"profile\"");
System.IO.File.WriteAllText(applicationPath + "\\Chrome Beta x86\\Profile.txt", "--user-data-dir=\"profile\"");
this.Close();
}
if (radioButton2.Checked)
{
System.IO.File.WriteAllText(@"Chrome Beta x86\Profile.txt", "--user-data-dir=\"Chrome Beta x86\\profile\"");
System.IO.File.WriteAllText(applicationPath + "\\Chrome Beta x86\\Profile.txt", "--user-data-dir=\"Chrome Beta x86\\profile\"");
this.Close();
}
if (radioButton3.Checked)
{
System.IO.File.WriteAllText(@"Chrome Beta x86\Profile.txt", "");
System.IO.File.WriteAllText(applicationPath + "\\Chrome Beta x86\\Profile.txt", "");
this.Close();
}
}
Expand Down
Loading

0 comments on commit b3021d0

Please sign in to comment.