Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
Add a check for Flash® ActiveX, bump assembly version
Browse files Browse the repository at this point in the history
KCV will now check if Adobe® Flash® Player ActiveX element is installed; if it isn't, the user will be presented with a message box prompting them to download it. On clicking “Yes”, KCV will close and spawn a Microsoft® Internet Explorer® window with the Adobe® Flash® download page.
  • Loading branch information
Yuubari committed Apr 2, 2015
1 parent b7f6dc0 commit d94a2c2
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
28 changes: 28 additions & 0 deletions Grabacr07.KanColleViewer/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Grabacr07.KanColleWrapper;
using Livet;
using MetroRadiance;
using Microsoft.Win32;
using AppSettings = Grabacr07.KanColleViewer.Properties.Settings;
using Settings = Grabacr07.KanColleViewer.Models.Settings;

Expand Down Expand Up @@ -81,6 +82,16 @@ protected override void OnStartup(StartupEventArgs e)
ViewModelRoot = new MainWindowViewModel();
this.MainWindow = new MainWindow { DataContext = ViewModelRoot };
this.MainWindow.Show();

// Check if Adobe Flash is installed in Microsoft Explorer
if (GetFlashVersion() == "")
{
MessageBoxResult MB = MessageBox.Show(KanColleViewer.Properties.Resources.System_Flash_Not_Installed_Text, KanColleViewer.Properties.Resources.System_Flash_Not_Installed_Caption, MessageBoxButton.YesNo, MessageBoxImage.Error, MessageBoxResult.Yes);
if (MB == MessageBoxResult.Yes) {
Process.Start("IExplore.exe", @"http://get.adobe.com/flashplayer/");
this.MainWindow.Close();
}
}
}

protected override void OnExit(ExitEventArgs e)
Expand Down Expand Up @@ -117,5 +128,22 @@ private static void ReportException(object sender, Exception exception)
Debug.WriteLine(ex);
}
}

/// <summary>
/// Obtains Adobe Flash Player's ActiveX element version.
/// </summary>
/// <returns>Empty string if Flash is not installed, otherwise the currently installed version.</returns>
private static string GetFlashVersion()
{
string sVersion = "";

RegistryKey FlashRK = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Macromedia\FlashPlayerActiveX");
if (FlashRK != null)
{
sVersion = FlashRK.GetValue("Version", "").ToString();
}

return sVersion;
}
}
}
2 changes: 1 addition & 1 deletion Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.6.1.4")]
[assembly: AssemblyVersion("3.6.1.8")]
18 changes: 18 additions & 0 deletions Grabacr07.KanColleViewer/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Grabacr07.KanColleViewer/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -912,4 +912,10 @@ Low: Performance over quality. Ugliest setting.</value>
<data name="SlotItemCatalog_ShowStats" xml:space="preserve">
<value>Show item stats</value>
</data>
<data name="System_Flash_Not_Installed_Caption" xml:space="preserve">
<value>Adobe Flash ActiveX Not Found</value>
</data>
<data name="System_Flash_Not_Installed_Text" xml:space="preserve">
<value>Adobe Flash for Microsoft Internet Explorer is required by KCV! but is not installed. Would you like to download and install it now?</value>
</data>
</root>

0 comments on commit d94a2c2

Please sign in to comment.