public AuthenticationForm(LauncherForm launcher) { InitializeComponent(); preventClose = true; authenticationType = 1; uid = ""; password = ""; loginTime = DateTime.MinValue.ToString(); trials = 0; login = false; postAuthScript = ""; dtTokens = InitTokens(); pingUrl = ""; pingResult = ""; myLauncher = launcher; }
async private static void DoSomethingOnFinish(object sender, AsyncCompletedEventArgs e) { try { if (!Directory.Exists(Program.currentDir + "/update/")) { Directory.CreateDirectory(Program.currentDir + "/update"); } System.IO.DirectoryInfo di = new DirectoryInfo(Program.currentDir + "/"); try { File.Delete("daemon.exe"); Directory.Delete("asset", true); } catch (Exception) { } using (ZipFile zipFile = ZipFile.Read("update.zip")) { foreach (ZipEntry fileName in zipFile) { try { fileName.Extract(Program.currentDir + "/", ExtractExistingFileAction.OverwriteSilently); } catch (Exception) { } } try { await Task.Delay(7000); LauncherForm.doTask(); await Task.Delay(2000); } catch (Exception) { } } } catch (Exception) { } }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); LauncherForm myLauncher = new LauncherForm(); myLauncher.IsLauncherVisible = false; if (args.Length > 0) { foreach (string arg in args) { switch (arg) { case "-i": myLauncher.IsLauncherVisible = true; break; } } } Application.Run(myLauncher); }
public Downloader(LauncherForm mainForm) { _instanceMainForm = mainForm; }