Compare commits

...

10 Commits

Author SHA1 Message Date
Chris Titus
1a894f80b1
Merge branch 'test-2024-03-21' into CW-MicroWin-240321 2024-03-28 08:50:39 -07:00
ChrisTitusTech
bc089a8ad5 Compile Winutil 2024-03-28 15:48:27 +00:00
Justawildwolf
6ed311c313
Upgrade Fix in #1181 (#1730) 2024-03-28 10:47:47 -05:00
ModernTTY
05be256368
Change order for easier launch in README and fix outdated info (#1732)
* Update README.md

* Update README.md

---------

Co-authored-by: NewCodingAI <165050080+NewCodingAI@users.noreply.github.com>
2024-03-28 10:47:10 -05:00
ChrisTitusTech
00b26e3e9b Compile Winutil 2024-03-28 15:45:41 +00:00
Rux
8c91bfca2d
Implement New Winget Install Method (#1738)
- Removed Get-LatestHash from Install-WinUtilWinget.ps1, replaced by Get-WinUtilWingetLatest.ps1.
- Added new Winget Install method in case of choco failing to install. Environment refresh line included.
- Get-WinUtilWingetPrerequisites added: Downloads the prerequisites required for the latest version of Winget.
- Get-WinUtilWingetLatest added: Uses the GitHub API to find the latest version of Winget and download it along with the accompanied License1.xml file.

Fixes:
- Removed --scope=machine from winget install command in Install-WinUtilProgramWinget. Non-UWP Apps fail to install if scope is set to machine. Error code: 0x80070005. More information commented in file.
2024-03-28 10:45:15 -05:00
ChrisTitusTech
c0b6a45fcc Compile Winutil 2024-03-28 15:44:29 +00:00
Joan Solana Raduà
6971016e00
IPv6 update (#1739)
* Compile Winutil

* Change ipv6 disable method

* Compile Winutil

* IPv6 + Teredo

* Compile Winutil

* IPv6 registry

* Compile Winutil

* Update Winutil

* Compile Winutil

* Fix to original command

* Compile Winutil

---------

Co-authored-by: Joanty24 <Joanty24@users.noreply.github.com>
Co-authored-by: Chris Titus <contact@christitus.com>
2024-03-28 10:43:50 -05:00
ChrisTitusTech
389705bf17 Compile Winutil 2024-03-28 15:43:00 +00:00
Mr.k
275f087bbc
Fix typo in the Description of 'Get-Oscdimg.ps1' private function (#1743) 2024-03-28 10:42:35 -05:00
9 changed files with 112 additions and 12546 deletions

View File

@ -22,15 +22,16 @@ Winutil must be run in Admin mode because it performs system-wide tweaks. To ach
#### Simple way #### Simple way
```
iwr -useb https://christitus.com/win | iex
```
or by executing:
``` ```
irm https://christitus.com/win | iex irm https://christitus.com/win | iex
``` ```
Courtesy of the issue raised at: [#144](/../../issues/144) Courtesy of the issue raised at: [#144](/../../issues/144)
or by executing:
```
iwr -useb https://christitus.com/win | iex
```
if for some reason this site is not reachable from your country please try running it directly from github if for some reason this site is not reachable from your country please try running it directly from github
``` ```
@ -97,7 +98,9 @@ If you are still having issues try changing your DNS provider to 1.1.1.1 || 1.0.
- Essential Tweaks: Offers a collection of essential tweaks aimed at improving system performance, privacy, and resource utilization. These tweaks include creating a system restore point, disabling telemetry, Wi-Fi Sense, setting services to manual, disabling location tracking, and HomeGroup, among others. - Essential Tweaks: Offers a collection of essential tweaks aimed at improving system performance, privacy, and resource utilization. These tweaks include creating a system restore point, disabling telemetry, Wi-Fi Sense, setting services to manual, disabling location tracking, and HomeGroup, among others.
- Misc. Tweaks: Encompasses a range of various tweaks to further optimize the system. These tweaks include enabling/disabling power throttling, enabling num lock on startup, removing Cortana and Edge, disabling User Account Control (UAC), notification panel, and configuring TPM during updates, among others. - Advanced Tweaks: Encompasses a range of various advanced power user tweaks to further optimize the system. These tweaks include removing OneDrive and Edge, disabling User Account Control (UAC), notification panel, among others.
- Toggles: Adds easy to use, one click shortcuts for toggling dark mode, NumLock on startup, file extensions, sticky keys, among others.
- Additional Tweaks: Introduces various other tweaks such as enabling dark mode, changing DNS settings, adding an Ultimate Performance mode, and creating shortcuts for WinUtil tools. These tweaks provide users with additional customization options to tailor their system to their preferences. - Additional Tweaks: Introduces various other tweaks such as enabling dark mode, changing DNS settings, adding an Ultimate Performance mode, and creating shortcuts for WinUtil tools. These tweaks provide users with additional customization options to tailor their system to their preferences.

View File

@ -2527,6 +2527,15 @@
"category": "z__Advanced Tweaks - CAUTION", "category": "z__Advanced Tweaks - CAUTION",
"panel": "1", "panel": "1",
"Order": "a031_", "Order": "a031_",
"registry": [
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
"Name": "DisabledComponents",
"Value": "255",
"OriginalValue": "0",
"Type": "DWord"
}
],
"InvokeScript": [ "InvokeScript": [
"Disable-NetAdapterBinding -Name \"*\" -ComponentID ms_tcpip6" "Disable-NetAdapterBinding -Name \"*\" -ComponentID ms_tcpip6"
], ],
@ -2540,6 +2549,15 @@
"category": "z__Advanced Tweaks - CAUTION", "category": "z__Advanced Tweaks - CAUTION",
"panel": "1", "panel": "1",
"Order": "a030_", "Order": "a030_",
"registry": [
{
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
"Name": "DisabledComponents",
"Value": "0",
"OriginalValue": "0",
"Type": "DWord"
}
],
"InvokeScript": [ "InvokeScript": [
"Enable-NetAdapterBinding -Name \"*\" -ComponentID ms_tcpip6" "Enable-NetAdapterBinding -Name \"*\" -ComponentID ms_tcpip6"
], ],

View File

@ -2,7 +2,7 @@ function Get-Oscdimg {
<# <#
.DESCRIPTION .DESCRIPTION
This function will get oscdimg file for from github Release foldersand put it into env:temp This function will download oscdimg file from github Release folders and put it into env:temp folder
.EXAMPLE .EXAMPLE
Get-Oscdimg Get-Oscdimg

View File

@ -0,0 +1,23 @@
function Get-WinUtilWingetLatest {
<#
.SYNOPSIS
Uses GitHub API to check for the latest release of Winget.
.DESCRIPTION
This function grabs the latest version of Winget and returns the download path to Install-WinUtilWinget for installation.
#>
Try{
# Grabs the latest release of Winget from the Github API for the install process.
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/Winget-cli/releases/latest" -Method Get -ErrorAction Stop
$latestVersion = $response.tag_name #Stores version number of latest release.
$licenseWingetUrl = $response.assets.browser_download_url[0] #Index value for License file.
Write-Host "Latest Version:`t$($latestVersion)`n"
$assetUrl = $response.assets.browser_download_url[2] #Index value for download URL.
Invoke-WebRequest -Uri $licenseWingetUrl -OutFile $ENV:TEMP\License1.xml
# The only pain is that the msixbundle for winget-cli is 246MB. In some situations this can take a bit, with slower connections.
Invoke-WebRequest -Uri $assetUrl -OutFile $ENV:TEMP\Microsoft.DesktopAppInstaller.msixbundle
}
Catch{
throw [WingetFailedInstall]::new('Failed to get latest Winget release and license')
}
}

View File

@ -0,0 +1,29 @@
function Get-WinUtilWingetPrerequisites {
<#
.SYNOPSIS
Downloads the Winget Prereqs.
.DESCRIPTION
Downloads Prereqs for Winget. Version numbers are coded as variables and can be updated as uncommonly as Microsoft updates the prereqs.
#>
# I don't know of a way to detect the prereqs automatically, so if someone has a better way of defining these, that would be great.
# Microsoft.VCLibs version rarely changes, but for future compatibility I made it a variable.
$versionVCLibs = "14.00"
$fileVCLibs = "https://aka.ms/Microsoft.VCLibs.x64.${versionVCLibs}.Desktop.appx"
# Write-Host "$fileVCLibs"
# Microsoft.UI.Xaml version changed recently, so I made the version numbers variables.
$versionUIXamlMinor = "2.8"
$versionUIXamlPatch = "2.8.6"
$fileUIXaml = "https://github.com/microsoft/microsoft-ui-xaml/releases/download/v${versionUIXamlPatch}/Microsoft.UI.Xaml.${versionUIXamlMinor}.x64.appx"
# Write-Host "$fileUIXaml"
Try{
Write-Host "Downloading Microsoft.VCLibs Dependency..."
Invoke-WebRequest -Uri $fileVCLibs -OutFile $ENV:TEMP\Microsoft.VCLibs.x64.Desktop.appx
Write-Host "Downloading Microsoft.UI.Xaml Dependency...`n"
Invoke-WebRequest -Uri $fileUIXaml -OutFile $ENV:TEMP\Microsoft.UI.Xaml.x64.appx
}
Catch{
throw [WingetFailedInstall]::new('Failed to install prerequsites')
}
}

View File

@ -30,7 +30,10 @@ Function Install-WinUtilProgramWinget {
Write-Progress -Activity "$manage Applications" -Status "$manage $Program $($x + 1) of $count" -PercentComplete $($x/$count*100) Write-Progress -Activity "$manage Applications" -Status "$manage $Program $($x + 1) of $count" -PercentComplete $($x/$count*100)
if($manage -eq "Installing"){ if($manage -eq "Installing"){
Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --scope=machine --silent $Program" -NoNewWindow -Wait # --scope=machine when installing non-UWP apps with winget fails with error code 0x80070005.
# Removed argument while testing new Winget install method.
# Open issue on winget-cli github repo: https://github.com/microsoft/winget-cli/issues/3936
Start-Process -FilePath winget -ArgumentList "install -e --accept-source-agreements --accept-package-agreements --silent $Program" -NoNewWindow -Wait
} }
if($manage -eq "Uninstalling"){ if($manage -eq "Uninstalling"){
Start-Process -FilePath winget -ArgumentList "uninstall -e --accept-source-agreements --purge --force --silent $Program" -NoNewWindow -Wait Start-Process -FilePath winget -ArgumentList "uninstall -e --accept-source-agreements --purge --force --silent $Program" -NoNewWindow -Wait

View File

@ -1,26 +1,16 @@
function Get-LatestHash {
$shaUrl = ((Invoke-WebRequest $apiLatestUrl -UseBasicParsing | ConvertFrom-Json).assets | Where-Object { $_.name -match '^Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.txt$' }).browser_download_url
$shaFile = Join-Path -Path $tempFolder -ChildPath 'Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.txt'
$WebClient.DownloadFile($shaUrl, $shaFile)
Get-Content $shaFile
}
function Install-WinUtilWinget { function Install-WinUtilWinget {
<# <#
.SYNOPSIS .SYNOPSIS
Installs Winget if it is not already installed Installs Winget if it is not already installed.
.DESCRIPTION .DESCRIPTION
This function will download the latest version of winget and install it. If winget is already installed, it will do nothing. This function will download the latest version of Winget and install it. If Winget is already installed, it will do nothing.
#> #>
Try{ Try{
Write-Host "Checking if Winget is Installed..." Write-Host "Checking if Winget is Installed..."
if (Test-WinUtilPackageManager -winget) { if (Test-WinUtilPackageManager -Winget) {
# Checks if winget executable exists and if the Windows Version is 1809 or higher # Checks if Winget executable exists and if the Windows Version is 1809 or higher
Write-Host "Winget Already Installed" Write-Host "Winget Already Installed"
return return
} }
@ -34,17 +24,35 @@ function Install-WinUtilWinget {
} }
if (($ComputerInfo.WindowsVersion) -lt "1809") { if (($ComputerInfo.WindowsVersion) -lt "1809") {
# Checks if Windows Version is too old for winget # Checks if Windows Version is too old for Winget
Write-Host "Winget is not supported on this version of Windows (Pre-1809)" Write-Host "Winget is not supported on this version of Windows (Pre-1809)"
return return
} }
Write-Host "Running Alternative Installer and Direct Installing" if((Get-Command -Name choco -ErrorAction Ignore)) {
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget" # Checks if Chocolatey is present (In case it didn't install properly), and installs Winget with choco, if so.
Write-Host "Chocolatey detected. Installing Winget via Chocolatey"
Write-Host "Winget Installed" Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget-cli"
Write-Host "Winget Installed"
Write-Output "Refreshing Environment Variables...`n"
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
}
Else {
# If Chocolatey doesn't exist, it will install Winget through more manual means.
# Used part of my own script with some modification: ruxunderscore/windows-initialization
Write-Host "Downloading Winget Prerequsites"
Get-WinUtilWingetPrerequisites
Write-Host "Downloading Winget and License File"
Get-WinUtilWingetLatest
Write-Host "Installing Winget w/ Prerequsites"
Add-AppxProvisionedPackage -Online -PackagePath $ENV:TEMP\Microsoft.DesktopAppInstaller.msixbundle -DependencyPackagePath $ENV:TEMP\Microsoft.VCLibs.x64.Desktop.appx, $ENV:TEMP\Microsoft.UI.Xaml.x64.appx -LicensePath $ENV:TEMP\License1.xml
Write-Host "Winget Installed"
# Winget only needs a refresh of the environment variables to be used.
Write-Output "Refreshing Environment Variables...`n"
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
}
} }
Catch{ Catch{
throw [WingetFailedInstall]::new('Failed to install') throw [WingetFailedInstall]::new('Failed to install')
} }
} }

View File

@ -12,7 +12,7 @@ Function Update-WinUtilProgramWinget {
$host.ui.RawUI.WindowTitle = """Winget Install""" $host.ui.RawUI.WindowTitle = """Winget Install"""
Start-Transcript $ENV:TEMP\winget-update.log -Append Start-Transcript $ENV:TEMP\winget-update.log -Append
winget upgrade --all winget upgrade --all --accept-source-agreements --accept-package-agreements --scope=machine --silent
} }

12518
winutil.ps1

File diff suppressed because it is too large Load Diff