diff --git a/src/Paket.VisualStudio/Commands/AddPackageProcess.cs b/src/Paket.VisualStudio/Commands/AddPackageProcess.cs index e4f3a43bb..be50a2623 100644 --- a/src/Paket.VisualStudio/Commands/AddPackageProcess.cs +++ b/src/Paket.VisualStudio/Commands/AddPackageProcess.cs @@ -21,8 +21,7 @@ public static void ShowAddPackageDialog(string selectedFileName, string projectG } catch (Exception) { - var dir = new System.IO.FileInfo(SolutionExplorerExtensions.GetSolutionFileName()).Directory.FullName; - PaketLauncher.LaunchPaket(dir, "init", + PaketLauncher.LaunchPaket(SolutionExplorerExtensions.GetPaketDirectory(), "init", (send, args) => PaketOutputPane.OutputPane.OutputStringThreadSafe(args.Data + "\n")); dependenciesFile = Dependencies.Locate(selectedFileName); } diff --git a/src/Paket.VisualStudio/Utils/PaketLauncher.cs b/src/Paket.VisualStudio/Utils/PaketLauncher.cs index 333d977b5..0130cc2ff 100644 --- a/src/Paket.VisualStudio/Utils/PaketLauncher.cs +++ b/src/Paket.VisualStudio/Utils/PaketLauncher.cs @@ -34,10 +34,13 @@ private static int LaunchProcess(string SolutionDirectory, string FileName, stri public static void LaunchPaket(string SolutionDirectory, string PaketSubCommand, DataReceivedEventHandler PaketDataReceivedHandler) { - if (!File.Exists(SolutionDirectory + PAKET_EXE)) + var paketLocation = Path.Combine(SolutionDirectory, PAKET_EXE); + var paketBootstrapLocation = Path.Combine(SolutionDirectory, PAKET_BOOTSTRAPPER_EXE); + + if (!File.Exists(paketLocation)) { //If .paket\paket.exe is not found under the solution dir, try launching paket.bootstrapper.exe - if (File.Exists(SolutionDirectory + PAKET_BOOTSTRAPPER_EXE)) + if (File.Exists(paketBootstrapLocation)) { int ExitCode = LaunchProcess(SolutionDirectory, PAKET_BOOTSTRAPPER_EXE, "", PaketDataReceivedHandler); if (ExitCode != 0) @@ -77,4 +80,4 @@ public PaketRuntimeException(string message, Exception inner) { } } -} \ No newline at end of file +}