diff --git a/LittleBigMouse_Daemon/Program.cs b/LittleBigMouse_Daemon/Program.cs index 8480e2b8..1e26c284 100644 --- a/LittleBigMouse_Daemon/Program.cs +++ b/LittleBigMouse_Daemon/Program.cs @@ -24,7 +24,7 @@ class Program : Application, ILittleBigMouseService public static void Main(string[] args) { bool firstInstance; - Mutex mutex = new Mutex(true, "LittleBigMouse_Daemon" + Environment.UserName, out firstInstance); + Mutex mutex = new Mutex(true, Unique + Environment.UserName, out firstInstance); if (!firstInstance) { @@ -39,9 +39,11 @@ public static void Main(string[] args) using (ServiceHost host = new ServiceHost(prog, LittleBigMouseClient.Address)) { // Enable metadata publishing. - ServiceMetadataBehavior smb = new ServiceMetadataBehavior(); + ServiceMetadataBehavior smb = new ServiceMetadataBehavior + { + MetadataExporter = {PolicyVersion = PolicyVersion.Policy15} + }; //smb.HttpGetEnabled = true; - smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15; host.Description.Behaviors.Add(smb); @@ -215,9 +217,9 @@ public void Schedule() //new BootTrigger()); new LogonTrigger()); - var p = Process.GetCurrentProcess(); - string filename = p.MainModule.FileName.Replace(".vshost", ""); - + //var p = Process.GetCurrentProcess(); + //string filename = p.MainModule.FileName.Replace(".vshost", ""); + string filename = AppDomain.CurrentDomain.BaseDirectory + AppDomain.CurrentDomain.FriendlyName.Replace(".vshost", ""); td.Actions.Add( new ExecAction(filename)