diff --git a/Application/FileConverter/Helpers.cs b/Application/FileConverter/Helpers.cs index 8ace615..1640483 100644 --- a/Application/FileConverter/Helpers.cs +++ b/Application/FileConverter/Helpers.cs @@ -21,6 +21,84 @@ namespace FileConverter public static class Helpers { + public static readonly string[] CompatibleInputExtensions = { + "3gp","aac","aiff","ape","arw","avi","bik","bmp","cda","cr2","dng","doc","docx","exr", + "flac","flv","gif","ico","jpg","jpeg","m4a","m4v","mkv","mov","mp3","mp4","mpeg","nef", + "odp","ods","odt","oga","ogg","ogv","pdf","png","ppt","pptx","psd","raf","svg", + "tga","tif","tiff","vob","wav","webm","webp","wma","wmv","xls","xlsx" + }; + + public static string GetExtensionCategory(string extension) + { + switch (extension) + { + case "aac": + case "aiff": + case "ape": + case "cda": + case "flac": + case "mp3": + case "m4a": + case "oga": + case "ogg": + case "wav": + case "wma": + return InputCategoryNames.Audio; + + case "3gp": + case "avi": + case "bik": + case "flv": + case "m4v": + case "mp4": + case "mpeg": + case "mov": + case "mkv": + case "ogv": + case "vob": + case "webm": + case "wmv": + return InputCategoryNames.Video; + + case "arw": + case "bmp": + case "cr2": + case "dng": + case "exr": + case "ico": + case "jpg": + case "jpeg": + case "nef": + case "png": + case "psd": + case "raf": + case "tga": + case "tif": + case "tiff": + case "svg": + case "xcf": + case "webp": + return InputCategoryNames.Image; + + case "gif": + return InputCategoryNames.AnimatedImage; + + case "pdf": + case "doc": + case "docx": + case "ppt": + case "pptx": + case "odp": + case "ods": + case "odt": + case "xls": + case "xlsx": + return InputCategoryNames.Document; + } + + return InputCategoryNames.Misc; + } + public static bool RegisterShellExtension(string shellExtensionPath) { if (!Application.IsInAdmininstratorPrivileges) @@ -122,77 +200,6 @@ namespace FileConverter } } - public static string GetExtensionCategory(string extension) - { - switch (extension) - { - case "aac": - case "aiff": - case "ape": - case "cda": - case "flac": - case "mp3": - case "m4a": - case "oga": - case "ogg": - case "wav": - case "wma": - return InputCategoryNames.Audio; - - case "3gp": - case "avi": - case "bik": - case "flv": - case "m4v": - case "mp4": - case "mpeg": - case "mov": - case "mkv": - case "ogv": - case "vob": - case "webm": - case "wmv": - return InputCategoryNames.Video; - - case "arw": - case "bmp": - case "cr2": - case "dng": - case "exr": - case "ico": - case "jpg": - case "jpeg": - case "nef": - case "png": - case "psd": - case "raf": - case "tga": - case "tif": - case "tiff": - case "svg": - case "xcf": - case "webp": - return InputCategoryNames.Image; - - case "gif": - return InputCategoryNames.AnimatedImage; - - case "pdf": - case "doc": - case "docx": - case "ppt": - case "pptx": - case "odp": - case "ods": - case "odt": - case "xls": - case "xlsx": - return InputCategoryNames.Document; - } - - return InputCategoryNames.Misc; - } - public static bool IsOutputTypeCompatibleWithCategory(OutputType outputType, string category) { if (category == InputCategoryNames.Misc) diff --git a/Application/FileConverter/ViewModels/SettingsViewModel.cs b/Application/FileConverter/ViewModels/SettingsViewModel.cs index f0e4b56..7dbe7d2 100644 --- a/Application/FileConverter/ViewModels/SettingsViewModel.cs +++ b/Application/FileConverter/ViewModels/SettingsViewModel.cs @@ -395,26 +395,10 @@ namespace FileConverter.ViewModels private void InitializeCompatibleInputExtensions() { - RegistryKey registryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\FileConverter"); - if (registryKey == null) - { - MessageBox.Show("Can't retrieve the list of compatible input extensions. (code 0x09)", "Error", MessageBoxButton.OK, MessageBoxImage.Error); - return; - } - - string registryValue = registryKey.GetValue("CompatibleInputExtensions") as string; - if (registryValue == null) - { - MessageBox.Show("Can't retrieve the list of compatible input extensions. (code 0x0A)", "Error", MessageBoxButton.OK, MessageBoxImage.Error); - return; - } - - string[] compatibleInputExtensions = registryValue.Split(';'); - List categories = new List(); - for (int index = 0; index < compatibleInputExtensions.Length; index++) + for (int index = 0; index < Helpers.CompatibleInputExtensions.Length; index++) { - string compatibleInputExtension = compatibleInputExtensions[index]; + string compatibleInputExtension = Helpers.CompatibleInputExtensions[index]; string extensionCategory = Helpers.GetExtensionCategory(compatibleInputExtension); InputExtensionCategory category = categories.Find(match => match.Name == extensionCategory); if (category == null) diff --git a/Installer/Product.wxs b/Installer/Product.wxs index f920f5d..a633cc3 100644 --- a/Installer/Product.wxs +++ b/Installer/Product.wxs @@ -168,7 +168,6 @@ -