예제 #1
0
        private InstallablePackage GetPackage(string folder, out string installDirectory)
        {
            var dialog = new InstallDialog(folder);

            var hwnd = new IntPtr(VSPackage.DTE.MainWindow.HWnd);
            var window = (System.Windows.Window)HwndSource.FromHwnd(hwnd).RootVisual;
            dialog.Owner = window;

            var result = dialog.ShowDialog();

            installDirectory = folder;

            if (!result.HasValue || !result.Value)
            {
                return null;
            }

            installDirectory = dialog.InstallDirectory;

            return dialog.Package;
        }