spidey_v6

Untitled

Jan 21st, 2020
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Diagnostics;
  6. using System.Drawing;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Net;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using System.Windows.Forms;
  13.  
  14. namespace rblxreinstall
  15. {
  16. public partial class Form1 : Form
  17. {
  18. public Form1()
  19. {
  20. InitializeComponent();
  21. }
  22.  
  23.  
  24.  
  25. private void button1_Click(object sender, EventArgs e)
  26. {
  27. //Define path
  28. string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Roblox";
  29. // if path exist then
  30. if (Directory.Exists(path) == true)
  31. {
  32. //Delete Roblox directory from %localappdata%
  33. Directory.Delete(path, true);
  34. //Downloads RobloxPlayerLauncher and attempts to open to install
  35. using (WebClient Client = new WebClient())
  36. {
  37. FileInfo file = new FileInfo("RobloxPlayerLauncher.exe");
  38. Client.DownloadFile("https://setup.rbxcdn.com/version-1485dc0e089746d1-Roblox.exe", file.FullName);
  39. MessageBox.Show("Deleted Roblox and downloaded Roblox Installer, will proceed to run.");
  40.  
  41. Process.Start(file.FullName);
  42. }
  43. }
  44. // if path dont exist
  45. else
  46. {
  47. MessageBox.Show("Roblox directory does not exist, will attempt to download");
  48. using (WebClient Client = new WebClient())
  49. {
  50. FileInfo file = new FileInfo("RobloxPlayerLauncher.exe");
  51. Client.DownloadFile("https://setup.rbxcdn.com/version-1485dc0e089746d1-Roblox.exe", file.FullName);
  52. MessageBox.Show("Downloaded Roblox Installer, will proceed to run.");
  53.  
  54. Process.Start(file.FullName);
  55. }
  56. }
  57.  
  58. }
  59. }
  60. }
Add Comment
Please, Sign In to add comment