Skip to content

Commit

Permalink
Improved logging and added the logic to sign the build in the CI (#12)
Browse files Browse the repository at this point in the history
* Basic setup of COM server and presence provider

* Added the basic implementations of all the interfaces and more than basic of some interfaces
Made a separate file for the AutomationBase class
Fixed the logic for registering the type library by fixing the path given
Added a new tlb extracted from Skype for Business
Added a global exception handler
Completed the implementation of IMClientContact class
Completed the implementation of IMClientSelf class
Added several dependent classes such as IMClientContactInformationDictionary, IMClientContactSettingDictionary
Added the basic implementation of IContactEndpoint, IContactManager, IContactSubscription, IGroup, IGroupCollection, ILocaleString interfaces

* Review fixes

* Added the logic of showing the presence icon fetching status from Mattermost when Outlook starts
Added required attributes like ComVisible and ComSourceInterfaces on top of all the classes
Added some required Nuget packages like System.Text.Json etc and modified .gitignore to avoid the packages
Added the logic to return different values from GetContactInformation depending on the type of value requested
Made a HTTP client and added the necessary headers
Made the self object by hard-coding the email id of the current user
Added the logic of fetching the Mattermost server url from the registry and making a request for fetching status of a user
Made a Constants class for storing the mapping between the Mattermost status and the Outlook availability
Added a basic implementation of the IAsyncOperation interface and the Lookup method in the IMClientContactManager class

* Added EOF in all the files

* Removed useless imports from all the files

* Removed useless directives and deleted useless file

* Added polling strategy to trigger presence updates for all the contacts
Fixed the presence text not showing in Outlook using ContactInformationType.ucPresenceActivityId
Made a map in constants mapping availabilities with values of activity id
Changed the logic in CanStart method of IMClientContact and the value of UnifiedCommunicationType property to observe the changes
Solved the issue in triggering the presence change by returning the uri from ContactInformationType.ucPresenceInstantMessageAddresses in the GetContactInformation method
Made a class IMClientContactInformationChangedEventData which implements ContactInformationChangedEventData
Added the logic for handling groups in IMClientContactManager class
Modified the call to OnLookup callback function
Added a timer which runs in an interval of 10 seconds to trigger OnContactInformationChangedEvent for every contact in the list

* Review fixes

* Created a websocket client to connect to Mattermost websocket and added proper handling
Moved all the Mattermost client related logic in a separate client class
Added the logic to connect to Mattermost websocket and added an event handler in the ContactSubscription class to trigger presence change events for subscribed contacts
Added the logic to use the status got from websocket event and not call the API
Added the logic to not use the previous status for a contact but fetch the latest status when pages are changed in Outlook
Changed the logic inside the ContactManager.Lookup function and added comments
Optimized the way subscribed contacts are stored in the ContactSubscription class

* Review fixes

* Review fixes

* Removed useless logs and added some comments
Little refactoring

* Added authentication with every request to the Mattermost server and the logic to read values from config file
Uncommented and modified the logic to register the type library
Modified the client to read the values from a config.json file and create one if doesn't exist
Added the logic to send the secret with every request to the Mattermost server
Changed the websocket reconnection timeout to 30 seconds

* Implemented the status cache and added a setup project
Created a store class to store the statuses for all the Mattermost users
Added the logic to always return the availability from the store and always update the store based on websocket event
Added the logic to initialize the store when the app starts
Removed the hard coded self url from the ClientBase class
Added and configured a setup project to create a setup for the app

* Renamed the setup project as BuildSetup and modified .gitignore

* Final refactoring
Fixed the logic of creating entries in the registry so that Outlook can look for the app

* Added empty ci.yml file in Github workflows

* Added basic test setup for the CI script

* Added CI script to create build and release in Github
Modified the Author, Manufacturer and TargetFramework of the setup project
Made the websocket reconnection timeout configurable via config.json
Replaced all occurences of "" with string.Empty

* Modified the CI workflow to run for tags only

* Modified the name of the final zip file to contain the github tag

* Fixed the filename of the zip created after the build in CI

* Fixed the assembly name for the CSExeCOMServer

* Added documentation

* Added logging through a log file

* WIP: Added the logic of creating entries in the registry while installing the app

* Added logging through Event logs and completed the logic of creating registry entries while installing
Removed logging in a file logic from the app.config
Added logic to create a new event log and source while installing the setup project
Added the newly created event source as the trace listener
Improved logging of errors by adding message with the stack trace

* Added the logic to specify a size for the event log

* Improved logging in the app to figure out the cause of the error

* Added the logic to sign the build with a certificate in the CI yml script

* Added the logic to create a shortcut in the Start Menu after installation
  • Loading branch information
manojmalik20 authored May 6, 2022
1 parent f8d2cf0 commit aecdb64
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 93 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ jobs:
- name: Build the solution
run: devenv.com .\CSExeCOMServer.sln /Build Release

- name: Sign the build with a code signing certificate
run: |
$bytes = [Convert]::FromBase64String("${{ secrets.CODE_SIGNING_CERT }}")
[IO.File]::WriteAllBytes("cert.pfx", $bytes)
$SignToolPath = $env:WindowsSdkVerBinPath + "x64\signtool.exe"
if ($SignToolPath | Test-Path) {
& $SignToolPath sign /f .\cert.pfx /fd SHA256 /d "Mattermost Presence Provider" .\MattermostPresenceProvider\Setup.msi
& $SignToolPath sign /f .\cert.pfx /fd SHA256 /d "Mattermost Presence Provider" .\MattermostPresenceProvider\setup.exe
}
- name: Remove files and create a zip of the build
run: |
if (Test-Path .\MattermostPresenceProvider\MattermostPresenceProvider.vdproj) { Remove-Item .\MattermostPresenceProvider\MattermostPresenceProvider.vdproj }
Expand Down
194 changes: 116 additions & 78 deletions MattermostPresenceProvider/MattermostPresenceProvider.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@
"Entry"
{
"MsmKey" = "8:_5016D0532C492C9109DBCF9B3F381932"
"OwnerKey" = "8:_BB298BCD6074BDA64F4E08F9C6420161"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_5016D0532C492C9109DBCF9B3F381932"
"OwnerKey" = "8:_13083496CDBF4520855C2C5A99DDA1F7"
"MsmSig" = "8:_UNDEFINED"
}
Expand Down Expand Up @@ -118,7 +112,7 @@
"Entry"
{
"MsmKey" = "8:_703C65C22BA13A0205A8461A7B5D043A"
"OwnerKey" = "8:_A55DCD399F53EFE7F4213EAE234896AF"
"OwnerKey" = "8:_A14E42BAB1A6CDDC6020263A578C099A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -135,6 +129,18 @@
}
"Entry"
{
"MsmKey" = "8:_74010AB752D49741378EB5A2CBBCC706"
"OwnerKey" = "8:_13083496CDBF4520855C2C5A99DDA1F7"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_74010AB752D49741378EB5A2CBBCC706"
"OwnerKey" = "8:_A14E42BAB1A6CDDC6020263A578C099A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_8CE012C46979C0EA85B3685F146EC69C"
"OwnerKey" = "8:_DB6720EAA3D5DA372A5924D4BD109058"
"MsmSig" = "8:_UNDEFINED"
Expand All @@ -159,7 +165,7 @@
}
"Entry"
{
"MsmKey" = "8:_A55DCD399F53EFE7F4213EAE234896AF"
"MsmKey" = "8:_A14E42BAB1A6CDDC6020263A578C099A"
"OwnerKey" = "8:_13083496CDBF4520855C2C5A99DDA1F7"
"MsmSig" = "8:_UNDEFINED"
}
Expand All @@ -172,13 +178,7 @@
"Entry"
{
"MsmKey" = "8:_BB298BCD6074BDA64F4E08F9C6420161"
"OwnerKey" = "8:_A55DCD399F53EFE7F4213EAE234896AF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_BB298BCD6074BDA64F4E08F9C6420161"
"OwnerKey" = "8:_703C65C22BA13A0205A8461A7B5D043A"
"OwnerKey" = "8:_A14E42BAB1A6CDDC6020263A578C099A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand Down Expand Up @@ -232,12 +232,6 @@
"Entry"
{
"MsmKey" = "8:_D2E4A208303334FEFE606F11ECD1F24D"
"OwnerKey" = "8:_ECC9F316C1DB31CE1C777158EBE5F947"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_D2E4A208303334FEFE606F11ECD1F24D"
"OwnerKey" = "8:_DB6720EAA3D5DA372A5924D4BD109058"
"MsmSig" = "8:_UNDEFINED"
}
Expand All @@ -261,32 +255,14 @@
}
"Entry"
{
"MsmKey" = "8:_D783AF66B9AA37D4923CADFFF325A26F"
"OwnerKey" = "8:_ECC9F316C1DB31CE1C777158EBE5F947"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_DB6720EAA3D5DA372A5924D4BD109058"
"OwnerKey" = "8:_13083496CDBF4520855C2C5A99DDA1F7"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_DB6720EAA3D5DA372A5924D4BD109058"
"OwnerKey" = "8:_A55DCD399F53EFE7F4213EAE234896AF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_ECC9F316C1DB31CE1C777158EBE5F947"
"OwnerKey" = "8:_703C65C22BA13A0205A8461A7B5D043A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_ECC9F316C1DB31CE1C777158EBE5F947"
"OwnerKey" = "8:_13083496CDBF4520855C2C5A99DDA1F7"
"OwnerKey" = "8:_A14E42BAB1A6CDDC6020263A578C099A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -309,32 +285,20 @@
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_D783AF66B9AA37D4923CADFFF325A26F"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_A55DCD399F53EFE7F4213EAE234896AF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_A55DCD399F53EFE7F4213EAE234896AF"
"MsmKey" = "8:_FAF12FB42146BB7C863FC2FDFF25A6DB"
"OwnerKey" = "8:_13083496CDBF4520855C2C5A99DDA1F7"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_6A126CFA9192A6860B444FDB4530F3AA"
"MsmKey" = "8:_FAF12FB42146BB7C863FC2FDFF25A6DB"
"OwnerKey" = "8:_A14E42BAB1A6CDDC6020263A578C099A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_13083496CDBF4520855C2C5A99DDA1F7"
"OwnerKey" = "8:_D783AF66B9AA37D4923CADFFF325A26F"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand Down Expand Up @@ -427,6 +391,24 @@
"OwnerKey" = "8:_13083496CDBF4520855C2C5A99DDA1F7"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_A14E42BAB1A6CDDC6020263A578C099A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_FAF12FB42146BB7C863FC2FDFF25A6DB"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_74010AB752D49741378EB5A2CBBCC706"
"MsmSig" = "8:_UNDEFINED"
}
}
"Configurations"
{
Expand Down Expand Up @@ -770,6 +752,37 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_74010AB752D49741378EB5A2CBBCC706"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
"ScatterAssemblies"
{
"_74010AB752D49741378EB5A2CBBCC706"
{
"Name" = "8:System.Net.Http.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:System.Net.Http.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_7B0911FFC0404DA390170CCE6287BC92"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_8CE012C46979C0EA85B3685F146EC69C"
{
"AssemblyRegister" = "3:1"
Expand Down Expand Up @@ -801,14 +814,14 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_A55DCD399F53EFE7F4213EAE234896AF"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_A14E42BAB1A6CDDC6020263A578C099A"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:OutlookPresenceProvider, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_A55DCD399F53EFE7F4213EAE234896AF"
"_A14E42BAB1A6CDDC6020263A578C099A"
{
"Name" = "8:OutlookPresenceProvider.dll"
"Attributes" = "3:512"
Expand Down Expand Up @@ -836,7 +849,7 @@
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:System.Reactive, Version=4.3.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_BB298BCD6074BDA64F4E08F9C6420161"
Expand Down Expand Up @@ -991,7 +1004,7 @@
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:System.Text.Json, Version=6.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:System.Text.Json, Version=6.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_DB6720EAA3D5DA372A5924D4BD109058"
Expand All @@ -1018,20 +1031,20 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_ECC9F316C1DB31CE1C777158EBE5F947"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_ED01F8F93AD7AE95FE108EE94E3344DB"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:System.Threading.Channels, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"
"AssemblyIsInGAC" = "11:TRUE"
"AssemblyAsmDisplayName" = "8:System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_ECC9F316C1DB31CE1C777158EBE5F947"
"_ED01F8F93AD7AE95FE108EE94E3344DB"
{
"Name" = "8:System.Threading.Channels.dll"
"Name" = "8:System.Net.Http.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:System.Threading.Channels.dll"
"SourcePath" = "8:System.Net.Http.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_7B0911FFC0404DA390170CCE6287BC92"
Expand All @@ -1049,20 +1062,20 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_ED01F8F93AD7AE95FE108EE94E3344DB"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F87122926F8ED8FAB9B523E5BEAD40A9"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:TRUE"
"AssemblyAsmDisplayName" = "8:System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
"AssemblyAsmDisplayName" = "8:System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_ED01F8F93AD7AE95FE108EE94E3344DB"
"_F87122926F8ED8FAB9B523E5BEAD40A9"
{
"Name" = "8:System.Net.Http.dll"
"Name" = "8:System.IO.Compression.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:System.Net.Http.dll"
"SourcePath" = "8:System.IO.Compression.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_7B0911FFC0404DA390170CCE6287BC92"
Expand All @@ -1080,20 +1093,20 @@
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F87122926F8ED8FAB9B523E5BEAD40A9"
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_FAF12FB42146BB7C863FC2FDFF25A6DB"
{
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:TRUE"
"AssemblyAsmDisplayName" = "8:System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:OutOfProcessCOMBase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_F87122926F8ED8FAB9B523E5BEAD40A9"
"_FAF12FB42146BB7C863FC2FDFF25A6DB"
{
"Name" = "8:System.IO.Compression.dll"
"Name" = "8:OutOfProcessCOMBase.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:System.IO.Compression.dll"
"SourcePath" = "8:OutOfProcessCOMBase.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_7B0911FFC0404DA390170CCE6287BC92"
Expand Down Expand Up @@ -1137,6 +1150,17 @@
"Property" = "8:ProgramMenuFolder"
"Folders"
{
"{9EF0B969-E518-4E46-987F-47570745A589}:_E9B1894F2FF24CE581FD67DD51BBB7CD"
{
"Name" = "8:Mattermost Presence Provider"
"AlwaysCreate" = "11:FALSE"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Property" = "8:_07838E619505405088C244A97DE5C1E8"
"Folders"
{
}
}
}
}
"{3C67513D-01DD-4637-8A68-80971EB9504F}:_7B0911FFC0404DA390170CCE6287BC92"
Expand Down Expand Up @@ -1434,6 +1458,20 @@
}
"Shortcut"
{
"{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_326D122991C9406A8AA97B7501969A0B"
{
"Name" = "8:Mattermost Presence Provider"
"Arguments" = "8:"
"Description" = "8:"
"ShowCmd" = "3:1"
"IconIndex" = "3:0"
"Transitive" = "11:FALSE"
"Target" = "8:_13083496CDBF4520855C2C5A99DDA1F7"
"Folder" = "8:_E9B1894F2FF24CE581FD67DD51BBB7CD"
"WorkingFolder" = "8:_7B0911FFC0404DA390170CCE6287BC92"
"Icon" = "8:"
"Feature" = "8:"
}
}
"UserInterface"
{
Expand Down
Loading

0 comments on commit aecdb64

Please sign in to comment.