Browse Source

Improved code readability

pull/635/head
Dmitry Nefedov 3 weeks ago
parent
commit
0a3e9f23c0
  1. 1
      Wrapper/Localizations/de-DE/ui.json
  2. 1
      Wrapper/Localizations/en-US/ui.json
  3. 1
      Wrapper/Localizations/ru-RU/ui.json
  4. BIN
      Wrapper/SophiaScriptWrapper.exe
  5. 8
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  6. 2
      src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
  7. 2
      src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
  8. 8
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  9. 12
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  10. 2
      src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1
  11. 8
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

1
Wrapper/Localizations/de-DE/ui.json

@ -6,6 +6,7 @@
"menuImportPreset": "Voreinstellung importieren", "menuImportPreset": "Voreinstellung importieren",
"menuExportPreset": "Voreinstellung exportieren", "menuExportPreset": "Voreinstellung exportieren",
"menuAutosave": "Automatisches Speichern", "menuAutosave": "Automatisches Speichern",
"menuPresets": "Voreinstellungen",
"menuOpposite": "Alle umkehren", "menuOpposite": "Alle umkehren",
"menuClear": "Löschen", "menuClear": "Löschen",
"menuClearTab": "Registerkarte löschen", "menuClearTab": "Registerkarte löschen",

1
Wrapper/Localizations/en-US/ui.json

@ -6,6 +6,7 @@
"menuImportPreset": "Import Preset", "menuImportPreset": "Import Preset",
"menuExportPreset": "Export Preset", "menuExportPreset": "Export Preset",
"menuAutosave": "Autosave", "menuAutosave": "Autosave",
"menuPresets": "Presets",
"menuOpposite": "Opposite", "menuOpposite": "Opposite",
"menuClear": "Clear", "menuClear": "Clear",
"menuClearTab": "Clear Tab", "menuClearTab": "Clear Tab",

1
Wrapper/Localizations/ru-RU/ui.json

@ -6,6 +6,7 @@
"menuImportPreset": "Импортировать пресет", "menuImportPreset": "Импортировать пресет",
"menuExportPreset": "Экспортировать пресет", "menuExportPreset": "Экспортировать пресет",
"menuAutosave": "Автосохранение", "menuAutosave": "Автосохранение",
"menuPresets": "Пресеты",
"menuOpposite": "Противоположные значения", "menuOpposite": "Противоположные значения",
"menuClear": "Очистить", "menuClear": "Очистить",
"menuClearTab": "Очистить вкладку", "menuClearTab": "Очистить вкладку",

BIN
Wrapper/SophiaScriptWrapper.exe

Binary file not shown.

8
src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

@ -5261,7 +5261,7 @@ public static bool MarkFileDelete (string sourcefile)
} }
else else
{ {
Start-Process -FilePath explorer -ArgumentList $env:OneDrive Start-Process -FilePath "$env:SystemRoot\explorer.exe" -ArgumentList $env:OneDrive
} }
} }
@ -5289,7 +5289,7 @@ public static bool MarkFileDelete (string sourcefile)
$FileSyncShell64dlls = Get-ChildItem -Path "$OneDriveFolder\*\FileSyncShell64.dll" -Force $FileSyncShell64dlls = Get-ChildItem -Path "$OneDriveFolder\*\FileSyncShell64.dll" -Force
foreach ($FileSyncShell64dll in $FileSyncShell64dlls.FullName) foreach ($FileSyncShell64dll in $FileSyncShell64dlls.FullName)
{ {
Start-Process -FilePath regsvr32.exe -ArgumentList "/u /s $FileSyncShell64dll" -Wait Start-Process -FilePath "$env:SystemRoot\System32\regsvr32.exe" -ArgumentList "/u /s $FileSyncShell64dll" -Wait
Remove-Item -Path $FileSyncShell64dll -Force -ErrorAction Ignore Remove-Item -Path $FileSyncShell64dll -Force -ErrorAction Ignore
if (Test-Path -Path $FileSyncShell64dll) if (Test-Path -Path $FileSyncShell64dll)
@ -5305,7 +5305,7 @@ public static bool MarkFileDelete (string sourcefile)
} }
# We need to wait for a few seconds to let explore launch unless it will fail to do so # We need to wait for a few seconds to let explore launch unless it will fail to do so
Start-Process -FilePath explorer Start-Process -FilePath "$env:SystemRoot\explorer.exe"
Start-Sleep -Seconds 3 Start-Sleep -Seconds 3
$Path = @( $Path = @(
@ -15119,7 +15119,7 @@ public static void PostMessage()
{ {
if (Test-Path -Path $Script:OpenedFolder) if (Test-Path -Path $Script:OpenedFolder)
{ {
Start-Process -FilePath explorer -ArgumentList $Script:OpenedFolder Start-Process -FilePath "$env:SystemRoot\explorer.exe" -ArgumentList $Script:OpenedFolder
} }
} }
} }

2
src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1

@ -11666,7 +11666,7 @@ public static void PostMessage()
{ {
if (Test-Path -Path $Script:OpenedFolder) if (Test-Path -Path $Script:OpenedFolder)
{ {
Start-Process -FilePath explorer -ArgumentList $Script:OpenedFolder Start-Process -FilePath "$env:SystemRoot\explorer.exe" -ArgumentList $Script:OpenedFolder
} }
} }
} }

2
src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1

@ -13055,7 +13055,7 @@ public static void PostMessage()
{ {
if (Test-Path -Path $Script:OpenedFolder) if (Test-Path -Path $Script:OpenedFolder)
{ {
Start-Process -FilePath explorer -ArgumentList $Script:OpenedFolder Start-Process -FilePath "$env:SystemRoot\explorer.exe" -ArgumentList $Script:OpenedFolder
} }
} }
} }

8
src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1

@ -5295,7 +5295,7 @@ public static bool MarkFileDelete (string sourcefile)
} }
else else
{ {
Start-Process -FilePath explorer -ArgumentList $env:OneDrive Start-Process -FilePath "$env:SystemRoot\explorer.exe" -ArgumentList $env:OneDrive
} }
} }
@ -5323,7 +5323,7 @@ public static bool MarkFileDelete (string sourcefile)
$FileSyncShell64dlls = Get-ChildItem -Path "$OneDriveFolder\*\FileSyncShell64.dll" -Force $FileSyncShell64dlls = Get-ChildItem -Path "$OneDriveFolder\*\FileSyncShell64.dll" -Force
foreach ($FileSyncShell64dll in $FileSyncShell64dlls.FullName) foreach ($FileSyncShell64dll in $FileSyncShell64dlls.FullName)
{ {
Start-Process -FilePath regsvr32.exe -ArgumentList "/u /s $FileSyncShell64dll" -Wait Start-Process -FilePath "$env:SystemRoot\System32\regsvr32.exe" -ArgumentList "/u /s $FileSyncShell64dll" -Wait
Remove-Item -Path $FileSyncShell64dll -Force -ErrorAction Ignore Remove-Item -Path $FileSyncShell64dll -Force -ErrorAction Ignore
if (Test-Path -Path $FileSyncShell64dll) if (Test-Path -Path $FileSyncShell64dll)
@ -5339,7 +5339,7 @@ public static bool MarkFileDelete (string sourcefile)
} }
# We need to wait for a few seconds to let explore launch unless it will fail to do so # We need to wait for a few seconds to let explore launch unless it will fail to do so
Start-Process -FilePath explorer Start-Process -FilePath "$env:SystemRoot\explorer.exe"
Start-Sleep -Seconds 3 Start-Sleep -Seconds 3
$Path = @( $Path = @(
@ -15163,7 +15163,7 @@ public static void PostMessage()
{ {
if (Test-Path -Path $Script:OpenedFolder) if (Test-Path -Path $Script:OpenedFolder)
{ {
Start-Process -FilePath explorer -ArgumentList $Script:OpenedFolder Start-Process -FilePath "$env:SystemRoot\explorer.exe" -ArgumentList $Script:OpenedFolder
} }
} }
} }

12
src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

