Skip to content

Commit

Permalink
Sacrifice to the AV Gods test 24-03-28 branch (ChrisTitusTech#1766)
Browse files Browse the repository at this point in the history
* Remove the Non-existing 'WPFMiscTweaksPower' found in the 'preset.json' File (ChrisTitusTech#1763)

* Compile Winutil

* Update of Test-WinUtilPackageManager and Install-WinUtilWinget (ChrisTitusTech#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. (ChrisTitusTech#1758)

Paint.NET's winget package name changed.

* Compile Winutil

* Fixed Programms names and urls and github actions (ChrisTitusTech#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 (ChrisTitusTech#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 (ChrisTitusTech#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>
  • Loading branch information
7 people authored Mar 30, 2024
1 parent c3b12e8 commit 4a7c8a3
Show file tree
Hide file tree
Showing 19 changed files with 452 additions and 332 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install Pester
run: |
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
Install-Module -Name Pester -Force -AllowClobber
Install-Module -Name Pester -Force -SkipPublisherCheck -AllowClobber
shell: pwsh

- name: Run Pester tests
Expand Down
44 changes: 22 additions & 22 deletions config/applications.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"choco": "alacritty",
"content": "Alacritty Terminal",
"description": "Alacritty is a fast, cross-platform, and GPU-accelerated terminal emulator. It is designed for performance and aims to be the fastest terminal emulator available.",
"link": "https://github.com/alacritty/alacritty",
"link": "https://alacritty.org/",
"winget": "Alacritty.Alacritty"
},
"WPFInstallanaconda3": {
Expand Down Expand Up @@ -196,7 +196,7 @@
"choco": "carnac",
"content": "Carnac",
"description": "Carnac is a keystroke visualizer for Windows. It displays keystrokes in an overlay, making it useful for presentations, tutorials, and live demonstrations.",
"link": "https://github.com/Code52/carnac",
"link": "https://carnackeys.com/",
"winget": "code52.Carnac"
},
"WPFInstallcemu": {
Expand Down Expand Up @@ -256,7 +256,7 @@
"winget": "CloneHeroTeam.CloneHero"
},
"WPFInstallcopyq": {
"category": "Multimedia Tools",
"category": "Utilities",
"choco": "copyq",
"content": "CopyQ (Clipboard Manager)",
"description": "CopyQ is a clipboard manager with advanced features, allowing you to store, edit, and retrieve clipboard history.",
Expand Down Expand Up @@ -402,7 +402,7 @@
"WPFInstallduplicati": {
"category": "Utilities",
"choco": "duplicati",
"content": "Duplicati 2",
"content": "Duplicati",
"description": "Duplicati is an open-source backup solution that supports encrypted, compressed, and incremental backups. It is designed to securely store data on cloud storage services.",
"link": "https://www.duplicati.com/",
"winget": "Duplicati.Duplicati"
Expand Down Expand Up @@ -514,9 +514,9 @@
"WPFInstallfileconverter": {
"category": "Utilities",
"choco": "files",
"content": "File Converter",
"content": "File-Converter",
"description": "File Converter is a very simple tool which allows you to convert and compress one or several file(s) using the context menu in windows explorer.",
"link": "https://file-converter.org/",
"link": "https://file-converter.io/",
"winget": "AdrienAllard.FileConverter"
},
"WPFInstallfirealpaca": {
Expand All @@ -540,7 +540,7 @@
"choco": "FirefoxESR",
"content": "Firefox ESR",
"description": "Mozilla Firefox is an open-source web browser known for its customization options, privacy features, and extensions. Firefox ESR (Extended Support Release) receives major updates every 42 weeks with minor updates such as crash fixes, security fixes and policy updates as needed, but at least every four weeks.",
"link": "https://www.mozilla.org/en-US/firefox/new/",
"link": "https://www.mozilla.org/en-US/firefox/enterprise/",
"winget": "Mozilla.Firefox.ESR"
},
"WPFInstallflameshot": {
Expand Down Expand Up @@ -570,7 +570,7 @@
"WPFInstallflux": {
"category": "Utilities",
"choco": "flux",
"content": "f.lux",
"content": "F.lux",
"description": "f.lux adjusts the color temperature of your screen to reduce eye strain during nighttime use.",
"link": "https://justgetflux.com/",
"winget": "flux.flux"
Expand Down Expand Up @@ -716,7 +716,7 @@
"choco": "gsudo",
"content": "Gsudo",
"description": "Gsudo is a sudo implementation for Windows, allowing elevated privilege execution.",
"link": "https://github.com/gerardog/gsudo",
"link": "https://gerardog.github.io/gsudo/",
"winget": "gerardog.gsudo"
},
"WPFInstallguilded": {
Expand Down Expand Up @@ -876,7 +876,7 @@
"choco": "jellyfin-media-player",
"content": "Jellyfin Media Player",
"description": "Jellyfin Media Player is a client application for the Jellyfin media server, providing access to your media library.",
"link": "https://jellyfin.org/",
"link": "https://github.com/jellyfin/jellyfin-media-playerf",
"winget": "Jellyfin.JellyfinMediaPlayer"
},
"WPFInstalljellyfinserver": {
Expand Down Expand Up @@ -1060,7 +1060,7 @@
"choco": "motrix",
"content": "Motrix Download Manager",
"description": "A full-featured download manager.",
"link": "https://github.com/agalwood/Motrix",
"link": "https://motrix.app/",
"winget": "agalwood.Motrix"
},
"WPFInstallmpc": {
Expand Down Expand Up @@ -1180,7 +1180,7 @@
"choco": "nomacs",
"content": "Nomacs (Image viewer)",
"description": "Nomacs is a free, open-source image viewer that supports multiple platforms. It features basic image editing capabilities and supports a variety of image formats.",
"link": "https://github.com/nomacs/nomacs",
"link": "https://nomacs.org/",
"winget": "nomacs.nomacs"
},
"WPFInstallnotepadplus": {
Expand Down Expand Up @@ -1341,7 +1341,7 @@
"content": "Paint.NET",
"description": "Paint.NET is a free image and photo editing software for Windows. It features an intuitive user interface and supports a wide range of powerful editing tools.",
"link": "https://www.getpaint.net/",
"winget": "dotPDNLLC.paintdotnet"
"winget": "dotPDN.PaintDotNet"
},
"WPFInstallparsec": {
"category": "Utilities",
Expand Down Expand Up @@ -1404,7 +1404,7 @@
"choco": "portmaster",
"content": "Portmaster",
"description": "Portmaster is a free and open-source application that puts you back in charge over all your computers network connections.",
"link": "https://github.com/safing/portmaster",
"link": "https://safing.io/",
"winget": "Safing.Portmaster"
},
"WPFInstallposh": {
Expand Down Expand Up @@ -1634,7 +1634,7 @@
"WPFInstallsimplewall": {
"category": "Pro Tools",
"choco": "simplewall",
"content": "simplewall",
"content": "Simplewall",
"description": "simplewall is a free and open-source firewall application for Windows. It allows users to control and manage the inbound and outbound network traffic of applications.",
"link": "https://github.com/henrypp/simplewall",
"winget": "Henry++.simplewall"
Expand Down Expand Up @@ -1692,7 +1692,7 @@
"choco": "strawberrymusicplayer",
"content": "Strawberry (Music Player)",
"description": "Strawberry is an open-source music player that focuses on music collection management and audio quality. It supports various audio formats and features a clean user interface.",
"link": "https://github.com/strawberrymusicplayer/strawberry/",
"link": "https://www.strawberrymusicplayer.org/",
"winget": "StrawberryMusicPlayer.Strawberry"
},
"WPFInstallstremio": {
Expand Down Expand Up @@ -1964,7 +1964,7 @@
"choco": "na",
"content": "Videomass",
"description": "Videomass by GianlucaPernigotto is a cross-platform GUI for FFmpeg, streamlining multimedia file processing with batch conversions and user-friendly features.",
"link": "https://github.com/jeanslack/Videomass",
"link": "https://jeanslack.github.io/Videomass/",
"winget": "GianlucaPernigotto.Videomass"
},
"WPFInstallvisualstudio": {
Expand Down Expand Up @@ -2068,7 +2068,7 @@
"choco": "wingetui",
"content": "WingetUI",
"description": "WingetUI is a graphical user interface for Microsoft's Windows Package Manager (winget).",
"link": "https://github.com/marticliment/WingetUI",
"link": "https://www.marticliment.com/wingetui/",
"winget": "SomePythonThings.WingetUIStore"
},
"WPFInstallwinmerge": {
Expand Down Expand Up @@ -2140,11 +2140,11 @@
"choco": "xdm",
"content": "Xtreme Download Manager",
"description": "Xtreme Download Manager is an advanced download manager with support for various protocols and browsers.*Browser integration deprecated by google store. No official release.*",
"link": "https://github.com/subhra74/xdm",
"link": "https://xtremedownloadmanager.com/",
"winget": "subhra74.XtremeDownloadManager"
},
"WPFInstallxeheditor": {
"category": "Development",
"category": "Utilities",
"choco": "HxD",
"content": "HxD Hex Editor",
"description": "HxD is a free hex editor that allows you to edit, view, search, and analyze binary files.",
Expand Down Expand Up @@ -2250,7 +2250,7 @@
"WPFInstallsyncthingtray": {
"category": "Utilities",
"choco": "syncthingtray",
"content": "syncthingtray",
"content": "Syncthingtray",
"description": "Might be the alternative for Synctrayzor. Windows tray utility / filesystem watcher / launcher for Syncthing",
"link": "https://github.com/Martchus/syncthingtray",
"winget": "Martchus.syncthingtray"
Expand All @@ -2274,7 +2274,7 @@
"WPFInstallintelpresentmon": {
"category": "Utilities",
"choco": "na",
"content": "Intel® PresentMon",
"content": "Intel-PresentMon",
"description": "A new gaming performance overlay and telemetry application to monitor and measure your gaming experience.",
"link": "https://game.intel.com/us/stories/intel-presentmon/",
"winget": "Intel.PresentMon.Beta"
Expand Down
3 changes: 1 addition & 2 deletions config/preset.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"WPFTweaksServices",
"WPFTweaksStorage",
"WPFTweaksTele",
"WPFTweaksWifi",
"WPFMiscTweaksPower"
"WPFTweaksWifi"
],
"laptop": [
"WPFTweaksAH",
Expand Down
16 changes: 0 additions & 16 deletions config/tweaks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2420,22 +2420,6 @@
"
]
},
"WPFTweaksDisableUAC": {
"Content": "Disable UAC",
"Description": "Disables User Account Control. Only recommended for Expert Users.",
"category": "z__Advanced Tweaks - CAUTION",
"panel": "1",
"Order": "a023_",
"registry": [
{
"Path": "HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System",
"OriginalValue": "5",
"Name": "ConsentPromptBehaviorAdmin",
"Value": "0",
"Type": "DWord"
}
]
},
"WPFTweaksDeleteTempFiles": {
"Content": "Delete Temporary Files",
"Description": "Erases TEMP Folders",
Expand Down
11 changes: 5 additions & 6 deletions functions/private/Install-WinUtilChoco.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ function Install-WinUtilChoco {
try {
Write-Host "Checking if Chocolatey is Installed..."

if((Get-Command -Name choco -ErrorAction Ignore)) {
Write-Host "Chocolatey Already Installed"
if((Test-WinUtilPackageManager -choco) -eq "installed") {
return
}

Write-Host "Seems Chocolatey is not installed, installing now"
Write-Host "Seems Chocolatey is not installed, installing now."
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop
powershell choco feature enable -n allowGlobalConfirmation

}
Catch {
Write-Host "==========================================="
Write-Host "-- Chocolatey failed to install ---"
Write-Host "==========================================="
Write-Host "===========================================" -Foregroundcolor Red
Write-Host "-- Chocolatey failed to install ---" -Foregroundcolor Red
Write-Host "===========================================" -Foregroundcolor Red
}

}
65 changes: 33 additions & 32 deletions functions/private/Install-WinUtilWinget.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,53 @@ function Install-WinUtilWinget {
.DESCRIPTION
This function will download the latest version of Winget and install it. If Winget is already installed, it will do nothing.
#>
Try{
Write-Host "Checking if Winget is Installed..."
if (Test-WinUtilPackageManager -Winget) {
# Checks if Winget executable exists and if the Windows Version is 1809 or higher
Write-Host "Winget Already Installed"
$isWingetInstalled = Test-WinUtilPackageManager -winget

Try {
if ($isWingetInstalled -eq "installed") {
Write-Host "`nWinget is already installed.`r" -ForegroundColor Green
return
} 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
}

# Gets the computer's information
if ($null -eq $sync.ComputerInfo){
$ComputerInfo = Get-ComputerInfo -ErrorAction Stop
}
Else {
} else {
$ComputerInfo = $sync.ComputerInfo
}

if (($ComputerInfo.WindowsVersion) -lt "1809") {
# 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)" -ForegroundColor Red
return
}

if((Get-Command -Name choco -ErrorAction Ignore)) {
# 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"
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")
# Install Winget via GitHub method.
# Used part of my own script with some modification: ruxunderscore/windows-initialization
Write-Host "Downloading Winget Prerequsites`n"
Get-WinUtilWingetPrerequisites
Write-Host "Downloading Winget and License File`r"
Get-WinUtilWingetLatest
Write-Host "Installing Winget w/ Prerequsites`r"
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" -ForegroundColor Green
# 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 {
Write-Host "Failure detected while installing via GitHub method. Continuing with Chocolatey method as fallback." -ForegroundColor Red
# In case install fails via GitHub method.
Try {
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget-cli"
Write-Host "Winget Installed" -ForegroundColor Green
Write-Output "Refreshing Environment Variables...`n"
$ENV:PATH = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
} Catch {
throw [WingetFailedInstall]::new('Failed to install!')
}
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{
throw [WingetFailedInstall]::new('Failed to install')
}
}
2 changes: 1 addition & 1 deletion functions/private/Invoke-WinUtilGPU.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Invoke-GPUCheck {
function Invoke-WinUtilGPU {
$gpuInfo = Get-CimInstance Win32_VideoController

foreach ($gpu in $gpuInfo) {
Expand Down
File renamed without changes.
Loading

0 comments on commit 4a7c8a3

Please sign in to comment.