Skip to content

Commit ac4e1a1

Browse files
committed
Update chocolateyinstall.ps1
1 parent 14473a2 commit ac4e1a1

File tree

32 files changed

+90
-222
lines changed

32 files changed

+90
-222
lines changed

.github/workflows/Chocolatey.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ jobs:
2020
Write-Verbose -Message $env:LatestRelease -Verbose
2121
2222
# Replace variables with script latest versions
23-
(Get-Content -Path "chocolatey\sophia.nuspec" -Encoding utf8NoBOM -Raw) -replace ("SophiaScriptVersion", "${{ env.LatestRelease }}") | Set-Content -Path "chocolatey\sophia.nuspec" -Encoding utf8NoBOM -Force
23+
(Get-Content -Path "Scripts\Chocolatey\sophia.nuspec" -Encoding utf8NoBOM -Raw) -replace ("SophiaScriptVersion", "${{ env.LatestRelease }}") | Set-Content -Path "Scripts\Chocolatey\sophia.nuspec" -Encoding utf8NoBOM -Force
2424
25-
choco pack chocolatey\sophia.nuspec --outputdirectory chocolatey
25+
choco pack Scripts\Chocolatey\sophia.nuspec --outputdirectory Scripts\Chocolatey
2626
choco apikey --key ${{ secrets.CHOCOLATEY_SECRET }} --source https://push.chocolatey.org/
27-
[xml]$Version = Get-Content -Path chocolatey\sophia.nuspec
27+
[xml]$Version = Get-Content -Path Scripts\Chocolatey\sophia.nuspec
2828
[string]$Version = $Version.package.metadata.version
29-
choco push chocolatey\sophia.$Version.nupkg --source https://push.chocolatey.org/ --yes
29+
Write-Verbose -Message $Version -Verbose
30+
choco push Scripts\Chocolatey\sophia.$Version.nupkg --source https://push.chocolatey.org/ --yes

chocolatey/tools/chocolateyinstall.ps1 renamed to Scripts/Chocolatey/tools/chocolateyinstall.ps1

Lines changed: 17 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<#
1+
<#
22
.SYNOPSIS
33
Get direct URL of Sophia Script archive, depending on which Windows it is run on
44
@@ -25,62 +25,23 @@ $Parameters = @{
2525
}
2626
$JSONVersions = Invoke-RestMethod @Parameters
2727

28-
$null = $packageParameters
2928
$packageParameters = $env:chocolateyPackageParameters
3029

