Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Net;
- using System.IO.Compression;
- namespace VimeTheme
- {
- class Program
- {
- static string GetSystemDisk()
- {
- string system = Environment.GetFolderPath(Environment.SpecialFolder.System);
- string path = Path.GetPathRoot(system);
- return path;
- }
- static void Download(string url, string path)
- {
- try
- {
- WebClient webClient = new WebClient();
- webClient.DownloadFile(url, path);
- } catch (System.Net.WebException)
- {
- Console.WriteLine("> Ошибка при скачивании архива");
- Environment.Exit(0);
- Console.ReadKey();
- }
- }
- static void Main(string[] args)
- {
- string vw_path = $"{GetSystemDisk()}Users\\{Environment.UserName}\\AppData\\Roaming\\.vimeworld";
- Console.WriteLine("> Загрузка архива...");
- Download("https://vimetheme.at.ua/win11.zip", $"{vw_path}\\theme.zip");
- Console.WriteLine("> Установка темы...");
- try
- {
- Directory.Delete($"{vw_path}\\.data", true);
- } catch(System.IO.DirectoryNotFoundException) {; }
- try
- {
- ZipFile.ExtractToDirectory($"{vw_path}\\theme.zip", vw_path);
- } catch(System.IO.FileNotFoundException)
- {
- Console.WriteLine("\n> Ошибка при извлечении содержимого архива");
- Environment.Exit(0);
- Console.ReadKey();
- }
- File.Delete($"{vw_path}\\theme.zip");
- Console.WriteLine("> Тема успешно установлена. Запустите VimeWorld");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement