Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can run multiple versions of the same service by doing the following:</p> <p>1) Copy the Service executable and config to its own folder.</p> <p>2) Copy Install.Exe to the service executable folder (from .net framework folder)</p> <p>3) Create a config file called Install.exe.config in the service executable folder with the following contents (unique service names):</p> <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;configuration&gt; &lt;appSettings&gt; &lt;add key="ServiceName" value="The Service Name"/&gt; &lt;add key="DisplayName" value="The Service Display Name"/&gt; &lt;/appSettings&gt; &lt;/configuration&gt; </code></pre> <p>4) Create a batch file to install the service with the following contents:</p> <pre><code>REM Install InstallUtil.exe YourService.exe pause </code></pre> <p>5) While your there, create an uninstall batch file</p> <pre><code>REM Uninstall InstallUtil.exe -u YourService.exe pause </code></pre> <p><strong>EDIT:</strong></p> <p>Note sure if I missed something, here is the ServiceInstaller Class (adjust as required):</p> <pre class="lang-cs prettyprint-override"><code>using System.Configuration; namespace Made4Print { partial class ServiceInstaller { /// &lt;summary&gt; /// Required designer variable. /// &lt;/summary&gt; private System.ComponentModel.IContainer components = null; private System.ServiceProcess.ServiceInstaller FileProcessingServiceInstaller; private System.ServiceProcess.ServiceProcessInstaller FileProcessingServiceProcessInstaller; /// &lt;summary&gt; /// Clean up any resources being used. /// &lt;/summary&gt; /// &lt;param name="disposing"&gt;true if managed resources should be disposed; otherwise, false.&lt;/param&gt; protected override void Dispose(bool disposing) { if (disposing &amp;&amp; (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// &lt;summary&gt; /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// &lt;/summary&gt; 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()); } } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload