Example #1
0
        public FinishSheet(WizardForm creator)
            : base(creator)
        {
            string title = "Finished Wizard";
            string description = "The WixEdit wizard finished creating the source for the MSI file. WixEdit allows you to customize the MSI.\r\n\r\nClick \"Finish\" to finish the WixEdit wizard and start customizing the MSI.";

            Initialize(title, description);
        }
Example #2
0
        public FinishSheet(WizardForm creator)
            : base(creator)
        {
            string title       = "Finished Wizard";
            string description = "The WixEdit wizard finished creating the source for the MSI file. WixEdit allows you to customize the MSI.\r\n\r\nClick \"Finish\" to finish the WixEdit wizard and start customizing the MSI.";

            Initialize(title, description);
        }
Example #3
0
        public StepSheet(XmlElement step, WizardForm creator) : base(creator)
        {
            this.stepElement = step;
            this.AutoScroll  = true;

            errorProvider = new ErrorProviderFixed();
            errorProvider.ContainerControl = this;
            errorProvider.AutoPopDelay     = 20000;
            errorProvider.BlinkStyle       = ErrorBlinkStyle.NeverBlink;
            Bitmap b = new Bitmap(WixFiles.GetResourceStream("bmp.info.bmp"));

            errorProvider.Icon = Icon.FromHandle(b.GetHicon());
        }
Example #4
0
        public StepSheet(XmlElement step, WizardForm creator)
            : base(creator)
        {
            this.stepElement = step;
            this.AutoScroll = true;

            errorProvider = new ErrorProviderFixed();
            errorProvider.ContainerControl = this;
            errorProvider.AutoPopDelay = 20000;
            errorProvider.BlinkStyle = ErrorBlinkStyle.NeverBlink;
            Bitmap b = new Bitmap(WixFiles.GetResourceStream("bmp.info.bmp"));
            errorProvider.Icon = Icon.FromHandle(b.GetHicon());
        }
