-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
BuildTools
committed
Jun 6, 2020
1 parent
4e54623
commit 8437086
Showing
4 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.IO; | ||
using System.Net; | ||
using System.Windows.Forms; | ||
|
||
namespace RsMapper | ||
{ | ||
public class PrgmSelfCheck | ||
{ | ||
// DEPENDANCIES | ||
public static string ComponentsJson = "Components.json"; | ||
public static string JsonNet = "Newtonsoft.Json.dll"; | ||
public static string JsonNetXml = "Newtonsoft.Json.xml"; | ||
|
||
WebClient wc = new WebClient(); | ||
|
||
/// <summary> | ||
/// Check for any missing files that are required to start the program. | ||
/// </summary> | ||
public void CheckAll() | ||
{ | ||
if(File.Exists(ComponentsJson) == false) | ||
{ | ||
|
||
// Check for components settings file. | ||
if(MessageBox.Show("The file " + ComponentsJson + " is missing. Would you like to redownload it?", "Missing Dependancy", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes) | ||
{ | ||
|
||
// Reinstall the file if the user clicks yes. | ||
wc.DownloadFile("https://raw.githubusercontent.com/GreenJamesDev/RsMapper/master/RsMapper/Components.json", AppDomain.CurrentDomain.BaseDirectory + "Components.json"); | ||
|
||
|
||
} else | ||
{ | ||
|
||
// If the user chooses not to reinstall the file, exit RsMapper. | ||
Application.Exit(); | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters