Пример #1
0
        private void runMSBuild(string destinationFolder, string arguments = "")
        {
            Process          p    = new Process();
            ProcessStartInfo info = CreateVisualStudioCommandPromptProcessStartInfo(compilerType, platform);

            info.RedirectStandardInput  = true;
            info.UseShellExecute        = false;
            info.RedirectStandardOutput = true;
            info.RedirectStandardError  = true;
            info.WindowStyle            = ProcessWindowStyle.Hidden;

            p.StartInfo = info;
            p.Start();

            using (StreamWriter sw = p.StandardInput)
            {
                string extractFolderName = OpenSceneGraphInfo.GetInfo(version).ExtractFolderName;

                if (sw.BaseStream.CanWrite)
                {
                    sw.WriteLine("cd /D " + destinationFolder + extractFolderName);
                    sw.WriteLine("msbuild OpenSceneGraph.sln" + arguments);
                }
            }

            readStandardOutput(p);
            readStandardError(p);

            p.WaitForExit();
            p.Close();
        }
Пример #2
0
        public void DownloadAndBuild()
        {
            try
            {
                if (!Directory.Exists(destinationFolder))
                {
                    Directory.CreateDirectory(destinationFolder);
                }

                message("Downloading OpenSceneGraph...");

                string downloadURL = OpenSceneGraphInfo.GetDownloadURL(version);
                string ZIPFilename = OpenSceneGraphInfo.GetZipFileName(version);

                DownloadHelper.DownloadFileFromURL(downloadURL, destinationFolder + ZIPFilename);

                message("Start to unzip boost...");

                // Unzip Boost
                SevenZip.Decompress(destinationFolder + "/" + ZIPFilename, destinationFolder);

                message("OpenSceneGraph has been unzipped!");
                message("start building OpenSceneGraph...");

                // Build OpenSceneGraph
                runCMake(destinationFolder);

                // now build release mode
                runMSBuild(destinationFolder, " /property:Configuration=Release");

                runMSBuild(destinationFolder);

                // remove downloaded file
                System.IO.File.Delete(destinationFolder + ZIPFilename);

                message("OpenSceneGraph successfully built!");

                OnFinished();
            }
            catch (Exception ex)
            {
                message(string.Empty);
                OnFailure();
                MessageBox.Show(ex.ToString());
            }
        }
Пример #3
0
        private void runCMake(string destinationFolder)
        {
            Process          p    = new Process();
            ProcessStartInfo info = CreateVisualStudioCommandPromptProcessStartInfo(compilerType, platform);

            info.RedirectStandardInput  = true;
            info.UseShellExecute        = false;
            info.RedirectStandardOutput = true;
            info.RedirectStandardError  = true;
            info.WindowStyle            = ProcessWindowStyle.Hidden;

            p.StartInfo = info;
            p.Start();

            using (StreamWriter sw = p.StandardInput)
            {
                string extractFolderName = OpenSceneGraphInfo.GetInfo(version).ExtractFolderName;

                if (sw.BaseStream.CanWrite)
                {
                    if (compilerType == eCompiler.VS2010)
                    {
                        sw.WriteLine("cd /D " + destinationFolder + extractFolderName); //"boost_1_51_0-x64");
                        string cmakeCommand = "cmake -G\"Visual Studio 10 Win64\" + -H" + destinationFolder + extractFolderName + " -B" + destinationFolder + extractFolderName;
                        sw.WriteLine(cmakeCommand);
                    }
                    else
                    {
                        sw.WriteLine("cd /D " + destinationFolder + extractFolderName); //"boost_1_51_0-x64");
                        string cmakeCommand = "cmake -G\"Visual Studio 11 Win64\" + -H" + destinationFolder + extractFolderName + " -B" + destinationFolder + extractFolderName;
                        sw.WriteLine(cmakeCommand);
                    }
                }
            }

            readStandardOutput(p);
            readStandardError(p);

            p.WaitForExit();
            p.Close();
        }