private void UseBGInfoToGenerateBackgroundImage( ) { String BackgroundDirectory = RPathToWindowsOOBE.GetFullPath( ) + @"\info\backgrounds"; richTextBox_Status.Text += "Creating a new directory: " + BackgroundDirectory + "\n"; Directory.CreateDirectory(BackgroundDirectory); // http://stackoverflow.com/questions/1469764/run-command-prompt-commands Process cmdBGInfo = new Process( ); String strDirectoryToBGInfo = RPathToBGInfo.GetPath( ); cmdBGInfo.StartInfo.FileName = RPathToBGInfo.GetFileName( ); // "BGInfo.exe"; cmdBGInfo.StartInfo.WorkingDirectory = strDirectoryToBGInfo; cmdBGInfo.StartInfo.Arguments = strDirectoryToBGInfo + @"\gaming_machines.bgi /NOLICPROMPT /timer:0"; richTextBox_Status.Text += "Calling BGInfo.exe with: " + cmdBGInfo.StartInfo.Arguments + "\n"; try { cmdBGInfo.Start( ); cmdBGInfo.WaitForExit( ); } catch (Exception e) { // do nothing. } }
private void UseImageMagickToConvertAndCopy( ) { String strDirectoryToBGInfo = RPathToBGInfo.GetPath( ); Process cmdImageMagick = new Process( ); String strDirectoryToImageMagick = RPathToImageMagick.GetPath( ); cmdImageMagick.StartInfo.FileName = RPathToImageMagick.GetFileName( ); cmdImageMagick.StartInfo.WorkingDirectory = strDirectoryToImageMagick; cmdImageMagick.StartInfo.Arguments = strDirectoryToBGInfo + @"\BGInfo.bmp " + strDirectoryToBGInfo + @"\backgroundDefault.jpg"; richTextBox_Status.Text += "Calling ImageMagick's convert.exe with: " + cmdImageMagick.StartInfo.Arguments + "\n"; try { cmdImageMagick.Start( ); cmdImageMagick.WaitForExit( ); } catch (Exception e) { // do nothing. } bool OverWrite = true; try { File.Copy(strDirectoryToBGInfo + @"\backgroundDefault.jpg", RPathToWindowsOOBE.GetPath() + @"\info\backgrounds\backgroundDefault.jpg", OverWrite); } catch (Exception e) { // do nothing. } }