diff --git a/OneMore.sln b/OneMore.sln index 7bf373b6f9..4d898af8b1 100644 --- a/OneMore.sln +++ b/OneMore.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29905.134 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneMore", "OneMore\OneMore.csproj", "{D874E185-08FE-48C5-BADE-0FE84060C978}" EndProject @@ -16,6 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution LICENSE = LICENSE Reference\onenotecontrols-2016.xlsx = Reference\onenotecontrols-2016.xlsx README.md = README.md + register-onemore.reg = register-onemore.reg + setdevreg.ps1 = setdevreg.ps1 setversion.ps1 = setversion.ps1 EndProjectSection EndProject @@ -54,7 +56,7 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D874E185-08FE-48C5-BADE-0FE84060C978}.Debug|Any CPU.ActiveCfg = Debug|x86 + {D874E185-08FE-48C5-BADE-0FE84060C978}.Debug|Any CPU.ActiveCfg = Debug|x64 {D874E185-08FE-48C5-BADE-0FE84060C978}.Debug|x64.ActiveCfg = Debug|x64 {D874E185-08FE-48C5-BADE-0FE84060C978}.Debug|x64.Build.0 = Debug|x64 {D874E185-08FE-48C5-BADE-0FE84060C978}.Debug|x86.ActiveCfg = Debug|x86 diff --git a/OneMore/Commands/Reminders/ReminderService.cs b/OneMore/Commands/Reminders/ReminderService.cs index 650f8e649e..b784f6fee8 100644 --- a/OneMore/Commands/Reminders/ReminderService.cs +++ b/OneMore/Commands/Reminders/ReminderService.cs @@ -4,6 +4,7 @@ namespace River.OneMoreAddIn.Commands { + using Microsoft.Win32; using River.OneMoreAddIn.Models; using System; using System.IO; @@ -135,7 +136,7 @@ await ReminderIsValid(reminder, pageID, one)) { Send( string.Format( - Resx.Reminder_PastDue, + Resx.Reminder_PastDue, reminder.Due.ToShortFriendlyString(), reminder.Subject ), @@ -187,7 +188,7 @@ private async Task ReminderIsValid(Reminder reminder, string pageID, OneNo } reminders.Remove(orphan); - page.SetMeta(MetaNames.Reminder, serializer.EncodeContent(reminders)); + page.SetMeta(MetaNames.Reminder, serializer.EncodeContent(reminders)); await one.Update(page); return false; @@ -196,6 +197,17 @@ private async Task ReminderIsValid(Reminder reminder, string pageID, OneNo private void Send(string message, string args) { + // this is for debugging; if SilentReminders value exists then only log + var key = Registry.ClassesRoot.OpenSubKey(@"River.OneMoreAddIn", false); + if (key != null) + { + if ((string)key.GetValue("SilentReminders") == "true") + { + logger.WriteLine($"Toast: {message}"); + return; + } + } + /* diff --git a/OneMoreSetupActions/Deployments/EdgeWebViewDeployment.cs b/OneMoreSetupActions/Deployments/EdgeWebViewDeployment.cs index 0409d14fa3..a3c02f326b 100644 --- a/OneMoreSetupActions/Deployments/EdgeWebViewDeployment.cs +++ b/OneMoreSetupActions/Deployments/EdgeWebViewDeployment.cs @@ -33,9 +33,17 @@ public override bool Install() logger.WriteLine(); logger.WriteLine("EdgeWebViewDeployment.Install ---"); + var key = Registry.LocalMachine.OpenSubKey($"{ClientKey}\\{RuntimeId}"); + if (key != null) + { + logger.WriteLine("WebView2 Runtime is already installed"); + CleanupChromium(); + return true; + } + var bootstrap = Path.Combine( - Path.GetTempPath(), - Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) + ".exe"); + Path.GetTempPath(), + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) + ".exe"); if (!DownloadBootstrap(bootstrap)) { diff --git a/OneMoreSetupActions/Deployments/ProtocolHandlerDeployment.cs b/OneMoreSetupActions/Deployments/ProtocolHandlerDeployment.cs index af1eaa32e7..4860ef1e75 100644 --- a/OneMoreSetupActions/Deployments/ProtocolHandlerDeployment.cs +++ b/OneMoreSetupActions/Deployments/ProtocolHandlerDeployment.cs @@ -106,7 +106,7 @@ public override bool Install() Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), ProtocolHandler); - var cmd = $"\"{exe}\" %1 %2 %3"; + var cmd = $"\"{exe}\" %1 %2 %3 %4 %5"; key.SetValue(string.Empty, cmd); key.Dispose(); diff --git a/register-onemore.reg b/register-onemore.reg new file mode 100644 index 0000000000..3757323946 Binary files /dev/null and b/register-onemore.reg differ diff --git a/setdevreg.ps1 b/setdevreg.ps1 new file mode 100644 index 0000000000..e2552fd99c --- /dev/null +++ b/setdevreg.ps1 @@ -0,0 +1,62 @@ +<# +.SYNOPSIS +Update OneMore registry keys to point to the current development directories +intead of the program files install paths +#> + +param () + +Begin +{ + # ProductVersion may be truncated such as "4.12" so this expands it to be "4.12.0.0" + function MakeVersion + { + param($version) + $parts = $version.Split('.') + for (($i = $parts.Length); $i -lt 4; $i++) + { + $version = "$version.0" + } + return $version + } +} +Process +{ + $here = Get-Location + $guid = '{88AB88AB-CDFB-4C68-9C3A-F10B75A5BC61}' + $dll = Join-Path $here 'OneMore\bin\x86\Debug\River.OneMoreAddIn.dll' + + $0 = 'Registry::HKEY_CLASSES_ROOT\onemore\shell\open\command' + if (Test-Path $0) + { + $1 = Join-Path $here 'OneMoreProtocolHandler\bin\Debug\OneMoreProtocolHandler.exe' + Write-Host "setting $0" + Set-ItemProperty $0 -Name '(Default)' -Type String -Value "$1 %1 %2 %3 %4 %5" + } + + $0 = "Registry::HKEY_CLASSES_ROOT\CLSID\$guid\InprocServer32" + if (Test-Path $0) + { + Write-Host "setting $0" + Set-ItemProperty $0 -Name CodeBase -Type String -Value $dll + } + + if (Test-Path $dll) + { + $pv = MaKeVersion (Get-Item $dll | % { $_.VersionInfo.ProductVersion }) + $0 = "Registry::HKEY_CLASSES_ROOT\CLSID\$guid\InprocServer32\$pv" + Write-Host "testing $0" + if (Test-Path $0) + { + Write-Host "setting $0" + Set-ItemProperty $0 -Name CodeBase -Type String -Value $dll + } + } + + $0 = 'Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\River.OneMoreAddIn.dll' + if (Test-Path $0) + { + Write-Host "setting $0" + Set-ItemProperty $0 -Name Path -Type String -Value $dll + } +}