3130
switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
3231
{
3332
"17763"
3433
{
35-
# Check for Windows 10 LTSC 2019
36-
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName) -match "LTSC 2019")
37-
{
38-
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2019
39-
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2019.v$LatestRelease.zip"
40-
$Hash = "Hash_Sophia_Script_Windows_10_LTSC2019"
41-
}
42-
else
43-
{
44-
Write-Verbose -Message "Windows version is not supported. Update your Windows" -Verbose
45-
46-
# Receive updates for other Microsoft products when you update Windows
47-
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
48-
49-
# Check for updates
50-
Start-Process -FilePath "$env:SystemRoot\System32\UsoClient.exe" -ArgumentList StartInteractiveScan
51-
52-
# Open the "Windows Update" page
53-
Start-Process -FilePath "ms-settings:windowsupdate"
54-
55-
pause
56-
exit
57-
}
34+
# Windows 10 LTSC 2019
35+
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2019
36+
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2019.v$LatestRelease.zip"
37+
$Hash = "Hash_Sophia_Script_Windows_10_LTSC2019"
5838
}
5939
"19044"
6040
{
61-
# Check for Windows 10 LTSC 2021
62-
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName) -match "LTSC 2021")
63-
{
64-
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2021
65-
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2021.v$LatestRelease.zip"
66-
$Hash = "Hash_Sophia_Script_Windows_10_LTSC2021"
67-
}
68-
else
69-
{
70-
Write-Verbose -Message "Windows version is not supported. Update your Windows" -Verbose
71-
72-
# Receive updates for other Microsoft products when you update Windows
73-
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
74-
75-
# Check for updates
76-
Start-Process -FilePath "$env:SystemRoot\System32\UsoClient.exe" -ArgumentList StartInteractiveScan
77-
78-
# Open the "Windows Update" page
79-
Start-Process -FilePath "ms-settings:windowsupdate"
80-
81-
pause
82-
exit
83-
}
41+
# Windows 10 LTSC 2021
42+
$LatestRelease = $JSONVersions.Sophia_Script_Windows_10_LTSC2021
43+
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.10.LTSC.2021.v$LatestRelease.zip"
44+
$Hash = "Hash_Sophia_Script_Windows_10_LTSC2021"
8445
}
8546
"19045"
8647
{
@@ -117,7 +78,7 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
11778
{
11879
if ((Get-CimInstance -ClassName CIM_Processor).Caption -match "ARM")
11980
{
120-
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_Arm__PowerShell_7
81+
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_Arm_PowerShell_7
12182
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.Arm.PowerShell.7.v$LatestRelease.zip"
12283
$Hash = "Hash_Sophia_Script_Windows_11_Arm_PowerShell_7"
12384
}
@@ -135,13 +96,13 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
13596
{
13697
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_Arm_PowerShell_5_1
13798
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.Arm.v$LatestRelease.zip"
138-
$Hash = "Hash_Sophia_Script_Windows_11_Arm"
99+
$Hash = "Hash_Sophia_Script_Windows_11_Arm_PowerShell_5_1"
139100
}
140101
else
141102
{
142103
$LatestRelease = $JSONVersions.Sophia_Script_Windows_11_PowerShell_5_1
143104
$URL = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$LatestGitHubRelease/Sophia.Script.for.Windows.11.v$LatestRelease.zip"
144-
$Hash = "Hash_Sophia_Script_Windows_11_PowerShell_7"
105+
$Hash = "Hash_Sophia_Script_Windows_11_PowerShell_5_1"
145106
}
146107
}
147108
}
@@ -150,11 +111,10 @@ switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber)
150111

151112
$Downloads = Get-ItemPropertyValue -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
152113
$Parameters = @{
153-
packageName = $env:ChocolateyPackageName
154-
fileType = "ZIP"
155-
unzipLocation = $Downloads
156-
url = $URL
157-
checksum = $Hash
158-
checksumType = "sha256"
114+
packageName = $env:ChocolateyPackageName
115+
UnzipLocation = $Downloads
116+
Url64bit = $URL
117+
Checksum64 = $Hash
118+
ChecksumType64 = "sha256"
159119
}
160120
Install-ChocolateyZipPackage @Parameters

Scripts/chocolatey.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ $Sophia_Script_Windows_10_PowerShell_7 = ($assets | Where-Object -FilterSc
1818
$Sophia_Script_Windows_10_LTSC2019 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.10.LTSC.2019.v$($Latest_Release.Sophia_Script_Windows_10_LTSC2019).zip"}).digest.Replace("sha256:", "")
1919
$Sophia_Script_Windows_10_LTSC2021 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.10.LTSC.2021.v$($Latest_Release.Sophia_Script_Windows_10_LTSC2021).zip"}).digest.Replace("sha256:", "")
2020
$Sophia_Script_Windows_11_PowerShell_5_1 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.v$($Latest_Release.Sophia_Script_Windows_11_PowerShell_5_1).zip"}).digest.Replace("sha256:", "")
21-
$Sophia_Script_Windows_11_Arm_PowerShell_5_1 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.v$($Latest_Release.Sophia_Script_Windows_11_Arm_PowerShell_5_1).zip"}).digest.Replace("sha256:", "")
22-
$Sophia_Script_Windows_11_Arm_PowerShell_7 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.v$($Latest_Release.Sophia_Script_Windows_11_Arm_PowerShell_7).zip"}).digest.Replace("sha256:", "")
21+
$Sophia_Script_Windows_11_Arm_PowerShell_5_1 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.Arm.v$($Latest_Release.Sophia_Script_Windows_11_Arm_PowerShell_5_1).zip"}).digest.Replace("sha256:", "")
22+
$Sophia_Script_Windows_11_Arm_PowerShell_7 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.Arm.PowerShell.7.v$($Latest_Release.Sophia_Script_Windows_11_Arm_PowerShell_7).zip"}).digest.Replace("sha256:", "")
2323
$Sophia_Script_Windows_11_PowerShell_7 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.PowerShell.7.v$($Latest_Release.Sophia_Script_Windows_11_PowerShell_7).zip"}).digest.Replace("sha256:", "")
2424
$Sophia_Script_Windows_11_LTSC2024 = ($assets | Where-Object -FilterScript {$_.name -eq "Sophia.Script.for.Windows.11.LTSC.2024.v$($Latest_Release.Sophia_Script_Windows_11_LTSC2024).zip"}).digest.Replace("sha256:", "")
2525

2626
# Replace variables with script latest versions
27-
(Get-Content -Path "chocolatey\tools\chocolateyinstall.ps1" -Encoding utf8 -Raw) | Foreach-Object -Process {
27+
(Get-Content -Path "Scripts\Chocolatey\tools\chocolateyinstall.ps1" -Encoding utf8 -Raw) | Foreach-Object -Process {
2828
$_ -replace "Hash_Sophia_Script_Windows_10_PowerShell_5_1", $Sophia_Script_Windows_10_PowerShell_5_1 `
2929
-replace "Hash_Sophia_Script_Windows_10_PowerShell_7", $Sophia_Script_Windows_10_PowerShell_7 `
3030
-replace "Hash_Sophia_Script_Windows_10_LTSC2019", $Sophia_Script_Windows_10_LTSC2019 `
@@ -34,7 +34,7 @@ $Sophia_Script_Windows_11_LTSC2024 = ($assets | Where-Object -FilterSc
3434
-replace "Hash_Sophia_Script_Windows_11_Arm_PowerShell_7", $Sophia_Script_Windows_11_Arm_PowerShell_7 `
3535
-replace "Hash_Sophia_Script_Windows_11_PowerShell_7", $Sophia_Script_Windows_11_PowerShell_7 `
3636
-replace "Hash_Sophia_Script_Windows_11_LTSC2024", $Sophia_Script_Windows_11_LTSC2024
37-
} | Set-Content -Path "chocolatey\tools\chocolateyinstall.ps1" -Encoding utf8 -Force
37+
} | Set-Content -Path "Scripts\Chocolatey\tools\chocolateyinstall.ps1" -Encoding utf8 -Force
3838

3939
# Save latest release tag for sophia.nuspec
4040
$LatestRelease = $Latest_Release.Sophia_Script_Windows_11_PowerShell_5_1

src/Sophia_Script_for_Windows_10/Module/Private/InitialActions.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
430430
{
431431
if (-not ([string]::IsNullOrEmpty($Item) -or $Item.StartsWith("#")))
432432
{
433-
Write-Information -MessageData "" -InformationAction Continue
434433
Write-Verbose -Message $Localization.HostsWarning -Verbose
435434

436435
do
@@ -902,6 +901,7 @@ public extern static string BrandingFormatString(string sFormat);
902901

903902
Clear-Host
904903

904+
# https://patorjk.com/software/taag/#p=display&f=Tmplr
905905
Write-Information -MessageData "┏┓ ┓ • ┏┓ • ┏ ┓ ┏• ┓ " -InformationAction Continue
906906
Write-Information -MessageData "┗┓┏┓┏┓┣┓┓┏┓ ┗┓┏┏┓┓┏┓╋ ╋┏┓┏┓ ┃┃┃┓┏┓┏┫┏┓┓┏┏┏" -InformationAction Continue
907907
Write-Information -MessageData "┗┛┗┛┣┛┛┗┗┗┻ ┗┛┗┛ ┗┣┛┗ ┛┗┛┛ ┗┻┛┗┛┗┗┻┗┛┗┻┛┛" -InformationAction Continue

src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,6 @@ function FeedbackFrequency
369369
.EXAMPLE
370370
ScheduledTasks -Enable
371371
372-
.NOTES
373-
A pop-up dialog box lets a user select tasks
374-
375372
.NOTES
376373
Current user
377374
#>
@@ -5087,9 +5084,6 @@ function WindowsManageDefaultPrinter
50875084
.EXAMPLE
50885085
WindowsFeatures -Enable
50895086
5090-
.NOTES
5091-
A pop-up dialog box lets a user select features
5092-
50935087
.NOTES
50945088
Current user
50955089
#>
@@ -5378,9 +5372,6 @@ function WindowsFeatures
53785372
.EXAMPLE
53795373
WindowsCapabilities -Install
53805374
5381-
.NOTES
5382-
A pop-up dialog box lets a user select features
5383-
53845375
.NOTES
53855376
Current user
53865377
#>
@@ -8386,10 +8377,7 @@ function RegistryBackup
83868377
.SYNOPSIS
83878378
Windows Subsystem for Linux (WSL)
83888379
8389-
.PARAMETER
8390-
Enable Windows Subsystem for Linux (WSL), install the latest WSL Linux kernel version, and a Linux distribution using a pop-up form
8391-
8392-
.EXAMPLE
8380+
.EXAMPLE Enable Windows Subsystem for Linux (WSL) and install the latest WSL Linux kernel version
83938381
Install-WSL
83948382
83958383
.NOTES

src/Sophia_Script_for_Windows_10/Sophia.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -674,23 +674,23 @@ WindowsManageDefaultPrinter -Disable
674674
# WindowsManageDefaultPrinter -Enable
675675

676676
<#
677-
Disable the Windows features using the pop-up dialog box
677+
Disable the Windows features using pop-up dialog box
678678
If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not disable the "Media Features" feature
679679
680680
Отключить компоненты Windows, используя всплывающее диалоговое окно
681681
Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах схемы управления питанием, не отключайте "Компоненты для работы с мультимедиа"
682682
#>
683683
WindowsFeatures -Disable
684684

685-
# Enable the Windows features using the pop-up dialog box
685+
# Enable the Windows features using pop-up dialog box
686686
# Включить компоненты Windows, используя всплывающее диалоговое окно
687687
# WindowsFeatures -Enable
688688

689-
# Uninstall optional features using the pop-up dialog box
689+
# Uninstall optional features using pop-up dialog box
690690
# Удалить дополнительные компоненты, используя всплывающее диалоговое окно
691691
WindowsCapabilities -Uninstall
692692

693-
# Install optional features using the pop-up dialog box
693+
# Install optional features using pop-up dialog box
694694
# Установить дополнительные компоненты, используя всплывающее диалоговое окно
695695
# WindowsCapabilities -Install
696696

@@ -952,12 +952,12 @@ RegistryBackup -Enable
952952
#endregion WSL
953953

954954
#region UWP apps
955-
# Uninstall UWP apps using the pop-up dialog box
955+
# Uninstall UWP apps using pop-up dialog box
956956
# Удалить UWP-приложения, используя всплывающее диалоговое окно
957957
Uninstall-UWPApps
958958

959959
<#
960-
Uninstall UWP apps for all users using the pop-up dialog box
960+
Uninstall UWP apps for all users using pop-up dialog box
961961
If the "For All Users" is checked apps packages will not be installed for new users
962962
963963
Удалить UWP-приложения для всех пользователей, используя всплывающее диалоговое окно

src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Private/InitialActions.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
430430
{
431431
if (-not ([string]::IsNullOrEmpty($Item) -or $Item.StartsWith("#")))
432432
{
433-
Write-Information -MessageData "" -InformationAction Continue
434433
Write-Verbose -Message $Localization.HostsWarning -Verbose
435434

436435
do
@@ -888,6 +887,7 @@ public extern static string BrandingFormatString(string sFormat);
888887

889888
Clear-Host
890889

890+
# https://patorjk.com/software/taag/#p=display&f=Tmplr
891891
Write-Information -MessageData "┏┓ ┓ • ┏┓ • ┏ ┓ ┏• ┓ " -InformationAction Continue
892892
Write-Information -MessageData "┗┓┏┓┏┓┣┓┓┏┓ ┗┓┏┏┓┓┏┓╋ ╋┏┓┏┓ ┃┃┃┓┏┓┏┫┏┓┓┏┏┏" -InformationAction Continue
893893
Write-Information -MessageData "┗┛┗┛┣┛┛┗┗┗┻ ┗┛┗┛ ┗┣┛┗ ┛┗┛┛ ┗┻┛┗┛┗┗┻┗┛┗┻┛┛" -InformationAction Continue

0 commit comments

Comments
 (0)