using System; using System.IO; using System.Net; using System.Security.Principal; namespace Plus { class Program { static void Main(string[] args) { string usrNome; string pathDesktop; var strTitulo = ""; var strNoAdm = ""; var strNoPlus = ""; var strComecar = ""; var strBaixou = ""; var strFalhaDown = ""; var strBaixando = ""; var strWLM = ""; var strProgresso = ""; var strSuc1 = ""; var strSuc2 = ""; var strSuc3 = ""; var strFail1 = ""; var strFail2 = ""; var strFail3 = ""; var pathPlus = ""; var wLive = ""; var BR = ""; var strCleanS = ""; var strCleanN = ""; var strFim = ""; var oldPlus = ""; pathDesktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\"; usrNome = Environment.UserName.Substring(0, 1).ToUpper() + Environment.UserName.Substring(1, Environment.UserName.Length - 1).ToLower(); Console.Title = "Messenger Plus! Live"; if (System.Globalization.CultureInfo.InstalledUICulture.Name == "pt-BR") { strTitulo = "\n ==================================================\n" + " MESSENGER PLUS! LIVE - CORREÇÕES \n" + " ==================================================\n\n\n"; strNoAdm = " Olá " + usrNome + ".\n" + " Você precisa executar este recurso como\n" + " Administrador, do contrário não conseguiremos\n" + " copiar o que é necessário.\n\n" + " Pressione qualquer tecla para sair..."; strNoPlus = " Olá " + usrNome + ".\n" + " Não encontramos o Plus! Live, é impossível\n" + " continuar as correções.\n\n" + " Pressione qualquer tecla para sair..."; strComecar = " Olá " + usrNome + ".\n" + " Vamos começar a cópia dos arquivos, talvez\n" + " precisaremos baixá-los.\n\n" + " Pressione qualquer tecla para continuar..."; strBaixou = " Download ignorado porque os arquivos já foram\n" + " baixados por você...\n\n\n"; strFalhaDown = " Impossível baixar os arquivos, o processo\n" + " será cancelado. Tente novamente mais tarde.\n" + " Pressione qualquer tecla para sair..."; strBaixando = " Download dos arquivos em processo, aguarde...\n\n\n"; strWLM = " O Windows Live Messenger está aberto, estamos\n" + " aguardando você fechá-lo...\n\n\n"; strProgresso = " Status | Procedimento\n"; strSuc1 = " * Êxito: cópia do Patch de Som\n"; strFail1 = " X FALHA: cópia do Patch de Som\n"; strSuc2 = " * Êxito: cópia da Tradução Brasileira\n"; strFail2 = " X FALHA: cópia da Tradução Brasileira\n"; strSuc3 = " * Êxito: definir Português como idioma\n"; strFail3 = " X FALHA: definir Português como idioma\n"; strCleanS = " * Êxito: limpeza dos temporários\n"; strCleanN = " X FALHA: limpeza dos temporários\n"; strFim = "\n\n Procedimento finalizado,\n" + " Pressione qualquer tecla para encerrar :D"; } else { BR = "x"; strTitulo = "\n ==================================================\n" + " MESSENGER PLUS! LIVE - FIX \n" + " ==================================================\n\n\n"; strNoAdm = " Hello " + usrNome + ".\n" + " You need execute this program as Administrator,\n" + " only this way we can copy the files...\n\n" + " Press any key to exit..."; strNoPlus = " Hello " + usrNome + ".\n" + " We didn't found the Plus! Live, the procedure can't\n" + " continue.\n\n" + " Press any key to exit..."; strComecar = " Hello " + usrNome + ".\n" + " Let's start copying the files, maybe\n" + " we'll need to download them.\n\n" + " Press any key to continue..."; strBaixou = " Download ignored, because the files have\n" + " been downloaded by you...\n\n\n"; strFalhaDown = " Impossible download the files, the procedure\n" + " can't continues. Try again later.\n" + " Press any key to exit..."; strBaixando = " Download in progress, please wait...\n\n\n"; strWLM = " The Windows Live Messenger is opened, waiting\n" + " you close it...\n\n\n"; strProgresso = " Status | Procedure\n"; strSuc1 = " * Done: copy of Sound Patch\n"; strFail1 = " X FAILURE: copy of Sound Patch\n"; strSuc2 = " - Unnecessary: Portuguese translation\n"; strFail2 = " - Unnecessary: Portuguese translation\n"; strSuc3 = " - Unnecessary: Portuguese translation\n"; strFail3 = " - Unnecessary: Portuguese translation\n"; strCleanS = " - Unnecessary: make Portuguese main lang\n"; strCleanN = " - Unnecessary: make Portuguese main lang\n"; strFim = "\n\n Procedure completed,\n" + " Press any key to quit :D"; } Console.Write(strTitulo); bool exAdm = new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); if (exAdm == false) { Console.Write(strNoAdm); Console.ReadKey(); Console.Beep(); Environment.Exit(0); } if (File.Exists(Path.GetPathRoot(Environment.SystemDirectory) + "Program Files (x86)\\Messenger Plus! Live\\MPTools.exe")) { pathPlus = Path.GetPathRoot(Environment.SystemDirectory) + "Program Files (x86)\\Messenger Plus! Live\\"; } else if (File.Exists(Path.GetPathRoot(Environment.SystemDirectory) + "Program Files\\Messenger Plus! Live\\MPTools.exe")) { pathPlus = Path.GetPathRoot(Environment.SystemDirectory) + "Program Files\\Messenger Plus! Live\\"; } else if (File.Exists(Path.GetPathRoot(Environment.SystemDirectory) + "Arquivos de programas\\Messenger Plus! Live\\MPTools.exe")) { pathPlus = Path.GetPathRoot(Environment.SystemDirectory) + "Arquivos de programas\\Messenger Plus! Live"; } else if (File.Exists(Path.GetPathRoot(Environment.SystemDirectory) + "Program Files (x86)\\MessengerPlus! 3\\MsgPlus.exe")) { oldPlus = "x"; pathPlus = Path.GetPathRoot(Environment.SystemDirectory) + "Program Files (x86)\\MessengerPlus! 3"; pathPlus = pathPlus.Replace("!3", "! 3"); } else if (File.Exists(Path.GetPathRoot(Environment.SystemDirectory) + "Program Files\\MessengerPlus! 3\\MsgPlus.exe")) { oldPlus = "x"; pathPlus = Path.GetPathRoot(Environment.SystemDirectory) + "Program Files\\MessengerPlus! 3"; pathPlus = pathPlus.Replace("!3", "! 3"); } else if (File.Exists(Path.GetPathRoot(Environment.SystemDirectory) + "Arquivos de programas\\MessengerPlus! 3\\MsgPlus.exe")) { oldPlus = "x"; pathPlus = Path.GetPathRoot(Environment.SystemDirectory) + "Arquivos de programas\\MessengerPlus!3"; pathPlus = pathPlus.Replace("!3", "! 3"); } else { Console.Write(strNoPlus); Console.ReadKey(); Console.Beep(); Environment.Exit(0); } Console.Write (strComecar); Console.Beep(); Console.ReadKey(); Console.Clear(); Console.Write(strTitulo); if (BR != "" && File.Exists(pathDesktop + "MsgPlusLive.dll")) { Console.Write(strBaixou); } else if (File.Exists(pathDesktop + "Lng_Portugues.ini") && File.Exists(pathDesktop + "MsgPlusLive.dll")) { Console.Write(strBaixou); } else { Console.Write(strBaixando); try { using (WebClient downArqv = new WebClient()) { if (!File.Exists(pathDesktop + "Lng_Portugues.ini") && BR == "" && oldPlus == "") { downArqv.DownloadFile("https://drive.google.com/uc?id=1GJyhMYjwELu0a3bphjRxdb5YxlMmN3X8", pathDesktop + "Lng_Portugues.ini"); } if (!File.Exists(pathDesktop + "MsgPlusH.dll") && oldPlus != "") { downArqv.DownloadFile("https://drive.google.com/uc?authuser=0&id=1RaUPDGT4YOfjH7zfeVB5BFyn-vihExkS", pathDesktop + "MsgPlusH.dll"); } else if (!File.Exists(pathDesktop + "MsgPlusLive.dll")) { downArqv.DownloadFile("https://drive.google.com/uc?id=17O_34v8y0_Hrt5fZNpuz-2pZTFa9BKkT", pathDesktop + "MsgPlusLive.dll"); } } } catch { Console.Write(strFalhaDown); Console.Beep(); Console.ReadKey(); Environment.Exit(0); } } while (System.Diagnostics.Process.GetProcessesByName("msnmsgr").Length != 0) { if (wLive == "") { Console.Write(strWLM); wLive = "x"; } } System.Threading.Thread.Sleep(4000); Console.Write(strProgresso); try { if (oldPlus == "") { File.Copy(pathDesktop + "MsgPlusLive.dll", pathPlus + "\\MsgPlusLive.dll", true); } else { File.Copy(pathDesktop + "MsgPlusH.dll", pathPlus + "\\MsgPlusH.dll", true); } Console.Write(strSuc1); } catch { Console.Write(strFail1); } if (BR == "" && oldPlus == "") { try { File.Copy(pathDesktop + "Lng_Portugues.ini", pathPlus + "\\Languages\\Lng_Portugues.ini", true); Console.Write(strSuc2); } catch { Console.Write(strFail2); } try { Microsoft.Win32.RegistryKey cPlus; cPlus = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Patchou\Messenger Plus! Live\", true); cPlus.SetValue("LanguageFile", "Lng_Portugues.ini"); cPlus.Close(); Console.Write(strSuc3); } catch { Console.Write(strFail3); } } try { if (oldPlus == "") { File.Delete(pathDesktop + "MsgPlusLive.dll"); } else { File.Delete(pathDesktop + "MsgPlusH.dll"); } if (BR == "" && oldPlus == "") { File.Delete(pathDesktop + "Lng_Portugues.ini"); } Console.Write(strCleanS); } catch { Console.Write(strCleanN); } Console.Write(strFim); Console.Beep(); Console.ReadKey(); Environment.Exit(0); } } }