Exemple #1
0
        private void InstallService(string exeFilename, string basePath)
        {
            var pathArg            = string.Format("/PATH={0}", basePath);
            var portArg            = string.Format("/PORT={0}", this.Port);
            var httpPortArgs       = string.Format("/HTTPPORT={0}", this.HttpPort ?? AddressUtility.GetDefaultHttpPort(this.Port));
            var displayNameArg     = string.Format("/DisplayName={0}", this.DisplayName);
            var serviceNameArg     = string.Format("/ServiceName={0}", this.ServiceName);
            var comment            = string.Format("/Comment={0}", this.Comment);
            var commandLineOptions = new string[] { pathArg, portArg, displayNameArg, serviceNameArg, comment, httpPortArgs };
            var installer          = new AssemblyInstaller(exeFilename, commandLineOptions);

            installer.Install(null);
            installer.Commit(null);
        }
        private void InitCremaService()
        {
            var repoPath = DirectoryUtility.Prepare(CremaDbPath, "_repo");

            using (var bootstrap = new CremaBootstrapper())
            {
                bootstrap.CreateRepository(repoPath, "crema", false);
            }

            Service                = new CremaService();
            Service.BasePath       = repoPath;
            Service.MultiThreading = true;
            Service.Port           = 4004;
            Service.HttpPort       = AddressUtility.GetDefaultHttpPort(Service.Port);

            Service.Open();

            CremaHost = Service.GetService <ICremaHost>();
        }