コード例 #1
0
        public BrowseViewModel()
        {
            BrowseForInstalldir = new RelayCommand(() =>
            {
                InstallDirPath = BrowseForDirectory(InstallDirPath);
            });

            BrowseForSolutiondir = new RelayCommand(() =>
            {
                SolutionDirPath = BrowseForDirectory(SolutionDirPath);
            });

            GenerateXML = new RelayCommand(() =>
            {
                if (!ValidatePaths())
                {
                    return;
                }

                if (!SerializeXml())
                {
                    Working.ShowMessage("Something went wrong! Check Components.wxs file for details.");
                }
            });
        }
コード例 #2
0
        private bool ValidatePaths()
        {
            if (Directory.Exists(SolutionDirPath) == false)
            {
                Working.ShowMessage("Source files directory doesn't exists!\nCheck the path again.");
                return(false);
            }

            if (Directory.Exists(InstallDirPath) == false)
            {
                Working.ShowMessage("InstallDir directory doesn't exists!\nCheck the path again.");
                return(false);
            }

            if (Working.IsSubdirectory(SolutionDirPath, InstallDirPath) == false)
            {
                Working.ShowMessage("INSTALLDIR is not inside source files dir!\nCheck your paths again.");
                return(false);
            }

            return(true);
        }