Skip to content

Commit

Permalink
Add Prompt for notes
Browse files Browse the repository at this point in the history
Remove auto install - you have to hit install now
  • Loading branch information
Ciaran Fisher committed Jul 4, 2020
1 parent c09ab2d commit b553138
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 58 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
*.cpp text eol=crlf
*.cs text eol=crlf
*.xml text eol=crlf

*.xaml text eol=crlf
*.conf text eol=crlf
*.lua text eol=crlf
3 changes: 1 addition & 2 deletions DCS-SR-Client/Network/SRSClientSyncHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,7 @@ private void ShowVersionMistmatchWarning(string serverVersion)
MessageBox.Show($"The SRS server you're connecting to is incompatible with this Client. " +
$"\n\nMake sure to always run the latest version of the SRS Server & Client" +
$"\n\nServer Version: {serverVersion}" +
$"\nClient Version: {UpdaterChecker.VERSION}" +
$"\nMinimum Version: {UpdaterChecker.MINIMUM_PROTOCOL_VERSION}",
$"\nClient Version: {UpdaterChecker.VERSION}",
"SRS Server Incompatible",
MessageBoxButton.OK,
MessageBoxImage.Error);
Expand Down
4 changes: 2 additions & 2 deletions DCS-SR-Client/Singletons/AudioInputSingleton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ private List<AudioDeviceListItem> BuildAudioInputs()
{
var input = new AudioDeviceListItem()
{
Text = item.DeviceFriendlyName,
Text = item.FriendlyName,
Value = item
};
inputs.Add(input);

Logger.Info("Audio Input - " + item.DeviceFriendlyName + " " + item.ID.ToString() + " - Name GUID" +
Logger.Info("Audio Input - " + item.FriendlyName + " " + item.ID.ToString() + " - Name GUID" +
item.FriendlyName);

if (item.ID.Trim().Equals(GlobalSettingsStore.Instance.GetClientSetting(GlobalSettingsKeys.AudioInputDeviceId).RawValue.Trim()))
Expand Down
91 changes: 39 additions & 52 deletions Installer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,6 @@ public MainWindow()
SetupLogging();
InitializeComponent();

if (IsDCSRunning())
{
MessageBox.Show(
"DCS must now be closed before continuing the installation!\n\nClose DCS and please try again.",
"Please Close DCS",
MessageBoxButton.OK, MessageBoxImage.Error);

Logger.Warn("DCS is Running - Installer quit");

Environment.Exit(0);

return;
}

var assembly = Assembly.GetExecutingAssembly();
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
Expand Down Expand Up @@ -95,39 +82,6 @@ public MainWindow()
ListFiles(_currentDirectory);
Logger.Info("Finished Listing Files / Directories");

new Action(async () =>
{
await Task.Delay(1).ConfigureAwait(false);
if (((App)Application.Current).Arguments.Length > 0)
{
if (((App)Application.Current).Arguments[0].Equals("-autoupdate"))
{
Application.Current.Dispatcher?.Invoke(() =>
{
Logger.Info("Silent Installer Running");
var result = MessageBox.Show(
"Do you want to install the SRS Scripts required for the SRS Client to DCS?\n\nThis scripts are NOT required if you plan to just host a Server on this machine or use SRS without DCS. \n\nEAM mode can be used to use SRS with any game",
"Install Scripts?",
MessageBoxButton.YesNo, MessageBoxImage.Information);
if (result == MessageBoxResult.Yes)
{
InstallScriptsCheckbox.IsChecked = true;
}
else
{
InstallScriptsCheckbox.IsChecked = false;
}
InstallReleaseButton(null, null);
}
); //end-invoke
}
}
}).Invoke();

if (!CheckExtracted())
{

Expand All @@ -143,6 +97,15 @@ public MainWindow()
return;
}

var releaseNotes = MessageBox.Show(
"Do you want to read the release notes? \n\nHighly recommended! \n\n",
"Read Release Notes?",
MessageBoxButton.YesNo, MessageBoxImage.Information);

if (releaseNotes == MessageBoxResult.Yes)
{
Process.Start("https://github.com/ciribob/DCS-SimpleRadioStandalone/releases/latest");
}
}

private bool CheckExtracted()
Expand Down Expand Up @@ -200,8 +163,19 @@ private void SetupLogging()

}

private void ShowDCSWarning()
{

MessageBox.Show(
"DCS must now be closed before continuing the install or uninstall!\n\nClose DCS and please try again.",
"Please Close DCS",
MessageBoxButton.OK, MessageBoxImage.Error);

}

private async void InstallReleaseButton(object sender, RoutedEventArgs e)
{

var dcScriptsPath = dcsScriptsPath.Text;
if ((bool)!InstallScriptsCheckbox.IsChecked)
{
Expand All @@ -214,12 +188,17 @@ private async void InstallReleaseButton(object sender, RoutedEventArgs e)
if (paths.Count == 0)
{
MessageBox.Show(
"Unable to find DCS Folder in Saved Games!\n\nPlease check the path to the \"Saved Games\" folder\n\nMake sure you are selecting the \"Saved Games\" folder - NOT the DCS folder inside \"Saved Games\" and NOT the DCS installation directory",
"SR Standalone Installer",
MessageBoxButton.OK, MessageBoxImage.Error);
"Unable to find DCS Folder in Saved Games!\n\nPlease check the path to the \"Saved Games\" folder\n\nMake sure you are selecting the \"Saved Games\" folder - NOT the DCS folder inside \"Saved Games\" and NOT the DCS installation directory",
"SR Standalone Installer",
MessageBoxButton.OK, MessageBoxImage.Error);
return;
}

if (IsDCSRunning())
{
ShowDCSWarning();
return;
}

}

InstallButton.IsEnabled = false;
Expand Down Expand Up @@ -255,9 +234,9 @@ private async void InstallReleaseButton(object sender, RoutedEventArgs e)
_progressBarDialog.UpdateProgress(true, "Installed SRS Successfully!");
Logger.Info($"Installed SRS Successfully!");
//open to installation location
Process.Start("explorer.exe", srPath.Text);
// Process.Start("explorer.exe", srPath.Text);
Environment.Exit(0);
}
else
Expand Down Expand Up @@ -1085,6 +1064,14 @@ private async void Remove_Plugin(object sender, RoutedEventArgs e)
dcsScriptsPath.Text = "";
Logger.Info($"SRS Scripts path not valid - ignoring uninstall of scripts: {dcsScriptsPath.Text}");
}
else
{
if (IsDCSRunning())
{
ShowDCSWarning();
return;
}
}

_progressBarDialog = new ProgressBarDialog();
_progressBarDialog.Owner = this;
Expand Down
2 changes: 1 addition & 1 deletion SRS-Lua-Wrapper/SRS-Lua-Wrapper.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
Expand Down

0 comments on commit b553138

Please sign in to comment.