Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Diagnostics;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace rblxreinstall
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- //Define path
- string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Roblox";
- // if path exist then
- if (Directory.Exists(path) == true)
- {
- //Delete Roblox directory from %localappdata%
- Directory.Delete(path, true);
- //Downloads RobloxPlayerLauncher and attempts to open to install
- using (WebClient Client = new WebClient())
- {
- FileInfo file = new FileInfo("RobloxPlayerLauncher.exe");
- Client.DownloadFile("https://setup.rbxcdn.com/version-1485dc0e089746d1-Roblox.exe", file.FullName);
- MessageBox.Show("Deleted Roblox and downloaded Roblox Installer, will proceed to run.");
- Process.Start(file.FullName);
- }
- }
- // if path dont exist
- else
- {
- MessageBox.Show("Roblox directory does not exist, will attempt to download");
- using (WebClient Client = new WebClient())
- {
- FileInfo file = new FileInfo("RobloxPlayerLauncher.exe");
- Client.DownloadFile("https://setup.rbxcdn.com/version-1485dc0e089746d1-Roblox.exe", file.FullName);
- MessageBox.Show("Downloaded Roblox Installer, will proceed to run.");
- Process.Start(file.FullName);
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment