Пример #1
0
        public static async Task <int> Main(string[] args)
        {
            var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider();
            var listener        = new ConsoleMessageListener("HEAT", "heat.exe");

            try
            {
                var program = new Program();
                return(await program.Run(serviceProvider, listener, args));
            }
            catch (WixException e)
            {
                listener.Write(e.Error);

                return(e.Error.Id);
            }
            catch (Exception e)
            {
                listener.Write(ErrorMessages.UnexpectedException(e));

                if (e is NullReferenceException || e is SEHException)
                {
                    throw;
                }

                return(e.HResult);
            }
        }
Пример #2
0
        public static int Main(string[] args)
        {
            var serviceProvider = new WixToolsetServiceProvider();

            var listener = new ConsoleMessageListener("WIX", "wix.exe");

            try
            {
                var program = new Program();
                return(program.Run(serviceProvider, listener, args));
            }
            catch (WixException e)
            {
                listener.Write(e.Error);

                return(e.Error.Id);
            }
            catch (Exception e)
            {
                listener.Write(ErrorMessages.UnexpectedException(e.Message, e.GetType().ToString(), e.StackTrace));

                if (e is NullReferenceException || e is SEHException)
                {
                    throw;
                }

                return(e.HResult);
            }
        }
Пример #3
0
        public static int Main(string[] args)
        {
            var serviceProvider = new WixToolsetServiceProvider();

            var listener = new ConsoleMessageListener("WIX", "light.exe");

            Light light = new Light();

            return(light.Run(serviceProvider, listener, args));
        }
Пример #4
0
        public static int Main(string[] args)
        {
            var serviceProvider = new WixToolsetServiceProvider();

            var listener = new ConsoleMessageListener("WIX", "wix.exe");

            var program = new Program();

            return(program.Run(serviceProvider, listener, args));
        }
Пример #5
0
        public static int Main(string[] args)
        {
            var serviceProvider = new WixToolsetServiceProvider();
            var listener        = new ConsoleMessageListener("WXCP", "wixcop.exe");

            serviceProvider.AddService <IMessageListener>((x, y) => listener);
            serviceProvider.AddService <IWixCopCommandLineParser>((x, y) => new WixCopCommandLineParser(x));

            var program = new Program();

            return(program.Run(serviceProvider, args));
        }
Пример #6
0
        public static async Task <int> Main(string[] args)
        {
            var cts      = new CancellationTokenSource();
            var listener = new ConsoleMessageListener("WIX", "wix.exe");

            Console.CancelKeyPress += (s, e) =>
            {
                cts.Cancel();
                e.Cancel = true;
            };

            try
            {
                var serviceProvider = WixToolsetServiceProviderFactory.CreateServiceProvider()
                                      .AddWindowsInstallerBackend()
                                      .AddBundleBackend()
                                      .AddExtensionCacheManager()
                                      .AddConverter();

                return(await Run(serviceProvider, listener, args, cts.Token));
            }
            catch (OperationCanceledException)
            {
                return(-1);
            }
            catch (WixException e)
            {
                listener.Write(e.Error);

                return(e.Error.Id);
            }
            catch (Exception e)
            {
                listener.Write(ErrorMessages.UnexpectedException(e));

                if (e is NullReferenceException || e is SEHException)
                {
                    throw;
                }

                return(e.HResult);
            }
        }