Example #5
0
        public SelectTemplatesSheet(WizardForm creator)
            : base(creator)
        {
            this.AutoScroll = true;

            titleLabel = new Label();
            titleLabel.Text = "Select featues to add";
            titleLabel.Dock = DockStyle.Top;
            titleLabel.Height = 20;
            titleLabel.Left = 0;
            titleLabel.Top = 0;
            titleLabel.Padding = new Padding(5, 5, 5, 0);
            titleLabel.Font = new Font("Verdana",
                        10,
                        FontStyle.Bold,
                        GraphicsUnit.Point
                    );
            titleLabel.BackColor = Color.White;

            descriptionLabel = new Label();
            descriptionLabel.Text = "Select functionality you want to add to the installer";
            descriptionLabel.Dock = DockStyle.Top;
            descriptionLabel.Height = 50 - titleLabel.Height;
            descriptionLabel.Left = 0;
            descriptionLabel.Top = titleLabel.Height;
            descriptionLabel.Padding = new Padding(8, 3, 5, 0);
            descriptionLabel.BackColor = Color.White;

            this.Controls.Add(descriptionLabel);

            this.Controls.Add(titleLabel);

            lineLabel = new Label();
            lineLabel.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            lineLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            lineLabel.Location = new Point(0, titleLabel.Height + descriptionLabel.Height);
            lineLabel.Size = new Size(this.Width, 2);

            this.Controls.Add(lineLabel);

            checkList = new CheckedListBox();
            checkList.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;
            checkList.Location = new Point(4, lineLabel.Top + lineLabel.Height + 5);
            checkList.Width = this.Width - 8 - 190;
            checkList.Height = this.Height - checkList.Top - 5;
            checkList.DisplayMember = "Value";
            checkList.Sorted = true;
            checkList.SelectedIndexChanged += new EventHandler(checkList_SelectedIndexChanged);

            this.Controls.Add(checkList);

            templateDescriptionGroupBox = new GroupBox();
            templateDescriptionGroupBox.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            templateDescriptionGroupBox.Location = new Point(checkList.Width + 12, checkList.Top);
            templateDescriptionGroupBox.Width = 190 - 8;
            templateDescriptionGroupBox.Height = checkList.Height;
            templateDescriptionGroupBox.Text = "Description";

            this.Controls.Add(templateDescriptionGroupBox);

            templateDescriptionPanel = new Panel();
            templateDescriptionPanel.Dock = DockStyle.Fill;
            templateDescriptionPanel.AutoScroll = true;
            templateDescriptionGroupBox.Controls.Add(templateDescriptionPanel);

            templateDescriptionLabel = new Label();
            //templateDescriptionLabel.Width = templateDescriptionPanel.Width;
            templateDescriptionLabel.Dock = DockStyle.Fill;
            templateDescriptionLabel.Text = "";
            templateDescriptionLabel.Visible = false;

            templateDescriptionPanel.Controls.Add(templateDescriptionLabel);

            this.Resize += new EventHandler(SelectTemplatesSheet_Resize);

            DirectoryInfo oldTemplateDir = null;
            DirectoryInfo templateDir = null;

            if (!String.IsNullOrEmpty(WixEditSettings.Instance.TemplateDirectory))
            {
                oldTemplateDir = new DirectoryInfo(WixEditSettings.Instance.TemplateDirectory);
                templateDir = new DirectoryInfo(Path.Combine(oldTemplateDir.Parent.FullName, "wizard"));
            }

            if (templateDir != null &&
                templateDir.Exists)
            {
                FileInfo[] files = templateDir.GetFiles("template.xml", SearchOption.AllDirectories);

                foreach (FileInfo file in files)
                {
                    if (file.Directory.Parent.FullName == templateDir.FullName)
                    {
                        string title = file.Directory.Name;

                        XmlDocument doc = new XmlDocument();
                        XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);

                        doc.Load(file.FullName);
                        XmlElement template = (XmlElement)doc.SelectSingleNode("/Template");

                        checkList.Items.Add(template.Attributes["Title"]);
                    }
                }
            }
            else
            {
                StringBuilder message = new StringBuilder("Directory containing the templates could not be found. Please reinstall WixEdit.");
                if (templateDir != null)
                {
                    message.AppendFormat("\r\n\r\nDirectory:\r\n{0}", templateDir.FullName);
                }

                MessageBox.Show(message.ToString(), "Templates not found");
            }
        }
Example #6
0
        public BaseSheet(WizardForm creator)
        {
            wizard = creator;

            InitializeComponent();
        }
