Exemplo n.º 1
0
        private Dictionary <string, string> PopulateEnvironment(string extractPath)
        {
            Dictionary <string, string> bindings = new Dictionary <string, string>();

            string[] files   = Directory.GetFiles(extractPath, Constants._BTDF_SETTINGSFILENAMEFILTER, SearchOption.AllDirectories);
            string[] fileESE = Directory.GetFiles(extractPath, "EnvironmentSettingsExporter.exe", SearchOption.AllDirectories);

            if (fileESE.Count() > 0 && files.Count() > 0)
            {
                string settingFileDirectory = Path.GetDirectoryName(files[0]);
                string result = "";
                BTDFDeployHelper.ExecuteEnvironmentSettingsExporter(fileESE[0].Encode(), files[0].Encode() + " " + settingFileDirectory.Encode(), out result);
                string[]  envFiles = Directory.GetFiles(settingFileDirectory);
                ArrayList myArr    = new ArrayList();
                foreach (string envFile in envFiles)
                {
                    myArr.Add(envFile);
                }
                myArr.Remove(files[0]);
                foreach (string envFile in myArr)
                {
                    bindings.Add(Path.GetFileNameWithoutExtension(envFile), envFile);
                }
                cbTargetEnvironment.DataSource    = new BindingSource(bindings, null);
                cbTargetEnvironment.DisplayMember = "Key";
                cbTargetEnvironment.ValueMember   = "Value";
            }
            else
            {
                cbTargetEnvironment.DataSource = null;
                DisplayMessage(string.Format("Can not find a valid SettingsFileGenerator. There are {0} SettingsFileGenerator files present ", files.Count()));
            }
            return(bindings);
        }
Exemplo n.º 2
0
        private string ExtractBTDFMsi(string fileToOpen)
        {
            string appNamefromMsi = Path.GetFileNameWithoutExtension(fileToOpen);
            string extractPath    = Path.Combine(GenericHelper.GetTempFolder(Environment.MachineName), System.Guid.NewGuid().ToString());
            string result         = "";
            string args           = string.Format(@"/a ""{0}"" /qn TARGETDIR=""{1}"" REINSTALLMODE=amus", fileToOpen, extractPath);

            BTDFDeployHelper.ExecuteMsiExecTask(args, out result);
            return(extractPath);
        }
Exemplo n.º 3
0
        private void ExtractSettings(string extractPath)
        {
            string[] files   = Directory.GetFiles(extractPath, Constants._BTDF_SETTINGSFILENAMEFILTER, SearchOption.AllDirectories);
            string[] fileESE = Directory.GetFiles(extractPath, "EnvironmentSettingsExporter.exe", SearchOption.AllDirectories);

            if (fileESE.Count() > 0 && files.Count() > 0)
            {
                string settingFileDirectory = Path.GetDirectoryName(files[0]);
                string result = "";
                BTDFDeployHelper.ExecuteEnvironmentSettingsExporter(fileESE[0].Encode(), files[0].Encode() + " " + settingFileDirectory.Encode(), out result);
            }
            else
            {
            }
        }