Exemplo n.º 1
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            if(txtRoot.Text.ToLower().Equals("help")) {
                txtConsole.Text = "Enter the root directory of the solution to be processed, the product name, the content output filename, the config output filename and the product output filename." + Environment.NewLine +
                                      "For Example: WIXContentWriter C:\\MySolutionRoot ProductName ProductContent.wxs Config.wxi Product.wxs";
            } else {
                if(txtRoot.Text.Equals("")) {
                    txtConsole.Text = "Must enter root directory.  Enter help as first parameter for assistance.";
                } else {
                    if(!Directory.Exists(txtRoot.Text)) {
                        txtConsole.Text = "Solution directory specified does not exist. Try again.";
                    } else {
                        //Correct number of arguments - ready to attempt processing.
                        removeExistingFiles();

                        ContentWriter cw = new ContentWriter();
                        cw.writePagesOutputFile(txtRoot.Text);
                        txtConsole.Text = "Successfully completed writing Pages file." + Environment.NewLine;
                        cw.writeGoToOutputFile();
                        txtConsole.Text = txtConsole.Text + "Successfully completed writing GoTo file." + Environment.NewLine;
                        txtConsole.Text = txtConsole.Text + "Completed Processing." + Environment.NewLine;

                        cw.finalise();
                        cw = null;

                        setMoveFunctionVisibility(true);
                    }
                }
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            if(args.Length == 0) {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                frmTheHighLander generator = new frmTheHighLander();
                generator.Icon = new Icon("favicon.ico");
                Application.Run(generator);
            } else {
                if(args.Length != 6) {
                    Console.WriteLine("Must enter 6 arguments.  Enter help as first parameter for assistance.");
                    Environment.Exit(0);
                } else {
                    if(args[0].ToLower().Equals("help")) {
                        Console.WriteLine("Enter the root directory of the solution to be processed, the product name, the content output filename, the config output filename the product output filename and the directory to move the files to.\n" +
                                          "For Example: WIXContentWriter C:\\MySolutionRoot ProductName ProductContent.wxs Config.wxi Product.wxs C:\\MyDestinationDir");
                        Environment.Exit(0);
                    } else {
                        if(!Directory.Exists(args[0])) {
                            Console.WriteLine("Solution directory specified does not exist.  Exiting.");
                            Environment.Exit(0);
                        } else {
                            //Correct number of arguments - ready to attempt processing.
                            ContentWriter cw = new ContentWriter();
                            cw.writePagesOutputFile(args[0], args[2], args[3]);
                            Console.WriteLine("Successfully completed writing WIX Content file.");
                            cw.writeGoToOutputFile(args[1], args[3]);
                            Console.WriteLine("Successfully completed writing WIX Config file.");
                            cw.writeProductOutputFile(args[3], args[4]);
                            Console.WriteLine("Successfully completed writing WIX Product file.");

                            int filesMoved = FileUtil.moveFiles(args[5]);

                            Console.WriteLine("Finished moving " + filesMoved + " files to " + args[5] + ".");
                            Environment.Exit(0);
                        }
                    }
                }
            }
        }