2023-03-07 14:28:00 -06:00
|
|
|
function Install-WinUtilWinget {
|
|
|
|
<#
|
2023-10-19 17:12:55 -05:00
|
|
|
|
|
|
|
.SYNOPSIS
|
2024-03-28 14:39:23 -05:00
|
|
|
Installs Winget if it is not already installed.
|
2023-10-19 17:12:55 -05:00
|
|
|
|
2023-11-28 16:11:11 -06:00
|
|
|
.DESCRIPTION
|
2024-03-28 14:39:23 -05:00
|
|
|
This function will download the latest version of Winget and install it. If Winget is already installed, it will do nothing.
|
2023-03-07 14:28:00 -06:00
|
|
|
#>
|
Sacrifice to the AV Gods test 24-03-28 branch (#1766)
* Remove the Non-existing 'WPFMiscTweaksPower' found in the 'preset.json' File (#1763)
* Compile Winutil
* Update of Test-WinUtilPackageManager and Install-WinUtilWinget (#1757)
* Updated Install-WinUtilWinget and Test-WinUtilPackageManager
- Updated Test-WinUtilPackageManager to better handle the -Winget param and return a more verbose status.
- Moved many of the "is installed"/"is not installed" outputs to the Test-WinUtilPackageManager function.
- Changed Install-WinUtilWinget to use the GitHub install method as the primary method, and on error use the Chocolatey install method.
- Updated various functions to use the Test-WinUtilPackageManager function.
* Update Install-WinUtilWinget.ps1
- Changed handling of Test-WinUtilPackageManager in Install-WinUtilWinget, to prevent Test-WinUtilPackageManager from printing out to terminal twice.
* Compile Winutil
* Update Paint.NET Winget name. (#1758)
Paint.NET's winget package name changed.
* Compile Winutil
* Fixed Programms names and urls and github actions (#1759)
* Compile Winutil
* trying to fix github actions
* Update applications.json
* Compile Winutil
* updated winget package PaintDotNet
* Compile Winutil
* Update functions.Tests.ps1
* fixing typos in unittesting
* fixed the issue that made pester not to work
* Compile Winutil
* found a bug and fixed it
* Compile Winutil
---------
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
* Detect free space of installation drive and compare it with the ISO size and delete temporary MicroWin files from previous runs (#1761)
* Detect free space of installation drive
Compare the size of the ISO file with the free space of the installation drive (or the drive containing the User files) and, if the free size is below a certain threshold, the script will throw either a warning or an error
* Delete temporary files from previous runs
* Add Simple Feature to keep the Service Startup upon Applying Service Tweaks, but not when Undoing it (#1760)
Added a new parameter that gives freedom of control on whether to disable this feature or not, and of course the simple feature in question.
The way it works is by Getting the service using its name, and see if the Startup Value of this service is equal to the default type that Windows comes with it, if not (The User has changed it in the past), then WinUtil won't change it by default (The KeepServiceStartup is true by default), this is a more desirable behaviour when compared to how it previously worked.
These changes were tested by the Author of this commit, Please read the commit patches for exact details on the changes.
* Compile Winutil
* Sacrifice to the AV Gods
Remove Self Elevation and Disable UAC
---------
Co-authored-by: Mr.k <mineshtine28546271@gmail.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: Rux <jonathan.e.rux@ruxunderscore.com>
Co-authored-by: YusufKhalifadev <yusufkhalifadev@gmail.com>
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
2024-03-30 11:46:29 -05:00
|
|
|
$isWingetInstalled = Test-WinUtilPackageManager -winget
|
|
|
|
|
2024-08-06 15:35:17 -05:00
|
|
|
try {
|
Sacrifice to the AV Gods test 24-03-28 branch (#1766)
* Remove the Non-existing 'WPFMiscTweaksPower' found in the 'preset.json' File (#1763)
* Compile Winutil
* Update of Test-WinUtilPackageManager and Install-WinUtilWinget (#1757)
* Updated Install-WinUtilWinget and Test-WinUtilPackageManager
- Updated Test-WinUtilPackageManager to better handle the -Winget param and return a more verbose status.
- Moved many of the "is installed"/"is not installed" outputs to the Test-WinUtilPackageManager function.
- Changed Install-WinUtilWinget to use the GitHub install method as the primary method, and on error use the Chocolatey install method.
- Updated various functions to use the Test-WinUtilPackageManager function.
* Update Install-WinUtilWinget.ps1
- Changed handling of Test-WinUtilPackageManager in Install-WinUtilWinget, to prevent Test-WinUtilPackageManager from printing out to terminal twice.
* Compile Winutil
* Update Paint.NET Winget name. (#1758)
Paint.NET's winget package name changed.
* Compile Winutil
* Fixed Programms names and urls and github actions (#1759)
* Compile Winutil
* trying to fix github actions
* Update applications.json
* Compile Winutil
* updated winget package PaintDotNet
* Compile Winutil
* Update functions.Tests.ps1
* fixing typos in unittesting
* fixed the issue that made pester not to work
* Compile Winutil
* found a bug and fixed it
* Compile Winutil
---------
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
* Detect free space of installation drive and compare it with the ISO size and delete temporary MicroWin files from previous runs (#1761)
* Detect free space of installation drive
Compare the size of the ISO file with the free space of the installation drive (or the drive containing the User files) and, if the free size is below a certain threshold, the script will throw either a warning or an error
* Delete temporary files from previous runs
* Add Simple Feature to keep the Service Startup upon Applying Service Tweaks, but not when Undoing it (#1760)
Added a new parameter that gives freedom of control on whether to disable this feature or not, and of course the simple feature in question.
The way it works is by Getting the service using its name, and see if the Startup Value of this service is equal to the default type that Windows comes with it, if not (The User has changed it in the past), then WinUtil won't change it by default (The KeepServiceStartup is true by default), this is a more desirable behaviour when compared to how it previously worked.
These changes were tested by the Author of this commit, Please read the commit patches for exact details on the changes.
* Compile Winutil
* Sacrifice to the AV Gods
Remove Self Elevation and Disable UAC
---------
Co-authored-by: Mr.k <mineshtine28546271@gmail.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: Rux <jonathan.e.rux@ruxunderscore.com>
Co-authored-by: YusufKhalifadev <yusufkhalifadev@gmail.com>
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
2024-03-30 11:46:29 -05:00
|
|
|
if ($isWingetInstalled -eq "installed") {
|
|
|
|
Write-Host "`nWinget is already installed.`r" -ForegroundColor Green
|
2023-03-07 14:28:00 -06:00
|
|
|
return
|
Sacrifice to the AV Gods test 24-03-28 branch (#1766)
* Remove the Non-existing 'WPFMiscTweaksPower' found in the 'preset.json' File (#1763)
* Compile Winutil
* Update of Test-WinUtilPackageManager and Install-WinUtilWinget (#1757)
* Updated Install-WinUtilWinget and Test-WinUtilPackageManager
- Updated Test-WinUtilPackageManager to better handle the -Winget param and return a more verbose status.
- Moved many of the "is installed"/"is not installed" outputs to the Test-WinUtilPackageManager function.
- Changed Install-WinUtilWinget to use the GitHub install method as the primary method, and on error use the Chocolatey install method.
- Updated various functions to use the Test-WinUtilPackageManager function.
* Update Install-WinUtilWinget.ps1
- Changed handling of Test-WinUtilPackageManager in Install-WinUtilWinget, to prevent Test-WinUtilPackageManager from printing out to terminal twice.
* Compile Winutil
* Update Paint.NET Winget name. (#1758)
Paint.NET's winget package name changed.
* Compile Winutil
* Fixed Programms names and urls and github actions (#1759)
* Compile Winutil
* trying to fix github actions
* Update applications.json
* Compile Winutil
* updated winget package PaintDotNet
* Compile Winutil
* Update functions.Tests.ps1
* fixing typos in unittesting
* fixed the issue that made pester not to work
* Compile Winutil
* found a bug and fixed it
* Compile Winutil
---------
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
* Detect free space of installation drive and compare it with the ISO size and delete temporary MicroWin files from previous runs (#1761)
* Detect free space of installation drive
Compare the size of the ISO file with the free space of the installation drive (or the drive containing the User files) and, if the free size is below a certain threshold, the script will throw either a warning or an error
* Delete temporary files from previous runs
* Add Simple Feature to keep the Service Startup upon Applying Service Tweaks, but not when Undoing it (#1760)
Added a new parameter that gives freedom of control on whether to disable this feature or not, and of course the simple feature in question.
The way it works is by Getting the service using its name, and see if the Startup Value of this service is equal to the default type that Windows comes with it, if not (The User has changed it in the past), then WinUtil won't change it by default (The KeepServiceStartup is true by default), this is a more desirable behaviour when compared to how it previously worked.
These changes were tested by the Author of this commit, Please read the commit patches for exact details on the changes.
* Compile Winutil
* Sacrifice to the AV Gods
Remove Self Elevation and Disable UAC
---------
Co-authored-by: Mr.k <mineshtine28546271@gmail.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: Rux <jonathan.e.rux@ruxunderscore.com>
Co-authored-by: YusufKhalifadev <yusufkhalifadev@gmail.com>
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
2024-03-30 11:46:29 -05:00
|
|
|
} elseif ($isWingetInstalled -eq "outdated") {
|
|
|
|
Write-Host "`nWinget is Outdated. Continuing with install.`r" -ForegroundColor Yellow
|
|
|
|
} else {
|
|
|
|
Write-Host "`nWinget is not Installed. Continuing with install.`r" -ForegroundColor Red
|
2023-03-07 14:28:00 -06:00
|
|
|
}
|
|
|
|
|
2024-07-25 16:19:45 -05:00
|
|
|
|
2023-10-19 17:12:55 -05:00
|
|
|
# Gets the computer's information
|
2024-08-06 15:35:17 -05:00
|
|
|
if ($null -eq $sync.ComputerInfo) {
|
2023-03-07 14:28:00 -06:00
|
|
|
$ComputerInfo = Get-ComputerInfo -ErrorAction Stop
|
Sacrifice to the AV Gods test 24-03-28 branch (#1766)
* Remove the Non-existing 'WPFMiscTweaksPower' found in the 'preset.json' File (#1763)
* Compile Winutil
* Update of Test-WinUtilPackageManager and Install-WinUtilWinget (#1757)
* Updated Install-WinUtilWinget and Test-WinUtilPackageManager
- Updated Test-WinUtilPackageManager to better handle the -Winget param and return a more verbose status.
- Moved many of the "is installed"/"is not installed" outputs to the Test-WinUtilPackageManager function.
- Changed Install-WinUtilWinget to use the GitHub install method as the primary method, and on error use the Chocolatey install method.
- Updated various functions to use the Test-WinUtilPackageManager function.
* Update Install-WinUtilWinget.ps1
- Changed handling of Test-WinUtilPackageManager in Install-WinUtilWinget, to prevent Test-WinUtilPackageManager from printing out to terminal twice.
* Compile Winutil
* Update Paint.NET Winget name. (#1758)
Paint.NET's winget package name changed.
* Compile Winutil
* Fixed Programms names and urls and github actions (#1759)
* Compile Winutil
* trying to fix github actions
* Update applications.json
* Compile Winutil
* updated winget package PaintDotNet
* Compile Winutil
* Update functions.Tests.ps1
* fixing typos in unittesting
* fixed the issue that made pester not to work
* Compile Winutil
* found a bug and fixed it
* Compile Winutil
---------
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
* Detect free space of installation drive and compare it with the ISO size and delete temporary MicroWin files from previous runs (#1761)
* Detect free space of installation drive
Compare the size of the ISO file with the free space of the installation drive (or the drive containing the User files) and, if the free size is below a certain threshold, the script will throw either a warning or an error
* Delete temporary files from previous runs
* Add Simple Feature to keep the Service Startup upon Applying Service Tweaks, but not when Undoing it (#1760)
Added a new parameter that gives freedom of control on whether to disable this feature or not, and of course the simple feature in question.
The way it works is by Getting the service using its name, and see if the Startup Value of this service is equal to the default type that Windows comes with it, if not (The User has changed it in the past), then WinUtil won't change it by default (The KeepServiceStartup is true by default), this is a more desirable behaviour when compared to how it previously worked.
These changes were tested by the Author of this commit, Please read the commit patches for exact details on the changes.
* Compile Winutil
* Sacrifice to the AV Gods
Remove Self Elevation and Disable UAC
---------
Co-authored-by: Mr.k <mineshtine28546271@gmail.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: Rux <jonathan.e.rux@ruxunderscore.com>
Co-authored-by: YusufKhalifadev <yusufkhalifadev@gmail.com>
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
2024-03-30 11:46:29 -05:00
|
|
|
} else {
|
2023-03-07 14:28:00 -06:00
|
|
|
$ComputerInfo = $sync.ComputerInfo
|
|
|
|
}
|
|
|
|
|
|
|
|
if (($ComputerInfo.WindowsVersion) -lt "1809") {
|
2024-03-28 14:39:23 -05:00
|
|
|
# Checks if Windows Version is too old for Winget
|
Sacrifice to the AV Gods test 24-03-28 branch (#1766)
* Remove the Non-existing 'WPFMiscTweaksPower' found in the 'preset.json' File (#1763)
* Compile Winutil
* Update of Test-WinUtilPackageManager and Install-WinUtilWinget (#1757)
* Updated Install-WinUtilWinget and Test-WinUtilPackageManager
- Updated Test-WinUtilPackageManager to better handle the -Winget param and return a more verbose status.
- Moved many of the "is installed"/"is not installed" outputs to the Test-WinUtilPackageManager function.
- Changed Install-WinUtilWinget to use the GitHub install method as the primary method, and on error use the Chocolatey install method.
- Updated various functions to use the Test-WinUtilPackageManager function.
* Update Install-WinUtilWinget.ps1
- Changed handling of Test-WinUtilPackageManager in Install-WinUtilWinget, to prevent Test-WinUtilPackageManager from printing out to terminal twice.
* Compile Winutil
* Update Paint.NET Winget name. (#1758)
Paint.NET's winget package name changed.
* Compile Winutil
* Fixed Programms names and urls and github actions (#1759)
* Compile Winutil
* trying to fix github actions
* Update applications.json
* Compile Winutil
* updated winget package PaintDotNet
* Compile Winutil
* Update functions.Tests.ps1
* fixing typos in unittesting
* fixed the issue that made pester not to work
* Compile Winutil
* found a bug and fixed it
* Compile Winutil
---------
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
* Detect free space of installation drive and compare it with the ISO size and delete temporary MicroWin files from previous runs (#1761)
* Detect free space of installation drive
Compare the size of the ISO file with the free space of the installation drive (or the drive containing the User files) and, if the free size is below a certain threshold, the script will throw either a warning or an error
* Delete temporary files from previous runs
* Add Simple Feature to keep the Service Startup upon Applying Service Tweaks, but not when Undoing it (#1760)
Added a new parameter that gives freedom of control on whether to disable this feature or not, and of course the simple feature in question.
The way it works is by Getting the service using its name, and see if the Startup Value of this service is equal to the default type that Windows comes with it, if not (The User has changed it in the past), then WinUtil won't change it by default (The KeepServiceStartup is true by default), this is a more desirable behaviour when compared to how it previously worked.
These changes were tested by the Author of this commit, Please read the commit patches for exact details on the changes.
* Compile Winutil
* Sacrifice to the AV Gods
Remove Self Elevation and Disable UAC
---------
Co-authored-by: Mr.k <mineshtine28546271@gmail.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: Rux <jonathan.e.rux@ruxunderscore.com>
Co-authored-by: YusufKhalifadev <yusufkhalifadev@gmail.com>
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
2024-03-30 11:46:29 -05:00
|
|
|
Write-Host "Winget is not supported on this version of Windows (Pre-1809)" -ForegroundColor Red
|
2023-03-07 14:28:00 -06:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-12-10 00:25:11 -06:00
|
|
|
Write-Host "Attempting to install/update Winget`r"
|
|
|
|
try {
|
|
|
|
$wingetCmd = Get-Command winget -ErrorAction Stop
|
|
|
|
Write-Information "Attempting to update WinGet using WinGet..."
|
|
|
|
$result = Start-Process -FilePath "`"$($wingetCmd.Source)`"" -ArgumentList "install -e --accept-source-agreements --accept-package-agreements Microsoft.AppInstaller" -Wait -NoNewWindow -PassThru
|
|
|
|
if ($result.ExitCode -ne 0) {
|
|
|
|
throw "WinGet update failed with exit code: $($result.ExitCode)"
|
|
|
|
}
|
|
|
|
Write-Output "Refreshing Environment Variables...`n"
|
|
|
|
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
|
|
|
return
|
|
|
|
} catch {
|
|
|
|
Write-Information "WinGet not found or update failed. Attempting to install from Microsoft Store..."
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
# Try to close any running WinGet processes
|
|
|
|
Get-Process -Name "DesktopAppInstaller", "winget" -ErrorAction SilentlyContinue | ForEach-Object {
|
|
|
|
Write-Information "Stopping running WinGet process..."
|
|
|
|
$_.Kill()
|
|
|
|
Start-Sleep -Seconds 2
|
|
|
|
}
|
|
|
|
|
|
|
|
# Try to load Windows Runtime assemblies more reliably
|
|
|
|
$null = [System.Runtime.WindowsRuntime.WindowsRuntimeSystemExtensions]
|
|
|
|
Add-Type -AssemblyName System.Runtime.WindowsRuntime
|
|
|
|
|
|
|
|
# Load required assemblies from Windows SDK
|
|
|
|
$null = @(
|
|
|
|
[Windows.Management.Deployment.PackageManager, Windows.Management.Deployment, ContentType = WindowsRuntime]
|
|
|
|
[Windows.Foundation.Uri, Windows.Foundation, ContentType = WindowsRuntime]
|
|
|
|
[Windows.Management.Deployment.DeploymentOptions, Windows.Management.Deployment, ContentType = WindowsRuntime]
|
|
|
|
)
|
|
|
|
|
|
|
|
# Initialize PackageManager
|
|
|
|
$packageManager = New-Object Windows.Management.Deployment.PackageManager
|
|
|
|
|
|
|
|
# Rest of the Microsoft Store installation logic
|
|
|
|
$appxPackage = "https://aka.ms/getwinget"
|
|
|
|
$uri = New-Object Windows.Foundation.Uri($appxPackage)
|
|
|
|
$deploymentOperation = $packageManager.AddPackageAsync($uri, $null, "Add")
|
|
|
|
|
|
|
|
# Add timeout check for deployment operation
|
|
|
|
$timeout = 300
|
|
|
|
$timer = [System.Diagnostics.Stopwatch]::StartNew()
|
|
|
|
|
|
|
|
while ($deploymentOperation.Status -eq 0) {
|
|
|
|
if ($timer.Elapsed.TotalSeconds -gt $timeout) {
|
|
|
|
throw "Installation timed out after $timeout seconds"
|
|
|
|
}
|
|
|
|
Start-Sleep -Milliseconds 100
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($deploymentOperation.Status -eq 1) {
|
|
|
|
Write-Information "Successfully installed WinGet from Microsoft Store"
|
|
|
|
Write-Output "Refreshing Environment Variables...`n"
|
|
|
|
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
|
|
|
return
|
|
|
|
} else {
|
|
|
|
throw "Installation failed with status: $($deploymentOperation.Status)"
|
|
|
|
}
|
|
|
|
} catch {
|
|
|
|
Write-Information "Microsoft Store installation failed. Attempting to install from Nuget..."
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
## Nuget Method
|
|
|
|
Write-Host "Enabling NuGet and Module..."
|
|
|
|
# Enable TLS 1.2 for the PowerShell session
|
|
|
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
|
|
|
|
|
|
|
# Try to register the NuGet package source if not present
|
|
|
|
if (-not (Get-PackageSource -Name "NuGet" -ErrorAction SilentlyContinue)) {
|
|
|
|
Register-PackageSource -Name "NuGet" -Location "https://www.nuget.org/api/v2" -ProviderName NuGet -Force
|
|
|
|
}
|
|
|
|
|
|
|
|
# Install NuGet provider with error handling
|
|
|
|
try {
|
|
|
|
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Confirm:$false -ErrorAction Stop
|
|
|
|
} catch {
|
|
|
|
Write-Warning "Failed to install NuGet provider through standard method. Trying alternative approach..."
|
|
|
|
Install-PackageProvider -Name NuGet -Source "https://www.powershellgallery.com/api/v2" -Force -Confirm:$false
|
|
|
|
}
|
|
|
|
Install-Module -Name Microsoft.WinGet.Client -Confirm:$false -Force
|
|
|
|
|
|
|
|
# Check if WinGet was installed successfully through NuGet
|
|
|
|
$wingetCmd = Get-Command winget -ErrorAction Stop
|
|
|
|
Write-Information "Successfully installed WinGet through NuGet"
|
|
|
|
Write-Output "Refreshing Environment Variables...`n"
|
|
|
|
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
|
|
|
return
|
|
|
|
} catch {
|
|
|
|
Write-Warning "NuGet installation failed. Attempting to install from GitHub..."
|
|
|
|
}
|
|
|
|
# GitHub fallback installation method
|
|
|
|
$releases_url = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
|
|
|
|
$asset = (Invoke-RestMethod -Uri $releases_url).assets |
|
|
|
|
Where-Object { $_.name -match "\.msixbundle$" } |
|
|
|
|
Select-Object -First 1
|
|
|
|
|
|
|
|
$download_url = $asset.browser_download_url
|
|
|
|
$output_path = Join-Path $env:TEMP $asset.name
|
|
|
|
|
|
|
|
Invoke-WebRequest -Uri $download_url -OutFile $output_path
|
|
|
|
Add-AppxPackage -Path $output_path -ErrorAction Stop
|
|
|
|
|
|
|
|
# Verify installation
|
|
|
|
$wingetCmd = Get-Command winget -ErrorAction Stop
|
|
|
|
Write-Information "Successfully installed WinGet through GitHub"
|
Sacrifice to the AV Gods test 24-03-28 branch (#1766)
* Remove the Non-existing 'WPFMiscTweaksPower' found in the 'preset.json' File (#1763)
* Compile Winutil
* Update of Test-WinUtilPackageManager and Install-WinUtilWinget (#1757)
* Updated Install-WinUtilWinget and Test-WinUtilPackageManager
- Updated Test-WinUtilPackageManager to better handle the -Winget param and return a more verbose status.
- Moved many of the "is installed"/"is not installed" outputs to the Test-WinUtilPackageManager function.
- Changed Install-WinUtilWinget to use the GitHub install method as the primary method, and on error use the Chocolatey install method.
- Updated various functions to use the Test-WinUtilPackageManager function.
* Update Install-WinUtilWinget.ps1
- Changed handling of Test-WinUtilPackageManager in Install-WinUtilWinget, to prevent Test-WinUtilPackageManager from printing out to terminal twice.
* Compile Winutil
* Update Paint.NET Winget name. (#1758)
Paint.NET's winget package name changed.
* Compile Winutil
* Fixed Programms names and urls and github actions (#1759)
* Compile Winutil
* trying to fix github actions
* Update applications.json
* Compile Winutil
* updated winget package PaintDotNet
* Compile Winutil
* Update functions.Tests.ps1
* fixing typos in unittesting
* fixed the issue that made pester not to work
* Compile Winutil
* found a bug and fixed it
* Compile Winutil
---------
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
* Detect free space of installation drive and compare it with the ISO size and delete temporary MicroWin files from previous runs (#1761)
* Detect free space of installation drive
Compare the size of the ISO file with the free space of the installation drive (or the drive containing the User files) and, if the free size is below a certain threshold, the script will throw either a warning or an error
* Delete temporary files from previous runs
* Add Simple Feature to keep the Service Startup upon Applying Service Tweaks, but not when Undoing it (#1760)
Added a new parameter that gives freedom of control on whether to disable this feature or not, and of course the simple feature in question.
The way it works is by Getting the service using its name, and see if the Startup Value of this service is equal to the default type that Windows comes with it, if not (The User has changed it in the past), then WinUtil won't change it by default (The KeepServiceStartup is true by default), this is a more desirable behaviour when compared to how it previously worked.
These changes were tested by the Author of this commit, Please read the commit patches for exact details on the changes.
* Compile Winutil
* Sacrifice to the AV Gods
Remove Self Elevation and Disable UAC
---------
Co-authored-by: Mr.k <mineshtine28546271@gmail.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: Rux <jonathan.e.rux@ruxunderscore.com>
Co-authored-by: YusufKhalifadev <yusufkhalifadev@gmail.com>
Co-authored-by: YusufKhalifadev <YusufKhalifadev@users.noreply.github.com>
Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
2024-03-30 11:46:29 -05:00
|
|
|
Write-Output "Refreshing Environment Variables...`n"
|
|
|
|
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
2024-12-10 00:25:11 -06:00
|
|
|
return
|
2024-08-06 15:35:17 -05:00
|
|
|
} catch {
|
2024-12-10 00:25:11 -06:00
|
|
|
Write-Error "All installation methods failed. Unable to install WinGet."
|
|
|
|
throw
|
2023-03-07 14:28:00 -06:00
|
|
|
}
|
2024-03-28 14:39:23 -05:00
|
|
|
}
|