Это Мой код: < /p>
Код: Выделить всё
private void LaunchEvent(object sender, RoutedEventArgs e)
{
var wc = new WebClient();
string tempPath = Path.GetTempPath();
string newFolderName = "launcher";
string newFolderPath = Path.Combine(tempPath, newFolderName);
string extractPath = Path.Combine(Path.GetTempPath(), "launcher");
string executableName = "MiziModLauncher.exe";
string executablePath = Path.Combine(extractPath, executableName);
var file = Path.Combine(Path.GetTempPath(), newFolderName, "Launcher.zip");
Directory.CreateDirectory(newFolderPath);
if (Directory.Exists(extractPath))
{
Process.Start(executablePath);
}
else
{
wc.DownloadFileAsync(new Uri("https://maremizi.github.io/Launcher.zip"), file);
wc.DownloadFileCompleted += (_, __) => ZipFile.ExtractToDirectory(file, extractPath);
Process.Start(executablePath);
}
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... in-c-sharp
Мобильная версия