// ReSharper disable once InconsistentNaming private static bool IsLINQPadInstalled(string vsVersion) { var currentInstalledVersionPath = CommonRegistryConfigurations.GetLINQPadInstallationPath(vsVersion); var alreadyInstalled = !string.IsNullOrEmpty(currentInstalledVersionPath); if (alreadyInstalled && Directory.Exists(currentInstalledVersionPath)) { return(true); } //otherwise set it up manually if (Directory.Exists(CommonFolderPaths.LinqPad5DestinationFolder)) { CommonRegistryConfigurations.SetLINQPadInstallationPath(vsVersion, CommonFolderPaths.LinqPad5DestinationFolder); return(true); } if (Directory.Exists(CommonFolderPaths.LinqPad4DestinationFolder)) { CommonRegistryConfigurations.SetLINQPadInstallationPath(vsVersion, CommonFolderPaths.LinqPad4DestinationFolder); return(true); } DialogResult result = MessageBox.Show("Please Install LINQPad and then Restart Visual Studio or provide a folder", "LINQPad Not Found", MessageBoxButtons.OKCancel); if (result == DialogResult.OK) { OpenFileDialog dialog = new OpenFileDialog() { Multiselect = false, Filter = "LINQPad 4, 5|*.exe", InitialDirectory = CommonFolderPaths.ProgramFilesFolderPath }; DialogResult dialogResult = dialog.ShowDialog(); bool isLinqPadFound = dialogResult == DialogResult.OK && dialog.FileName.Contains("LINQPad.exe"); if (!isLinqPadFound) { //how much do I love prohibitive things... goto openWebSite; } string linqPadDirectoryName = Path.GetDirectoryName(dialog.FileName); if (string.IsNullOrEmpty(linqPadDirectoryName)) { throw new Exception("LINQPad file name not correct"); } CommonRegistryConfigurations.SetLINQPadInstallationPath(vsVersion, linqPadDirectoryName); return(true); } openWebSite: System.Diagnostics.Process.Start("http://www.linqpad.net"); return(false); }