PROGRAMMER
Seçkin Üye
C#:
private double version = 1;
WebClient client = new WebClient();
Uri Uri = new Uri("Güncellemekontrol.txt");//Bu version ile yukardaki numara aynı değil ise güncelleme uygulanır .txt belgesine 2 yazması gerekiyor güncelleme yapılması için.
string versionstring = client.DownloadString(Uri);
double newestversion = double.Parse(versionstring);
if (newestversion != version)
{
dynamic MsgResult = MessageBox.Show(string.Format(Properties.Langs.Lang.messagebox_update) + version + (Properties.Langs.Lang.messagebox_newestversion) + newestversion,(Properties.Langs.Lang.Messagebox_launcher_running_tittle), MessageBoxButton.YesNo);
if (MsgResult == System.Windows.MessageBoxResult.Yes)
{
if (!File.Exists("Uygulama.exe"))
{
client.DownloadFile("https://www.uygulamaindirlecekadres.com/uygulama.exe", "Uygulama.exe");
}
ProcessStartInfo processInfo = new ProcessStartInfo();
processInfo.FileName = "Uygulama.exe"; ;
Process.Start(processInfo);
Environment.Exit(1);
}
else
{
Messagebox.show("Güncellemeyi kabul etmezise");
Environment.Exit(0);
}