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 28, 2020
1 parent c834543 commit 32550ce
Show file tree
Hide file tree
Showing 37 changed files with 1,474 additions and 275 deletions.
347 changes: 334 additions & 13 deletions Form1.Designer.cs

Large diffs are not rendered by default.

427 changes: 310 additions & 117 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>20, 10</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
156 changes: 156 additions & 0 deletions Langfile.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Portable_Opera_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 "Label9":
return "Установить все версии x86 и/или x64";
case "checkBox4":
return "Игнорировать проверку версии";
case "checkBox3":
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 "Необходимо закрыть Opera перед обновлением.";
case "Register":
return "регистр";
case "Remove":
return "Удалить";
case "Standard":
return " как браузер по умолчанию";
case "Extra":
return "отде́льно";
case "VInfo":
return "О версиях";
}
break;
case "de":
switch (langText)
{
case "Button10":
return "Beenden";
case "Button9":
return "Alle Installieren";
case "Button9UAll":
return "Alle Updaten";
case "Label9":
return "Alle x86 und oder x64 installieren";
case "checkBox4":
return "Versionkontrolle ignorieren";
case "checkBox3":
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 Opera, 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";
}
break;
default:
switch (langText)
{
case "Button10":
return "Quit";
case "Button9":
return "Install all";
case "Button9UAll":
return "Update all";
case "Label9":
return "Install all x86 and or x64";
case "checkBox4":
return "Ignore version check";
case "checkBox3":
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 Opera 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";
}
break;
}
return "";
}
}
}
Binary file modified Launcher/Launcher.7z
Binary file not shown.
7 changes: 4 additions & 3 deletions Launcher/Opera Beta x64 Launcher/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Opera_Beta_x64_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(@"Opera Beta x64\Profile.txt", "--user-data-dir=\"profile\"");
System.IO.File.WriteAllText(applicationPath + "\\Opera Beta x64\\Profile.txt", "--user-data-dir=\"profile\"");
this.Close();
}
if (radioButton2.Checked)
{
System.IO.File.WriteAllText(@"Opera Beta x64\Profile.txt", "--user-data-dir=\"Opera Beta x64\\profile\"");
System.IO.File.WriteAllText(applicationPath + "\\Opera Beta x64\\Profile.txt", "--user-data-dir=\"Opera Beta x64\\profile\"");
this.Close();
}
if (radioButton3.Checked)
{
System.IO.File.WriteAllText(@"Opera Beta x64\Profile.txt", "");
System.IO.File.WriteAllText(applicationPath + "\\Opera Beta x64\\Profile.txt", "");
this.Close();
}
}
Expand Down
56 changes: 45 additions & 11 deletions Launcher/Opera 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(@"Opera Beta x64\Launcher.exe"))
string applicationPath = Application.StartupPath;
if (File.Exists(applicationPath + "\\Opera Beta x64\\Launcher.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(@"Opera Beta x64\Profile.txt"))
if (!File.Exists(applicationPath + "\\Opera Beta x64\\Profile.txt"))
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
String Arguments = File.ReadAllText(@"Opera Beta x64\Profile.txt") + sb.ToString();
_ = Process.Start(@"Opera Beta x64\Launcher.exe", Arguments);
String Arguments = File.ReadAllText(applicationPath + "\\Opera 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 + "\\Opera Beta x64\\Launcher.exe", Arguments3);
}
else
{
Process.Start(applicationPath + "\\Opera Beta x64\\Launcher.exe", Arguments);
}
}
else
{
String Arguments = File.ReadAllText(@"Opera Beta x64\Profile.txt") + sb.ToString();
_ = Process.Start(@"Opera Beta x64\Launcher.exe", Arguments);
String Arguments = File.ReadAllText(applicationPath + "\\Opera 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 + "\\Opera Beta x64\\Launcher.exe", Arguments3);
}
else
{
Process.Start(applicationPath + "\\Opera Beta x64\\Launcher.exe", Arguments);
}
}
}
else if (culture1.TwoLetterISOLanguageName == "de")
{
_ = MessageBox.Show("Opera ist nicht installiert", "Opera Beta x64 Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
MessageBox.Show("Opera ist nicht installiert", "Opera Beta x64 Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
else if (culture1.TwoLetterISOLanguageName == "ru")
{
_ = MessageBox.Show("Opera Portable не найден", "Opera Beta x64 Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
MessageBox.Show("Opera Portable не найден", "Opera Beta x64 Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
else
{
_ = MessageBox.Show("Opera is not installed", "Opera Beta x64 Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
MessageBox.Show("Opera is not installed", "Opera Beta x64 Launcher", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Launcher/Opera 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.0")]
[assembly: AssemblyFileVersion("1.1.5.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
7 changes: 4 additions & 3 deletions Launcher/Opera Beta x86 Launcher/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Opera_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(@"Opera Beta x86\Profile.txt", "--user-data-dir=\"profile\"");
System.IO.File.WriteAllText(applicationPath + "\\Opera Beta x86\\Profile.txt", "--user-data-dir=\"profile\"");
this.Close();
}
if (radioButton2.Checked)
{
System.IO.File.WriteAllText(@"Opera Beta x86\Profile.txt", "--user-data-dir=\"Opera Beta x86\\profile\"");
System.IO.File.WriteAllText(applicationPath + "\\Opera Beta x86\\Profile.txt", "--user-data-dir=\"Opera Beta x86\\profile\"");
this.Close();
}
if (radioButton3.Checked)
{
System.IO.File.WriteAllText(@"Opera Beta x86\Profile.txt", "");
System.IO.File.WriteAllText(applicationPath + "\\Opera Beta x86\\Profile.txt", "");
this.Close();
}
}
Expand Down
Loading

0 comments on commit 32550ce

Please sign in to comment.