Skip to content

Commit

Permalink
RsMapper now downloads Components.json without asking the user.
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Aug 5, 2020
1 parent 1d644ea commit b879f40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion RsMapper/Forms/DownloadProgress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private void DownloadProgress_Load(object sender, EventArgs e)
}
catch (Exception exception)
{
MessageBox.Show("Unable to download replacement file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("Unable to download file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
}
Expand Down
20 changes: 5 additions & 15 deletions RsMapper/PrgmSelfCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,11 @@ public async 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)
{

DownloadProgress downloadProgress = new DownloadProgress("https://raw.githubusercontent.com/GreenJamesDev/RsMapper/master/RsMapper/Components.json", ComponentsJson);
downloadProgress.ShowDialog();
downloadProgress.Dispose();
} else
{

// If the user chooses not to reinstall the file, exit RsMapper.
Console.WriteLine("RsMapper cannot run without \'Components.json\'.");
Environment.Exit(1);
}
Directory.CreateDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RsMapper"));
DownloadProgress downloadProgress = new DownloadProgress("https://raw.githubusercontent.com/GreenJamesDev/RsMapper/master/RsMapper/Components.json", ComponentsJson);
downloadProgress.ShowDialog();
downloadProgress.Dispose();


}

Expand Down

0 comments on commit b879f40

Please sign in to comment.