//////////////////////////////////////////////////////ГРАНИЦА ФУНКЦИИ////////////////////////////////////////////////////////////// private void client_DownloadProgressStart() { if (FuncMisc.Ping(nameHostName + nameDLFolderHost + downloadFileName)) { FuncFiles.CreatDirectory(updateFolder); client.DownloadFileAsync(new Uri(nameHostName + nameDLFolderHost + downloadFileName), updateFolder + downloadFileName); } else { stopDownload = false; EnableDisableButtons(); MessageBox.Show(wrongPing + nameHostName + nameDLFolderHost + downloadFileName); } }
public void resetSettings() { if (File.Exists(launcherFolder + "Skyrim.ini") && File.Exists(launcherFolder + "SkyrimPrefs.ini") && File.Exists(launcherFolder + @"MasterList\DLCList.txt") && File.Exists(launcherFolder + @"MasterList\plugins.txt")) { try { RegistryKey key; key = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Bethesda Softworks\Skyrim"); key.SetValue("Installed Path", gameFolder); key.Close(); } catch { MessageBox.Show(failWriteToRegistry); } FuncFiles.Delete(myDocPath + "Skyrim.ini"); FuncFiles.Delete(myDocPath + "SkyrimPrefs.ini"); FuncFiles.Delete(myDocPath + "Logs"); FuncFiles.Delete(myDocPath + "SKSE"); FuncFiles.Delete(myDocPath + "SkyProc"); FuncFiles.Delete(myDocPath + "BashSettings.dat"); FuncFiles.Delete(myDocPath + "BashSettings.dat.bak"); FuncFiles.Delete(myDocPath + "RendererInfo.txt"); FuncFiles.Delete(myDocPath + @"Saves\Bash"); FuncFiles.CreatDirectory(myDocPath); FuncFiles.CopyAnyFiles(launcherFolder + "Skyrim.ini", myDocPath + "Skyrim.ini"); FuncFiles.CopyAnyFiles(launcherFolder + "SkyrimPrefs.ini", myDocPath + "SkyrimPrefs.ini"); FuncFiles.CopyAnyFiles(launcherFolder + @"MasterList\BashSettings.dat", myDocPath + "BashSettings.dat"); FuncFiles.Delete(appDataPath + @"DLCList.txt"); FuncFiles.Delete(appDataPath + @"plugins.txt"); FuncFiles.Delete(appDataPath + @"loadorder.txt"); FuncFiles.CreatDirectory(appDataPath); FuncFiles.CopyAnyFiles(launcherFolder + @"MasterList\DLCList.txt", appDataPath + @"DLCList.txt"); FuncFiles.CopyAnyFiles(launcherFolder + @"MasterList\plugins.txt", appDataPath + @"plugins.txt"); FuncFiles.CopyAnyFiles(launcherFolder + @"MasterList\Plugins.tes5viewsettings", appDataPath + @"Plugins.tes5viewsettings"); var form = new FormOptions(); form.resetSettings(); form.Dispose(); form = null; } else { MessageBox.Show(notFoundTemplates); } }