pLTPF
I am NOT LeafyIsHere
Here's a quick run down of what the the code's doing
1. Checks the current version with the newest which is stored on a pastebin(can be any raw text viewer)
2. If they don't match, it'll open the updater then close the current program(out of date program)
3. The updater will delete the outdated version then download the new version.
4. After it's downloaded it will close and open the updated version of the original tool.
Console Application Code
For the 1.3.3.7 URL I used my server, I don't know of any file storage online where you can just type the URL in and it will immediately download.
Form Code
1. Checks the current version with the newest which is stored on a pastebin(can be any raw text viewer)
2. If they don't match, it'll open the updater then close the current program(out of date program)
3. The updater will delete the outdated version then download the new version.
4. After it's downloaded it will close and open the updated version of the original tool.
Console Application Code
Code:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace Updater
{
class Program
{
// Credits to LTPF
static void Main(string[] args)
{
WebClient wc = new WebClient();
if (File.Exists("AutoUpdater.exe")) // Should be the pld out dated version.
File.Delete("AutoUpdater.exe");
File.WriteAllBytes("AutoUpdater.exe", wc.DownloadData("http://1.3.3.7/AutoUpdater.exe")); // Creates and writes a file as it reads from the newest verison.
Process.Start("AutoUpdater.exe"); // Launches the original program.
Console.WriteLine("Update downloaded!\n");
}
}
}
For the 1.3.3.7 URL I used my server, I don't know of any file storage online where you can just type the URL in and it will immediately download.
Form Code
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Diagnostics;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string currentVersion = "1.0.0.0";
private void Form1_Load(object sender, EventArgs e)
{
label1.Text = "Version: " + currentVersion;
}
private void button1_Click(object sender, EventArgs e)
{
WebClient wc = new WebClient();
string newVersion = wc.DownloadString("https:\\(raw text viewer containing only version, e.g. 1.0.0.0)"); // Downloads the newest version.
if (currentVersion != newVersion)
{
if (!File.Exists("Updater.exe")) // Checks if the updater file doesn't exist or is renamed.
MessageBox.Show("Updater not found! Please redownload the program!");
else
{
Process.Start("Updater.exe"); // Launches the updater if the file DOES exist.
Close();
}
}
else
{
MessageBox.Show("Up to date!");
}
}
}
}
For you code monkeys here's the sources to the applications I made
Download | Virus Scan | Photo Of Scan
Insane amount of false positives on the virus total, I have no idea why there's no obfuscation on the source.
Download | Virus Scan | Photo Of Scan
Insane amount of false positives on the virus total, I have no idea why there's no obfuscation on the source.