public static ProcessStartInfo BuildCommand(EpicData data, ProductData productData, EpicMode mode, bool staging)
        {
            ProcessStartInfo processStartInfo = new ProcessStartInfo();

            processStartInfo.WorkingDirectory = Path.GetDirectoryName(Path.GetFullPath(data.toolPath));
            processStartInfo.FileName         = "cmd.exe";

            string command = "/C " + Path.GetFileName(data.toolPath);

            AddParameter(ref command, ModeKey, mode.ToString());
            AddParameter(ref command, OrganisationKey, data.orgId);
            AddParameter(ref command, ProductKey, productData.prodId);
            AddParameter(ref command, ArtifactKey, staging ? productData.stagingArtId : productData.artId);
            AddParameter(ref command, ClientKey, data.clientId);
            AddParameter(ref command, SecretKey, data.secret);

            /*AddParameter(ref command, SecretKey, "Secret");
             * processStartInfo.EnvironmentVariables.Add("Secret", data.secret);
             * processStartInfo.UseShellExecute = false;*/
            processStartInfo.Arguments              = command;
            processStartInfo.CreateNoWindow         = true;
            processStartInfo.UseShellExecute        = false;
            processStartInfo.RedirectStandardOutput = true;
            return(processStartInfo);
        }
 private void SaveClick(object sender, RoutedEventArgs e)
 {
     App.saveData = new EpicData {
         toolPath = toolPathText.Text, orgId = orgText.Text, clientId = clientText.Text, secret = secretText.Text
     };
     EpicData.Save(App.saveData, "data");
 }
        public static ProcessStartInfo BuildDeleteCommand(EpicData epicData, ProductData productData, string version, bool staging)
        {
            ProcessStartInfo processStartInfo = BuildCommand(epicData, productData, EpicMode.DeleteBinary, staging);
            string           command          = "";

            AddParameter(ref command, BuildVersionKey, version);
            processStartInfo.Arguments += command;
            return(processStartInfo);
        }
        public static ProcessStartInfo BuildListCommand(EpicData epicData, ProductData productData, bool staging, string outputFile)
        {
            ProcessStartInfo processStartInfo = BuildCommand(epicData, productData, EpicMode.ListBinaries, staging);
            string           command          = "";

            AddParameter(ref command, OutputFileKey, outputFile);
            processStartInfo.Arguments += command;
            return(processStartInfo);
        }
 public App()
 {
     App.saveData    = EpicData.Load <EpicData>("data");
     App.productData = EpicData.Load <ObservableCollection <ProductData> >("products");
     if (App.productData == null)
     {
         App.productData = new ObservableCollection <ProductData>();
     }
 }
 private void RemoveProductClick(object sender, RoutedEventArgs e)
 {
     if (productList.SelectedValue == null)
     {
         return;
     }
     ProductData.Remove((ProductData)productList.SelectedValue);
     EpicData.Save(App.productData, "products");
 }
        public static ProcessStartInfo BuildUnlabelCommand(EpicData epicData, ProductData productData, LabelData labelData)
        {
            ProcessStartInfo processStartInfo = BuildCommand(epicData, productData, EpicMode.UnlabelBinary, labelData.staging);
            string           command          = "";

            AddParameter(ref command, BuildVersionKey, labelData.version);
            AddParameter(ref command, LabelKey, labelData.label);
            AddParameter(ref command, PlatformKey, labelData.platform);
            processStartInfo.Arguments += command;
            return(processStartInfo);
        }
        private void LoadClick(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == true)
            {
                App.saveData = EpicData.Load <EpicData>(openFileDialog.FileName);
                RefreshUI();
                EpicData.Save(App.saveData, "data");
            }
        }
        private void LoadProductsClick(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == true)
            {
                foreach (ProductData productData in EpicData.Load <ObservableCollection <ProductData> >(openFileDialog.FileName))
                {
                    ProductData.Add(productData);
                }
                EpicData.Save(App.productData, "products");
            }
        }
        public static ProcessStartInfo BuildPatchGenCommand(EpicData epicData, ProductData productData, BuildUploadData buildData)
        {
            ProcessStartInfo processStartInfo = BuildCommand(epicData, productData, EpicMode.PatchGeneration, buildData.staging);
            string           command          = "";

            AddParameter(ref command, FeatureLevelKey, "Latest");
            AddParameter(ref command, BuildRootKey, buildData.buildRoot);
            AddParameter(ref command, CloudDirKey, buildData.cloudDir);
            AddParameter(ref command, BuildVersionKey, buildData.buildVersion);
            AddParameter(ref command, AppLaunchKey, buildData.appLaunch);
            AddParameter(ref command, AppArgsKey, buildData.appArgs);
            processStartInfo.Arguments += command;
            return(processStartInfo);
        }
Exemple #11
0
 public Uploader(ProductData productData)
 {
     this.productData = productData;
     InitializeComponent();
     DataContext           = this;
     title.Content         = productData.realName;
     buildData             = EpicData.Load <BuildUploadData>(productData.realName);
     buildRootText.Text    = buildData.buildRoot;
     cloudDirText.Text     = buildData.cloudDir;
     buildVersionText.Text = buildData.buildVersion;
     appLaunchText.Text    = buildData.appLaunch;
     appArgsText.Text      = buildData.appArgs;
     Progress = 0;
 }
Exemple #12
0
        private void UploadClick(object sender, RoutedEventArgs e)
        {
            taskbarItemInfo.ProgressState = System.Windows.Shell.TaskbarItemProgressState.Normal;
            uploadButton.IsEnabled        = false;
            buildData.staging             = true;
            ComboBoxItem item = liveBox.SelectedItem as ComboBoxItem;

            if (item != null)
            {
                buildData.staging = item.Content.ToString() != "Live";
            }

            buildData.buildRoot    = buildRootText.Text;
            buildData.cloudDir     = cloudDirText.Text;
            buildData.buildVersion = buildVersionText.Text;
            buildData.appLaunch    = appLaunchText.Text;
            buildData.appArgs      = appArgsText.Text;
            EpicData.Save(buildData, productData.realName);
            EpicApi.uploadProgress += UploadProgress;
            EpicApi.Run(EpicApi.BuildPatchGenCommand(App.saveData, productData, buildData));
        }
 private void AddProductClick(object sender, RoutedEventArgs e)
 {
     new AddProduct().ShowDialog();
     EpicData.Save(App.productData, "products");
 }