@ -375,8 +375,8 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
$Parameters = @{ $Parameters = @{
Uri = "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update_v6.txt" Uri = "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update_v6.txt"
UseBasicParsing = $true UseBasicParsing = $true
Verbose = $true Verbose = $true
} }
$update_v6 = (Invoke-WebRequest @Parameters).Content $update_v6 = (Invoke-WebRequest @Parameters).Content
$IPArray += $extra, $extra_v6, $spy, $spy_v6, $update, $update_v6 $IPArray += $extra, $extra_v6, $spy, $spy_v6, $update, $update_v6
@ -4871,7 +4871,7 @@ public static bool MarkFileDelete (string sourcefile)
} }
else else
{ {
Start-Process -FilePath explorer -ArgumentList $env:OneDrive Start-Process -FilePath "$env:SystemRoot\explorer.exe" -ArgumentList $env:OneDrive
} }
} }
@ -4899,7 +4899,7 @@ public static bool MarkFileDelete (string sourcefile)
$FileSyncShell64dlls = Get-ChildItem -Path "$OneDriveFolder\*\FileSyncShell64.dll" -Force $FileSyncShell64dlls = Get-ChildItem -Path "$OneDriveFolder\*\FileSyncShell64.dll" -Force
foreach ($FileSyncShell64dll in $FileSyncShell64dlls.FullName) foreach ($FileSyncShell64dll in $FileSyncShell64dlls.FullName)
{ {
Start-Process -FilePath regsvr32.exe -ArgumentList "/u /s $FileSyncShell64dll" -Wait Start-Process -FilePath "$env:SystemRoot\System32\regsvr32.exe" -ArgumentList "/u /s $FileSyncShell64dll" -Wait
Remove-Item -Path $FileSyncShell64dll -Force -ErrorAction Ignore Remove-Item -Path $FileSyncShell64dll -Force -ErrorAction Ignore
if (Test-Path -Path $FileSyncShell64dll) if (Test-Path -Path $FileSyncShell64dll)
@ -4915,7 +4915,7 @@ public static bool MarkFileDelete (string sourcefile)
} }
# We need to wait for a few seconds to let explore launch unless it will fail to do so # We need to wait for a few seconds to let explore launch unless it will fail to do so
Start-Process -FilePath explorer Start-Process -FilePath "$env:SystemRoot\explorer.exe"
Start-Sleep -Seconds 3 Start-Sleep -Seconds 3
$Path = @( $Path = @(
@ -14153,7 +14153,7 @@ public static void PostMessage()
{ {
if (Test-Path -Path $Script:OpenedFolder) if (Test-Path -Path $Script:OpenedFolder)
{ {
Start-Process -FilePath explorer -ArgumentList $Script:OpenedFolder Start-Process -FilePath "$env:SystemRoot\explorer.exe" -ArgumentList $Script:OpenedFolder
} }
} }
} }

2
src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1

@ -13047,7 +13047,7 @@ public static void PostMessage()
{ {
if (Test-Path -Path $Script:OpenedFolder) if (Test-Path -Path $Script:OpenedFolder)
{ {
Start-Process -FilePath explorer -ArgumentList $Script:OpenedFolder Start-Process -FilePath "$env:SystemRoot\explorer.exe" -ArgumentList $Script:OpenedFolder
} }
} }
} }

8
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -4905,7 +4905,7 @@ public static bool MarkFileDelete (string sourcefile)
} }
else else
{ {
Start-Process -FilePath explorer -ArgumentList $env:OneDrive Start-Process -FilePath "$env:SystemRoot\explorer.exe" -ArgumentList $env:OneDrive
} }
} }
@ -4933,7 +4933,7 @@ public static bool MarkFileDelete (string sourcefile)
$FileSyncShell64dlls = Get-ChildItem -Path "$OneDriveFolder\*\FileSyncShell64.dll" -Force $FileSyncShell64dlls = Get-ChildItem -Path "$OneDriveFolder\*\FileSyncShell64.dll" -Force
foreach ($FileSyncShell64dll in $FileSyncShell64dlls.FullName) foreach ($FileSyncShell64dll in $FileSyncShell64dlls.FullName)
{ {
Start-Process -FilePath regsvr32.exe -ArgumentList "/u /s $FileSyncShell64dll" -Wait Start-Process -FilePath "$env:SystemRoot\System32\regsvr32.exe" -ArgumentList "/u /s $FileSyncShell64dll" -Wait
Remove-Item -Path $FileSyncShell64dll -Force -ErrorAction Ignore Remove-Item -Path $FileSyncShell64dll -Force -ErrorAction Ignore
if (Test-Path -Path $FileSyncShell64dll) if (Test-Path -Path $FileSyncShell64dll)
@ -4949,7 +4949,7 @@ public static bool MarkFileDelete (string sourcefile)
} }
# We need to wait for a few seconds to let explore launch unless it will fail to do so # We need to wait for a few seconds to let explore launch unless it will fail to do so
Start-Process -FilePath explorer Start-Process -FilePath "$env:SystemRoot\explorer.exe"
Start-Sleep -Seconds 3 Start-Sleep -Seconds 3
$Path = @( $Path = @(
@ -14197,7 +14197,7 @@ public static void PostMessage()
{ {
if (Test-Path -Path $Script:OpenedFolder) if (Test-Path -Path $Script:OpenedFolder)
{ {
Start-Process -FilePath explorer -ArgumentList $Script:OpenedFolder Start-Process -FilePath "$env:SystemRoot\explorer.exe" -ArgumentList $Script:OpenedFolder
} }
} }
} }

Loading…
Cancel
Save