Установка нескольких экземпляров того же сервиса окон на сервер

Другой хороший разработчик GUI для Eclipse разработчик Окна Pro . Как Jigloo, это не свободно для коммерческого использования.

Это позволяет Вам разрабатывать пользовательские интерфейсы для Swing, SWT и даже Google Web Toolkit (GWT).

92
задан Switters 14 August 2009 в 19:24
поделиться

2 ответа

Вы пробовали использовать утилиту sc / service controller? Введите

sc create

в командной строке, и вы получите справочную информацию. Думаю, я делал это в прошлом для Subversion и использовал эту статью в качестве ссылки:

http://svn.apache.org/repos/asf/subversion/trunk/notes/windows -service.txt

81
ответ дан 24 November 2019 в 06:32
поделиться

Вы можете запустить несколько версий одной и той же службы, выполнив следующие действия:

1) Скопируйте исполняемый файл службы и конфигурацию в его собственную папку.

2) Скопируйте Install.Exe в папка исполняемых файлов службы (из папки .NET Framework)

3) Создайте файл конфигурации с именем Install.exe.config в папке исполняемых файлов службы. со следующим содержимым (уникальные имена служб):

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="ServiceName" value="The Service Name"/>
    <add key="DisplayName" value="The Service Display Name"/>
  </appSettings>
</configuration>

4) Создайте пакетный файл для установки службы со следующим содержимым:

REM Install
InstallUtil.exe YourService.exe
pause

5) Пока вы там, создайте пакетный файл удаления

REM Uninstall
InstallUtil.exe -u YourService.exe
pause

РЕДАКТИРОВАТЬ:

Обратите внимание: если я что-то упустил, вот класс ServiceInstaller (при необходимости измените):

using System.Configuration;

namespace Made4Print
{
    partial class ServiceInstaller
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        private System.ServiceProcess.ServiceInstaller FileProcessingServiceInstaller;
        private System.ServiceProcess.ServiceProcessInstaller FileProcessingServiceProcessInstaller;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.FileProcessingServiceInstaller = new System.ServiceProcess.ServiceInstaller();
            this.FileProcessingServiceProcessInstaller = new System.ServiceProcess.ServiceProcessInstaller();
            // 
            // FileProcessingServiceInstaller
            // 
            this.FileProcessingServiceInstaller.ServiceName = ServiceName;
            this.FileProcessingServiceInstaller.DisplayName = DisplayName;
            // 
            // FileProcessingServiceProcessInstaller
            // 
            this.FileProcessingServiceProcessInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
            this.FileProcessingServiceProcessInstaller.Password = null;
            this.FileProcessingServiceProcessInstaller.Username = null;
            // 
            // ServiceInstaller
            // 
            this.Installers.AddRange(new System.Configuration.Install.Installer[] { this.FileProcessingServiceInstaller, this.FileProcessingServiceProcessInstaller });
        }

        #endregion

        private string ServiceName
        {
            get
            {
                return (ConfigurationManager.AppSettings["ServiceName"] == null ? "Made4PrintFileProcessingService" : ConfigurationManager.AppSettings["ServiceName"].ToString());
            }
        }

        private string DisplayName
        {
            get
            {
                return (ConfigurationManager.AppSettings["DisplayName"] == null ? "Made4Print File Processing Service" : ConfigurationManager.AppSettings["DisplayName"].ToString());
            }
        }
    }
}
19
ответ дан 24 November 2019 в 06:32
поделиться
Другие вопросы по тегам:

Похожие вопросы: