Skip to content

Commit b7d07a5

Browse files
committed
WIP: Added the logic of creating entries in the registry while installing the app
1 parent 9e3777b commit b7d07a5

File tree

5 files changed

+242
-32
lines changed

5 files changed

+242
-32
lines changed

CSExeCOMServer/CSExeCOMServerTest.csproj

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<ManifestKeyFile>CSExeCOMServerTest_TemporaryKey.pfx</ManifestKeyFile>
7171
</PropertyGroup>
7272
<PropertyGroup>
73-
<GenerateManifests>true</GenerateManifests>
73+
<GenerateManifests>false</GenerateManifests>
7474
</PropertyGroup>
7575
<PropertyGroup>
7676
<SignManifests>false</SignManifests>
@@ -96,6 +96,11 @@
9696
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
9797
<Install>true</Install>
9898
</BootstrapperPackage>
99+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
100+
<Visible>False</Visible>
101+
<ProductName>.NET Framework 3.5 SP1</ProductName>
102+
<Install>false</Install>
103+
</BootstrapperPackage>
99104
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
100105
<Visible>False</Visible>
101106
<ProductName>Windows Installer 3.1</ProductName>

CSExeCOMServer/Program.cs

+18-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
1616
\***************************************************************************/
1717

18+
using System;
1819
using System.IO;
20+
using System.Diagnostics;
1921

2022
namespace CSExeCOMServerTest
2123
{
@@ -24,12 +26,19 @@ class Program
2426
// The main entry point for the application.
2527
static void Main(string[] args)
2628
{
29+
//if (!EventLog.SourceExists("TraceListenerLogSource"))
30+
//{
31+
// EventLog.CreateEventSource("TraceListenerLogSource", OutlookPresenceProvider.PresenceProvider.COMAppExeName);
32+
//}
33+
2734
// Comment below lines if the Unified Collaborations type library is already registered in the system.
2835
string typeLibName = "UCCollaborationLib.tlb";
2936
string currentDir = Directory.GetCurrentDirectory();
3037
string typeLibPath = $"{currentDir}\\{typeLibName}";
3138
TypeLib.Register(typeLibPath);
32-
39+
40+
//string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
41+
//Console.WriteLine(userName);
3342
CSExeCOMServer.ExeCOMServer.Instance.OnCOMReady += new CSExeCOMServer.ExeCOMServer.OnCOMHosted(OnCOMReady);
3443
// Run the out-of-process COM server
3544
CSExeCOMServer.ExeCOMServer.Instance.Run(typeof(OutlookPresenceProvider.PresenceProvider), true);
@@ -39,7 +48,14 @@ static void Main(string[] args)
3948

4049
static void OnCOMReady()
4150
{
42-
OutlookPresenceProvider.PresenceProvider.Started();
51+
//try
52+
//{
53+
OutlookPresenceProvider.PresenceProvider.Started();
54+
//} catch (Exception ex)
55+
//{
56+
// Trace.TraceError(ex.Message);
57+
// Trace.TraceError(ex.StackTrace);
58+
//}
4359
}
4460
}
4561
}

CSExeCOMServer/app.config

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
</assemblyBinding>
2121
</runtime>
2222
<system.diagnostics>
23+
<!--<trace autoflush="false" indentsize="4">-->
2324
<trace autoflush="true" indentsize="4">
2425
<listeners>
25-
<add name="fileLogger" type="System.Diagnostics.TextWriterTraceListener" initializeData="LogFile.log" traceOutputOptions="DateTime" />
26+
<!--<add name="eventLogger" type="System.Diagnostics.EventLogTraceListener" initializeData="TraceListenerLogSource" />-->
27+
<add name="fileLogger" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\Users\Public\MattermostPresenceProviderLogFile.log" traceOutputOptions="DateTime" />
2628
<remove name="Default" />
2729
</listeners>
2830
</trace>

0 commit comments

Comments
 (0)