Example #7
0
        public FileSheet(WizardForm creator)
            : base(creator)
        {
            this.AutoScroll = true;

            titleLabel         = new Label();
            titleLabel.Text    = "Add files and folders to install.";
            titleLabel.Dock    = DockStyle.Top;
            titleLabel.Height  = 20;
            titleLabel.Left    = 0;
            titleLabel.Top     = 0;
            titleLabel.Padding = new Padding(5, 5, 5, 0);
            titleLabel.Font    = new Font("Verdana",
                                          10,
                                          FontStyle.Bold,
                                          GraphicsUnit.Point
                                          );
            titleLabel.BackColor = Color.White;

            descriptionLabel           = new Label();
            descriptionLabel.Text      = "Select Files and Directories you want to add to the installer";
            descriptionLabel.Dock      = DockStyle.Top;
            descriptionLabel.Height    = 50 - titleLabel.Height;
            descriptionLabel.Left      = 0;
            descriptionLabel.Top       = titleLabel.Height;
            descriptionLabel.Padding   = new Padding(8, 3, 5, 0);
            descriptionLabel.BackColor = Color.White;

            this.Controls.Add(descriptionLabel);

            this.Controls.Add(titleLabel);


            lineLabel             = new Label();
            lineLabel.Anchor      = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            lineLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            lineLabel.Location    = new Point(0, titleLabel.Height + descriptionLabel.Height);
            lineLabel.Size        = new Size(this.Width, 2);

            this.Controls.Add(lineLabel);

            tree = new TreeView();
            tree.HideSelection = false;
            tree.Anchor        = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            tree.Location      = new Point(4, titleLabel.Height + descriptionLabel.Height + lineLabel.Height + 5);
            tree.Width         = this.Width - 8 - 100 - 8;
            tree.Height        = this.Height - tree.Top - 7;
            tree.ImageList     = ImageListFactory.GetImageList();
            tree.MouseDown    += new MouseEventHandler(tree_MouseDown);

            this.Controls.Add(tree);

            newFolderButton          = new Button();
            newFolderButton.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
            newFolderButton.Location = new Point(tree.Location.X + tree.Width + 8, tree.Top);
            newFolderButton.Width    = 100;
            newFolderButton.Height   = 23;
            newFolderButton.Text     = "New folder";
            newFolderButton.Click   += new EventHandler(newFolderButton_Click);

            this.Controls.Add(newFolderButton);

            removeButton          = new Button();
            removeButton.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
            removeButton.Location = new Point(tree.Location.X + tree.Width + 8, newFolderButton.Bottom + 8);
            removeButton.Width    = 100;
            removeButton.Height   = 23;
            removeButton.Text     = "Remove folder";
            removeButton.Click   += new EventHandler(removeButton_Click);

            this.Controls.Add(removeButton);

            importDirectoryButton          = new Button();
            importDirectoryButton.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
            importDirectoryButton.Location = new Point(tree.Location.X + tree.Width + 8, removeButton.Bottom + 8);
            importDirectoryButton.Width    = 100;
            importDirectoryButton.Height   = 23;
            importDirectoryButton.Text     = "Import directory";
            importDirectoryButton.Click   += new EventHandler(importDirectoryButton_Click);

            this.Controls.Add(importDirectoryButton);

            importFilesButton          = new Button();
            importFilesButton.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
            importFilesButton.Location = new Point(tree.Location.X + tree.Width + 8, importDirectoryButton.Bottom + 8);
            importFilesButton.Width    = 100;
            importFilesButton.Height   = 23;
            importFilesButton.Text     = "Import files";
            importFilesButton.Click   += new EventHandler(importFilesButton_Click);

            this.Controls.Add(importFilesButton);

            contextMenu        = new ContextMenu();
            contextMenu.Popup += new EventHandler(contextMenu_Popup);
            // tree.ContextMenu = contextMenu;

            importFilesMenuItem        = new IconMenuItem("&Import Files", new Bitmap(WixFiles.GetResourceStream("bmp.import.bmp")));
            importFilesMenuItem.Click += new System.EventHandler(importFilesMenuItem_Click);
            contextMenu.MenuItems.Add(importFilesMenuItem);

            newFolderMenuItem        = new IconMenuItem("&New Folder", new Bitmap(WixFiles.GetResourceStream("bmp.new.bmp")));
            newFolderMenuItem.Click += new System.EventHandler(newFolderMenuItem_Click);
            contextMenu.MenuItems.Add(newFolderMenuItem);

            importFolderMenuItem        = new IconMenuItem("&Import Folder", new Bitmap(WixFiles.GetResourceStream("bmp.import.bmp")));
            importFolderMenuItem.Click += new System.EventHandler(importFolderMenuItem_Click);
            contextMenu.MenuItems.Add(importFolderMenuItem);

            newSpecialFolderMenuItem = new IconMenuItem("New Special Folder", new Bitmap(WixFiles.GetResourceStream("bmp.new.bmp")));
            foreach (string specialFolder in specialFolders)
            {
                IconMenuItem subItem = new IconMenuItem(specialFolder);
                subItem.Click += new EventHandler(specialFolderSubItem_Click);
                newSpecialFolderMenuItem.MenuItems.Add(subItem);
            }
            contextMenu.MenuItems.Add(newSpecialFolderMenuItem);

            newComponentMenuItem        = new IconMenuItem("New Component", new Bitmap(WixFiles.GetResourceStream("bmp.new.bmp")));
            newComponentMenuItem.Click += new EventHandler(newComponentMenuItem_Click);
            contextMenu.MenuItems.Add(newComponentMenuItem);

            deleteMenuItem        = new IconMenuItem("&Delete", new Bitmap(WixFiles.GetResourceStream("bmp.delete.bmp")));
            deleteMenuItem.Click += new EventHandler(deleteMenuItem_Click);
            contextMenu.MenuItems.Add(deleteMenuItem);


            XmlDocument         wxsDoc   = Wizard.WixFiles.WxsDocument;
            XmlNamespaceManager wxsNsmgr = Wizard.WixFiles.WxsNsmgr;

            XmlNodeList        dirNodes  = wxsDoc.SelectNodes("/wix:Wix/*/wix:Directory", wxsNsmgr);
            TreeNodeCollection treeNodes = tree.Nodes;

            InitTreeView(dirNodes);
        }
