Skip to content

Commit

Permalink
Added detection for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
Gurrenm3 authored and Gurrenm3 committed Aug 31, 2020
1 parent d8757f0 commit e9ee447
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
15 changes: 13 additions & 2 deletions MainWindow.xaml.cs
Expand Up @@ -3,6 +3,7 @@
using BTD_Backend.Persistence;
using BTD_Backend.Web;
using BTD6_Mod_Manager.Classes;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.ComponentModel;
Expand Down Expand Up @@ -35,7 +36,17 @@ public partial class MainWindow : Window
public static MainWindow instance;
public MainWindow()
{
InitializeComponent();
if (Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\14.0\VC\Runtimes") != null ||
Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\DevDiv\vc\Servicing\14.0\RuntimeAdditional") != null) // basically checks for x64 vc redist
{
InitializeComponent();
}
else
{
MessageBox.Show("You do not have the x64 Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 installed. Clicking OK will bring you to the direct download link. Mods will not work without it.", "Error!");
Process.Start("https://aka.ms/vs/16/release/vc_redist.x64.exe");
}

SessionData.CurrentGame = GameType.BTD6;
Log.MessageLogged += Log_MessageLogged;

Expand Down Expand Up @@ -89,7 +100,7 @@ private void Main_Loaded(object sender, RoutedEventArgs e)
ProjectExePath = Environment.CurrentDirectory + "\\BTD6 Mod Manager.exe",
InstallDirectory = Environment.CurrentDirectory,
ProjectName = "BTD6 Mod Manager",
UpdatedZipName = "BTD6 Mod Manager.zip"
UpdatedZipName = "BTD6_Mod_Manager.zip"
};

Thread updater = new Thread(() => update.HandleUpdates(false));
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
4 changes: 2 additions & 2 deletions UserControls/Mods_UserControl.xaml.cs
Expand Up @@ -39,7 +39,7 @@ public void PopulateMods(GameType game)
modItems = new List<ModItem_UserControl>();

var mods = new DirectoryInfo(modsDir).GetFiles("*.*");
List<string> fileExtensions = new List<string>() { ".jet", ".zip", ".rar", ".7z", ".btd6mod" };
List<string> fileExtensions = new List<string>() { ".jet", ".zip", ".rar", ".7z", ".btd6mod", ".dll", ".chai" };

foreach (var mod in mods)
{
Expand Down Expand Up @@ -186,7 +186,7 @@ private void AddMods_Button_Click(object sender, RoutedEventArgs e)
MainWindow.doingWork = true;
MainWindow.workType = "Adding mods";

string allModTypes = "All Mod Types|*.jet;*.zip;*.rar;*.7z;*.btd6mod";
string allModTypes = "All Mod Types|*.jet;*.zip;*.rar;*.7z;*.btd6mod;*.dll;*.chai";
List<string> mods = FileIO.BrowseForFiles("Browse for mods", "", allModTypes + "|Jet files (*.jet)|*.jet|Zip files (*.zip)|*.zip|Rar files (*.rar)|*.rar|7z files (*.7z)|*.7z|BTD6 Mods (*.btd6mod)|*.btd6mod", "");

if (mods == null || mods.Count == 0)
Expand Down
1 change: 0 additions & 1 deletion Windows/DevManager.xaml
Expand Up @@ -20,7 +20,6 @@
<Button x:Name="AutoUpdate_MoreInfo_Button" Content="More Info?" Click="AutoUpdate_MoreInfo_Button_Click" HorizontalAlignment="Left" Margin="97,87,0,0" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="AutoUpdate_TextBox" HorizontalAlignment="Left" Height="28" Margin="259,62,0,0" TextWrapping="Wrap" HorizontalScrollBarVisibility="Auto" VerticalAlignment="Top" Width="461" Background="White" Foreground="Black" FontSize="18"/>
<Button x:Name="AutoUpdate_Browse_Button" Content="Browse" Click="AutoUpdate_Browse_Button_Click" ToolTip="Select the file you want to watch for changes." HorizontalAlignment="Left" Margin="725,62,0,0" VerticalAlignment="Top" Width="50" Height="28"/>
<Button x:Name="Close_Button" Content="Close" Click="Close_Button_Click" HorizontalAlignment="Left" Margin="630,361,0,0" VerticalAlignment="Top" Width="130" Height="38"/>
<Button x:Name="CheckForChanges_Button" Content="Begin Checking for Changes" ToolTip="This will start the process of checking for changes in your mod" HorizontalAlignment="Left" Margin="576,95,0,0" VerticalAlignment="Top" Width="199" Click="CheckForChanges_Button_Click"/>

</Grid>
Expand Down

0 comments on commit e9ee447

Please sign in to comment.