Browse Source

Fixes for #466 and #472

pull/486/head
Dmitry Nefedov 1 year ago
parent
commit
59e2366734
  1. 6
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  2. 18
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  3. 6
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  4. 18
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

6
src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

@ -556,11 +556,7 @@ public static string GetString(uint strId)
}
# Check if Microsoft Edge as being a system component was removed by harmful tweakers
if (Test-Path -Path "${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe")
{
return
}
else
if (-not (Test-Path -Path "${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe"))
{
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll

18
src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1

@ -562,11 +562,7 @@ public static string GetString(uint strId)
}
# Check if Microsoft Edge as being a system component was removed by harmful tweakers
if (Test-Path -Path "${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe")
{
return
}
else
if (-not (Test-Path -Path "${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe"))
{
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
@ -630,6 +626,9 @@ public static string GetString(uint strId)
# Save all opened folders in order to restore them after File Explorer restart
$Script:OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke()
# Import PowerShell 5.1 modules
Import-Module -Name Microsoft.PowerShell.Management, PackageManagement, Appx -UseWindowsPowerShell
# Display a warning message about whether a user has customized the preset file
if ($Warning)
{
@ -14960,8 +14959,7 @@ public static void PostMessage()
$ToastXml.LoadXml($ToastTemplate.OuterXml)
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
# PowerShell 7.3 doesn't support yet using own caller app toast notifications. Fixed in PowerShell 7.4.0-preview.1
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier().Show($ToastMessage)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage)
# Telegram channel
# Extract the localized "Open" string from shell32.dll
@ -14989,8 +14987,7 @@ public static void PostMessage()
$ToastXml.LoadXml($ToastTemplate.OuterXml)
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
# PowerShell 7.3 doesn't support yet using own caller app toast notifications. Fixed in PowerShell 7.4.0-preview.1
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier().Show($ToastMessage)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage)
# Discord group
# Extract the localized "Open" string from shell32.dll
@ -15018,8 +15015,7 @@ public static void PostMessage()
$ToastXml.LoadXml($ToastTemplate.OuterXml)
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
# PowerShell 7.3 doesn't support yet using own caller app toast notifications. Fixed in PowerShell 7.4.0-preview.1
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier().Show($ToastMessage)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage)
#endregion Toast notifications
# Check for UWP apps updates

6
src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

@ -610,11 +610,7 @@ public static string GetString(uint strId)
}
# Check if Microsoft Edge as being a system component was removed by harmful tweakers
if (Test-Path -Path "${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe")
{
return
}
else
if (-not (Test-Path -Path "${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe"))
{
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll

18
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -615,11 +615,7 @@ public static string GetString(uint strId)
}
# Check if Microsoft Edge as being a system component was removed by harmful tweakers
if (Test-Path -Path "${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe")
{
return
}
else
if (-not (Test-Path -Path "${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe"))
{
Write-Information -MessageData "" -InformationAction Continue
# Extract the localized "Please wait..." string from shell32.dll
@ -683,6 +679,9 @@ public static string GetString(uint strId)
# Save all opened folders in order to restore them after File Explorer restart
$Script:OpenedFolders = {(New-Object -ComObject Shell.Application).Windows() | ForEach-Object -Process {$_.Document.Folder.Self.Path}}.Invoke()
# Import PowerShell 5.1 modules
Import-Module -Name Microsoft.PowerShell.Management, PackageManagement, Appx -UseWindowsPowerShell
# Display a warning message about whether a user has customized the preset file
if ($Warning)
{
@ -14390,8 +14389,7 @@ public static void PostMessage()
$ToastXml.LoadXml($ToastTemplate.OuterXml)
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
# PowerShell 7.3 doesn't support yet using own caller app toast notifications. Fixed in PowerShell 7.4.0-preview.1
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier().Show($ToastMessage)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage)
# Telegram channel
# Extract the localized "Open" string from shell32.dll
@ -14419,8 +14417,7 @@ public static void PostMessage()
$ToastXml.LoadXml($ToastTemplate.OuterXml)
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
# PowerShell 7.3 doesn't support yet using own caller app toast notifications. Fixed in PowerShell 7.4.0-preview.1
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier().Show($ToastMessage)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage)
# Discord group
# Extract the localized "Open" string from shell32.dll
@ -14448,8 +14445,7 @@ public static void PostMessage()
$ToastXml.LoadXml($ToastTemplate.OuterXml)
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
# PowerShell 7.3 doesn't support yet using own caller app toast notifications. Fixed in PowerShell 7.4.0-preview.1
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier().Show($ToastMessage)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Sophia").Show($ToastMessage)
#endregion Toast notifications
# Check for UWP apps updates

Loading…
Cancel
Save