コード例 #1
0
        public static int Run(string[] args)
        {
            SetupLoggers();

            Log.InfoFormat("Starting setup...");
            Log.InfoFormat("Commandline arguments: {0}", string.Join(" ", args));

            try
            {
                var arguments = Arguments.Parse(args);
                switch (arguments.Mode)
                {
                case Mode.Install:
                    return(InstallApplication.Run(arguments));

                case Mode.SilentInstall:
                    return(SilentInstallApplication.Run(arguments));

                case Mode.Update:
                    return(UpdateApplication.Run(arguments));

                case Mode.Uninstall:
                    return(UninstallApplication.Run(arguments));

                default:
                    throw new Exception($"Unknown mode: {arguments.Mode}");
                }
            }
            catch (Exception e)
            {
                Log.ErrorFormat("Error: {0}", e.Message);
                return(-1);
            }
        }
コード例 #2
0
ファイル: FormMenu.cs プロジェクト: ramanasha/sport-club-ms
        public FormMenu()
        {
            // Default User
            User user = new User();

            user.Name      = "ES-SARRAJ";
            user.FirstName = "Fouad";

            // Start Application Session
            GWinApp.Start(new Session(this, user, CultureInfo.CreateSpecificCulture("fr")));

            // Update Menu Table from ModelConfiguation
            InstallApplication installApplication = new InstallApplication(typeof(ModelContext));

            installApplication.Update();

            // Reload : to apply language configuration
            Reload();
        }
コード例 #3
0
        public static int Run(string[] args)
        {
            SetupLoggers();

            Log.InfoFormat("Starting setup...");
            Log.InfoFormat("Commandline arguments: {0}", string.Join(" ", args));

            var arguments = Arguments.Parse(args);

            switch (arguments.Mode)
            {
            case Mode.Install:
                return(InstallApplication.Run(arguments));

            case Mode.SilentInstall:
                return(SilentInstallApplication.Run(arguments));

            case Mode.Update:
                return(UpdateApplication.Run(arguments));

            default:
                return(-1);
            }
        }
コード例 #4
0
        protected override string ProcessRemoteCommand(string name, string[] args)
        {
            string appManifest = Path.Combine(
                Context.TargetDirectory,
                ApplicationName + ".exe.manifest");
            string deployManifest = Path.Combine(
                Context.TargetDirectory,
                ApplicationName + ".application");


            if (name == "CreateApplication")
            {
                //%_MAGE% -New Application -ToFile %_PRJNME%.exe.manifest -Version %1 -FromDirectory

                string icon = String.IsNullOrEmpty(IconFile) ? String.Empty : String.Format("-IconFile \"{0}\" ", IconFile);

                ExecuteCommandLine(
                    GetMagePath(),
                    string.Format(
                        "-New Application "
                        + "-ToFile \"{0}\" "
                        + "-Version {1} "
                        + "-FromDirectory . "
                        + "{2}",
                        appManifest,
                        Version,
                        icon),
                    Context.SourceDirectory).ToString();

                UpdateApplicationManifest(appManifest, this.FilesExcludedFromManifest);
                return(null);
            }
            else if (name == "SignApplication")
            {
                //%_MAGE% -Sign %_PRJNME%.exe.manifest -CertFile %_CERT%
                return(ExecuteCommandLine(
                           GetMagePath(),
                           string.Format(
                               "-Sign \"{0}\" {1}",
                               appManifest,
                               GetCertificateArguments()),
                           Context.SourceDirectory).ToString());
            }
            else if (name == "CreateDeployment")
            {
                //%_MAGE% -New Deployment -ToFile %_PRJNME%.application -Version %1 -AppManifest %_PRJNME%.exe.manifest -providerUrl %_PROVURL%/%_PRJNME%.application
                ExecuteCommandLine(
                    GetMagePath(),
                    string.Format(
                        "-New Deployment "
                        + "-ToFile \"{0}\" "
                        + "-Version {1} "
                        + "-AppManifest \"{2}\" "
                        + "-providerUrl \"{3}/{4}.application\" "
                        + "-Install {5} "
                        + (String.IsNullOrWhiteSpace(this.AppCodeBaseDirectory) ? String.Empty : "-AppCodeBase \"{6}\" "),
                        deployManifest,
                        Version,
                        appManifest,
                        ProviderUrl,
                        ApplicationName,
                        InstallApplication.ToString().ToLower(),
                        Path.Combine(this.AppCodeBaseDirectory, Path.GetFileName(appManifest))),
                    Context.SourceDirectory).ToString();


                if (InstallApplication && !String.IsNullOrEmpty(MinVersion))
                {
                    ExecuteCommandLine(
                        GetMagePath(),
                        string.Format(
                            "-Update "
                            + "\"{0}\" "
                            + "-MinVersion {1} ",
                            deployManifest,
                            MinVersion),
                        Context.SourceDirectory).ToString();
                }

                //Moved existing MapFileExtensions functionality to the function UpdateApplicationFile

                UpdateDeploymentManifest(deployManifest);
                return(null);
            }
            else if (name == "SignDeployment")
            {
                //%_MAGE% -Sign %_PRJNME%.application -CertFile %_CERT%
                return(ExecuteCommandLine(
                           GetMagePath(),
                           string.Format(
                               "-Sign \"{0}\" {1}",
                               deployManifest,
                               GetCertificateArguments()),
                           Context.SourceDirectory).ToString());
            }
            else if (name == "CopyAppFiles")
            {
                CopyFiles(
                    Context.SourceDirectory,
                    Context.TargetDirectory,
                    MapFileExtensions);
                return(null);
            }
            else
            {
                throw new ArgumentOutOfRangeException("name");
            }
        }