private void FileBrowserSBExecutablePath_FilePathChanged(object sender, RoutedEventArgs e) { string path = FileBrowserSBExecutablePath.FilePath; if (SBController.VerifyExecutablePath(path)) { LabelExecutableNotLoaded.Visibility = Visibility.Collapsed; GridRequiredDll.IsEnabled = true; string sb_directory = Path.GetDirectoryName(path); GridRequiredDll.ItemsSource = SBController.GetRequiredDLLs(sb_directory); ButtonSetupFinish.IsEnabled = SBController.VerifySetup(FileBrowserSBExecutablePath.FilePath); } else { LabelExecutableNotLoaded.Visibility = Visibility.Visible; GridRequiredDll.IsEnabled = false; GridRequiredDll.ItemsSource = new List <SBRequiredDLL>(); ButtonSetupFinish.IsEnabled = false; } }
private async void ListLoadedDlls_RegisterRequiredDll(object sender, RoutedEventArgs e) { SBRequiredDLL required_dll = (SBRequiredDLL)GridRequiredDll.SelectedItem; if (required_dll.Status == DLLLoadedStatus.Registered) { return; } string quoted_dll_path = String.Format("\"{0}\"", required_dll.FullPath); ProcessStartInfo start_info = new ProcessStartInfo("regsvr32.exe", quoted_dll_path) { UseShellExecute = true, Verb = "runas" }; Process.Start(start_info); await Task.Delay(2000); GridRequiredDll.ItemsSource = SBController.GetRequiredDLLs(Path.GetDirectoryName(FileBrowserSBExecutablePath.FilePath)); ButtonSetupFinish.IsEnabled = SBController.VerifySetup(FileBrowserSBExecutablePath.FilePath); }