static public string Checkout(string project, string directory, string toolsPath) { string command = ""; string target = ""; string output = ""; string arguments = ""; target = string.Concat(directory, "\\", project); // Check if the target directory exists if (DosUtils.DirectoryExist(target)) { if (MessageBox.Show("Target directory already exists! Checkout will delete current data! Do you want to continue?", "Checkout", MessageBoxButtons.YesNo) == DialogResult.No) { return(""); } else { DosUtils.DirectoryDelete(target); } } // Create dir DosUtils.DirectoryCreate(directory); Environment.CurrentDirectory = directory; command = string.Concat(toolsPath, "\\cvs.bat"); arguments = string.Concat(directory, " checkout ", project); // Run the command Process p = new Process(); p.StartInfo.FileName = command; p.StartInfo.Arguments = arguments; try { p.Start(); } catch (Exception e) { MOG_Report.ReportMessage("SpawnDosCommand Error", String.Concat("Could not waitForExit (", e.Message, ")"), e.StackTrace, MOG_ALERT_LEVEL.CRITICAL); } p.Close(); return(output); }
private void DeployCheckedItems_Worker(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; List <object> args = e.Argument as List <object>; List <VersionNode> versionNodes = args[0] as List <VersionNode>; string deploymentDirectory = args[1] as string; string deploymentTarget = args[2] as string; // We are going to attemp to copy all check clients to their respective deployment directories for (int i = 0; i < versionNodes.Count && !worker.CancellationPending; i++) { VersionNode target = versionNodes[i]; // Set our current directory in the subDirectory of this versions type string deployTarget = target.Type + "\\" + deploymentTarget; // Clear out any previous deployment if (DosUtils.DirectoryExist(deploymentDirectory + "\\" + deployTarget)) { worker.ReportProgress(i * 100 / versionNodes.Count, "Removing previous (" + target.Type + ") build"); if (!DosUtils.DirectoryDelete(deploymentDirectory + "\\" + deployTarget)) { throw new Exception(DosUtils.GetLastError()); } } worker.ReportProgress(i * 100 / versionNodes.Count, "Copying new(" + target.Type + ") build named:" + target.Name); // Copy our new deployment if (!DosUtils.DirectoryCopyFast(target.SourceDirectory, deploymentDirectory + "\\" + deployTarget, true)) { throw new Exception(DosUtils.GetLastError()); } worker.ReportProgress(i * 100 / versionNodes.Count, target.Type + " named:" + target.Name + " has been deployed!"); } }
private bool InitializeTimeStampMap() { // Get our target root string platformTimeStampsFile = string.Concat(mSourcePath, "\\MOG\\platform.", mMog.GetActivePlatform().mPlatformName, ".", Path.GetFileNameWithoutExtension(mTargetConsole), ".timestamps.info"); // Is this a force if (mForce) { if (DosUtils.FileExist(platformTimeStampsFile)) { DosUtils.FileDelete(platformTimeStampsFile); } if (mConsoleCopy) { // Delete the target directory on the xbox if (!XboxUtils.DirectoryDelete(mSyncRoot, true)) { // Error //MOG_REPORT.ShowMessageBox("Xbox Delete Error", string.Concat(mSyncRoot, " could not be deleted!"), MessageBoxButtons.OK); throw new Exception(mSyncRoot + " could not be deleted!"); } } else { if (!DosUtils.DirectoryDelete(mSyncRoot)) { //Error //MOG_REPORT.ShowMessageBox("Delete Error", string.Concat(mSyncRoot, " could not be deleted!"), MessageBoxButtons.OK); throw new Exception(mSyncRoot + " could not be deleted!"); } } } // Open the timestamp ini mTargetTimestamps = new MOG_Ini(platformTimeStampsFile); return(true); }