Example #8
0
        public BaseSheet(WizardForm creator)
        {
            wizard = creator;

            InitializeComponent();
        }
Example #9
0
 public IntroductionSheet(string title, string description, WizardForm creator)
     : base(creator)
 {
     Initialize(title, description);
 }
Example #10
0
 public IntroductionSheet(XmlElement template, WizardForm creator)
     : base(creator)
 {
     Initialize(template.GetAttribute("Title"), template.GetAttribute("Description"));
 }
Example #11
0
 public IntroductionSheet(string title, string description, WizardForm creator)
     : base(creator)
 {
     Initialize(title, description);
 }
Example #12
0
 public IntroductionSheet(XmlElement template, WizardForm creator)
     : base(creator)
 {
     Initialize(template.GetAttribute("Title"), template.GetAttribute("Description"));
 }
Example #13
0
        public FileSheet(WizardForm creator)
            : base(creator)
        {
            this.AutoScroll = true;

            titleLabel = new Label();
            titleLabel.Text = "Add files and folders to install.";
            titleLabel.Dock = DockStyle.Top;
            titleLabel.Height = 20;
            titleLabel.Left = 0;
            titleLabel.Top = 0;
            titleLabel.Padding = new Padding(5, 5, 5, 0);
            titleLabel.Font = new Font("Verdana",
                        10,
                        FontStyle.Bold,
                        GraphicsUnit.Point
                    );
            titleLabel.BackColor = Color.White;

            descriptionLabel = new Label();
            descriptionLabel.Text = "Select Files and Directories you want to add to the installer";
            descriptionLabel.Dock = DockStyle.Top;
            descriptionLabel.Height = 50 - titleLabel.Height;
            descriptionLabel.Left = 0;
            descriptionLabel.Top = titleLabel.Height;
            descriptionLabel.Padding = new Padding(8, 3, 5, 0);
            descriptionLabel.BackColor = Color.White;

            this.Controls.Add(descriptionLabel);

            this.Controls.Add(titleLabel);

            lineLabel = new Label();
            lineLabel.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            lineLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            lineLabel.Location = new Point(0, titleLabel.Height + descriptionLabel.Height);
            lineLabel.Size = new Size(this.Width, 2);

            this.Controls.Add(lineLabel);

            tree = new TreeView();
            tree.HideSelection = false;
            tree.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            tree.Location = new Point(4, titleLabel.Height + descriptionLabel.Height + lineLabel.Height + 5);
            tree.Width = this.Width - 8 - 100 - 8;
            tree.Height = this.Height - tree.Top - 7;
            tree.ImageList = ImageListFactory.GetImageList();
            tree.MouseDown += new MouseEventHandler(tree_MouseDown);

            this.Controls.Add(tree);

            newFolderButton = new Button();
            newFolderButton.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            newFolderButton.Location = new Point(tree.Location.X + tree.Width + 8, tree.Top);
            newFolderButton.Width = 100;
            newFolderButton.Height = 23;
            newFolderButton.Text = "New folder";
            newFolderButton.Click += new EventHandler(newFolderButton_Click);

            this.Controls.Add(newFolderButton);

            removeButton = new Button();
            removeButton.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            removeButton.Location = new Point(tree.Location.X + tree.Width + 8, newFolderButton.Bottom + 8);
            removeButton.Width = 100;
            removeButton.Height = 23;
            removeButton.Text = "Remove folder";
            removeButton.Click += new EventHandler(removeButton_Click);

            this.Controls.Add(removeButton);

            importDirectoryButton = new Button();
            importDirectoryButton.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            importDirectoryButton.Location = new Point(tree.Location.X + tree.Width + 8, removeButton.Bottom + 8);
            importDirectoryButton.Width = 100;
            importDirectoryButton.Height = 23;
            importDirectoryButton.Text = "Import directory";
            importDirectoryButton.Click += new EventHandler(importDirectoryButton_Click);

            this.Controls.Add(importDirectoryButton);

            importFilesButton = new Button();
            importFilesButton.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            importFilesButton.Location = new Point(tree.Location.X + tree.Width + 8, importDirectoryButton.Bottom + 8);
            importFilesButton.Width = 100;
            importFilesButton.Height = 23;
            importFilesButton.Text = "Import files";
            importFilesButton.Click += new EventHandler(importFilesButton_Click);

            this.Controls.Add(importFilesButton);

            contextMenu = new ContextMenu();
            contextMenu.Popup += new EventHandler(contextMenu_Popup);
            // tree.ContextMenu = contextMenu;

            importFilesMenuItem = new IconMenuItem("&Import Files", new Bitmap(WixFiles.GetResourceStream("bmp.import.bmp")));
            importFilesMenuItem.Click += new System.EventHandler(importFilesMenuItem_Click);
            contextMenu.MenuItems.Add(importFilesMenuItem);

            newFolderMenuItem = new IconMenuItem("&New Folder", new Bitmap(WixFiles.GetResourceStream("bmp.new.bmp")));
            newFolderMenuItem.Click += new System.EventHandler(newFolderMenuItem_Click);
            contextMenu.MenuItems.Add(newFolderMenuItem);

            importFolderMenuItem = new IconMenuItem("&Import Folder", new Bitmap(WixFiles.GetResourceStream("bmp.import.bmp")));
            importFolderMenuItem.Click += new System.EventHandler(importFolderMenuItem_Click);
            contextMenu.MenuItems.Add(importFolderMenuItem);

            newSpecialFolderMenuItem = new IconMenuItem("New Special Folder", new Bitmap(WixFiles.GetResourceStream("bmp.new.bmp")));
            foreach (string specialFolder in specialFolders)
            {
                IconMenuItem subItem = new IconMenuItem(specialFolder);
                subItem.Click += new EventHandler(specialFolderSubItem_Click);
                newSpecialFolderMenuItem.MenuItems.Add(subItem);
            }
            contextMenu.MenuItems.Add(newSpecialFolderMenuItem);

            newComponentMenuItem = new IconMenuItem("New Component", new Bitmap(WixFiles.GetResourceStream("bmp.new.bmp")));
            newComponentMenuItem.Click += new EventHandler(newComponentMenuItem_Click);
            contextMenu.MenuItems.Add(newComponentMenuItem);

            deleteMenuItem = new IconMenuItem("&Delete", new Bitmap(WixFiles.GetResourceStream("bmp.delete.bmp")));
            deleteMenuItem.Click += new EventHandler(deleteMenuItem_Click);
            contextMenu.MenuItems.Add(deleteMenuItem);

            XmlDocument wxsDoc = Wizard.WixFiles.WxsDocument;
            XmlNamespaceManager wxsNsmgr = Wizard.WixFiles.WxsNsmgr;

            XmlNodeList dirNodes = wxsDoc.SelectNodes("/wix:Wix/*/wix:Directory", wxsNsmgr);
            TreeNodeCollection treeNodes = tree.Nodes;

            InitTreeView(dirNodes);
        }
Example #14
0
        public SelectTemplatesSheet(WizardForm creator)
            : base(creator)
        {
            this.AutoScroll = true;

            titleLabel         = new Label();
            titleLabel.Text    = "Select featues to add";
            titleLabel.Dock    = DockStyle.Top;
            titleLabel.Height  = 20;
            titleLabel.Left    = 0;
            titleLabel.Top     = 0;
            titleLabel.Padding = new Padding(5, 5, 5, 0);
            titleLabel.Font    = new Font("Verdana",
                                          10,
                                          FontStyle.Bold,
                                          GraphicsUnit.Point
                                          );
            titleLabel.BackColor = Color.White;

            descriptionLabel           = new Label();
            descriptionLabel.Text      = "Select functionality you want to add to the installer";
            descriptionLabel.Dock      = DockStyle.Top;
            descriptionLabel.Height    = 50 - titleLabel.Height;
            descriptionLabel.Left      = 0;
            descriptionLabel.Top       = titleLabel.Height;
            descriptionLabel.Padding   = new Padding(8, 3, 5, 0);
            descriptionLabel.BackColor = Color.White;

            this.Controls.Add(descriptionLabel);

            this.Controls.Add(titleLabel);


            lineLabel             = new Label();
            lineLabel.Anchor      = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            lineLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            lineLabel.Location    = new Point(0, titleLabel.Height + descriptionLabel.Height);
            lineLabel.Size        = new Size(this.Width, 2);

            this.Controls.Add(lineLabel);

            checkList                       = new CheckedListBox();
            checkList.Anchor                = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;
            checkList.Location              = new Point(4, lineLabel.Top + lineLabel.Height + 5);
            checkList.Width                 = this.Width - 8 - 190;
            checkList.Height                = this.Height - checkList.Top - 5;
            checkList.DisplayMember         = "Value";
            checkList.Sorted                = true;
            checkList.SelectedIndexChanged += new EventHandler(checkList_SelectedIndexChanged);

            this.Controls.Add(checkList);

            templateDescriptionGroupBox          = new GroupBox();
            templateDescriptionGroupBox.Anchor   = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            templateDescriptionGroupBox.Location = new Point(checkList.Width + 12, checkList.Top);
            templateDescriptionGroupBox.Width    = 190 - 8;
            templateDescriptionGroupBox.Height   = checkList.Height;
            templateDescriptionGroupBox.Text     = "Description";

            this.Controls.Add(templateDescriptionGroupBox);

            templateDescriptionPanel            = new Panel();
            templateDescriptionPanel.Dock       = DockStyle.Fill;
            templateDescriptionPanel.AutoScroll = true;
            templateDescriptionGroupBox.Controls.Add(templateDescriptionPanel);

            templateDescriptionLabel = new Label();
            //templateDescriptionLabel.Width = templateDescriptionPanel.Width;
            templateDescriptionLabel.Dock    = DockStyle.Fill;
            templateDescriptionLabel.Text    = "";
            templateDescriptionLabel.Visible = false;

            templateDescriptionPanel.Controls.Add(templateDescriptionLabel);

            this.Resize += new EventHandler(SelectTemplatesSheet_Resize);

            DirectoryInfo oldTemplateDir = null;
            DirectoryInfo templateDir    = null;

            if (!String.IsNullOrEmpty(WixEditSettings.Instance.TemplateDirectory))
            {
                oldTemplateDir = new DirectoryInfo(WixEditSettings.Instance.TemplateDirectory);
                templateDir    = new DirectoryInfo(Path.Combine(oldTemplateDir.Parent.FullName, "wizard"));
            }

            if (templateDir != null &&
                templateDir.Exists)
            {
                FileInfo[] files = templateDir.GetFiles("template.xml", SearchOption.AllDirectories);

                foreach (FileInfo file in files)
                {
                    if (file.Directory.Parent.FullName == templateDir.FullName)
                    {
                        string title = file.Directory.Name;

                        XmlDocument         doc   = new XmlDocument();
                        XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);

                        doc.Load(file.FullName);
                        XmlElement template = (XmlElement)doc.SelectSingleNode("/Template");

                        checkList.Items.Add(template.Attributes["Title"]);
                    }
                }
            }
            else
            {
                StringBuilder message = new StringBuilder("Directory containing the templates could not be found. Please reinstall WixEdit.");
                if (templateDir != null)
                {
                    message.AppendFormat("\r\n\r\nDirectory:\r\n{0}", templateDir.FullName);
                }

                MessageBox.Show(message.ToString(), "Templates not found");
            }
        }