diff --git a/config/applications.json b/config/applications.json index 2d278bcd..e3a720c8 100644 --- a/config/applications.json +++ b/config/applications.json @@ -99,6 +99,10 @@ "winget": "GOG.Galaxy", "choco": "goggalaxy" }, + "WPFInstallheroiclauncher": { + "winget": "HeroicGamesLauncher.HeroicGamesLauncher", + "choco": "na" + }, "WPFInstallgpuz": { "winget": "TechPowerUp.GPU-Z", "choco": "gpu-z" @@ -155,6 +159,10 @@ "winget": "EclipseAdoptium.Temurin.11.JRE", "choco": "javaruntime" }, + "WPFInstalljava20": { + "winget": "Azul.Zulu.20.JDK", + "choco": "na" + }, "WPFInstalljetbrains": { "winget": "JetBrains.Toolbox", "choco": "jetbrainstoolbox" @@ -175,6 +183,10 @@ "winget": "Element.Element", "choco": "element-desktop" }, + "WPFInstallmonitorian": { + "winget": "emoacht.Monitorian", + "choco": "monitorian" + }, "WPFInstallmpc": { "winget": "clsid2.mpc-hc", "choco": "mpc-hc" @@ -327,6 +339,10 @@ "winget": "Nilesoft.Shell", "choco": "na" }, + "WPFInstallsdio": { + "winget": "GlennDelahoy.SnappyDriverInstallerOrigin", + "choco": "na" + }, "WPFInstallklite": { "winget": "CodecGuide.K-LiteCodecPack.Standard", "choco": "k-litecodecpack-standard" @@ -527,6 +543,10 @@ "winget": "RARLab.WinRAR", "choco": "winrar" }, + "WPFInstallnano": { + "winget": "GNU.Nano", + "choco": "nano" + }, "WPFInstallneovim": { "winget": "Neovim.Neovim", "choco": "neovim" diff --git a/config/preset.json b/config/preset.json index c545d2ec..cc3ea429 100644 --- a/config/preset.json +++ b/config/preset.json @@ -6,7 +6,6 @@ "WPFEssTweaksHome", "WPFEssTweaksLoc", "WPFEssTweaksOO", - "WPFEssTweaksRP", "WPFEssTweaksServices", "WPFEssTweaksStorage", "WPFEssTweaksTele", @@ -20,7 +19,6 @@ "WPFEssTweaksHome", "WPFEssTweaksLoc", "WPFEssTweaksOO", - "WPFEssTweaksRP", "WPFEssTweaksServices", "WPFEssTweaksStorage", "WPFEssTweaksTele", @@ -31,7 +29,6 @@ "minimal": [ "WPFEssTweaksHome", "WPFEssTweaksOO", - "WPFEssTweaksRP", "WPFEssTweaksServices", "WPFEssTweaksTele" ] diff --git a/config/tweaks.json b/config/tweaks.json index 3a4b9997..ab9dd6ee 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -460,8 +460,8 @@ }, { "Name": "KeyIso", - "StartupType": "Manual", - "OriginalType": "Manual" + "StartupType": "Automatic", + "OriginalType": "Automatic" }, { "Name": "KtmRm", @@ -1000,8 +1000,8 @@ }, { "Name": "VaultSvc", - "StartupType": "Manual", - "OriginalType": "Manual" + "StartupType": "Automatic", + "OriginalType": "Automatic" }, { "Name": "W32Time", @@ -2134,16 +2134,10 @@ "InvokeScript": [ "curl.exe -s \"https://raw.githubusercontent.com/ChrisTitusTech/winutil/main/ooshutup10_winutil_settings.cfg\" -o $ENV:temp\\ooshutup10.cfg curl.exe -s \"https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe\" -o $ENV:temp\\OOSU10.exe - Start-Process $ENV:temp\\OOSU10.exe -ArgumentList \"$ENV:temp\\ooshutup10.cfg /quiet\" + Start-Process $ENV:temp\\OOSU10.exe -ArgumentList \"\"\"$ENV:temp\\ooshutup10.cfg\"\" /quiet\" " ] }, - "WPFEssTweaksRP": { - "InvokeScript": [ - "Enable-ComputerRestore -Drive \"$env:SystemDrive\" - Checkpoint-Computer -Description \"RestorePoint1\" -RestorePointType \"MODIFY_SETTINGS\"" - ] - }, "WPFEssTweaksStorage": { "InvokeScript": [ "Remove-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StorageSense\\Parameters\\StoragePolicy\" -Recurse -ErrorAction SilentlyContinue" diff --git a/functions/private/Set-WinUtilRestorePoint.ps1 b/functions/private/Set-WinUtilRestorePoint.ps1 new file mode 100644 index 00000000..033132dc --- /dev/null +++ b/functions/private/Set-WinUtilRestorePoint.ps1 @@ -0,0 +1,32 @@ +function Set-WinUtilRestorePoint { + <# + + .DESCRIPTION + This function will make a Restore Point + + #> + + # Check if the user has administrative privileges + if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Host "Please run this script as an administrator." + return + } + + # Check if System Restore is enabled for the main drive + try { + # Try getting restore points to check if System Restore is enabled + Enable-ComputerRestore -Drive "$env:SystemDrive" + } catch { + Write-Host "An error occurred while enabling System Restore: $_" + } + + # Get all the restore points for the current day + $existingRestorePoints = Get-ComputerRestorePoint | Where-Object { $_.CreationTime.Date -eq (Get-Date).Date } + + # Check if there is already a restore point created today + if ($existingRestorePoints.Count -eq 0) { + $description = "System Restore Point created by WinUtil" + + Checkpoint-Computer -Description $description -RestorePointType "MODIFY_SETTINGS" + } +} diff --git a/functions/private/Set-WinUtilService.ps1 b/functions/private/Set-WinUtilService.ps1 index d68d1ca3..ee03944b 100644 --- a/functions/private/Set-WinUtilService.ps1 +++ b/functions/private/Set-WinUtilService.ps1 @@ -21,15 +21,6 @@ Function Set-WinUtilService { # Service exists, proceed with changing properties $service | Set-Service -StartupType $StartupType -ErrorAction Stop - - if ($StartupType -eq "Disabled") { - Write-Host "Stopping $Name" - Stop-Service -Name $Name -Force -ErrorAction Stop - } - elseif ($StartupType -eq "Manual") { - Write-Host "Stopping $Name" - Stop-Service -Name $Name -Force -ErrorAction Stop - } } catch [System.ServiceProcess.ServiceNotFoundException] { Write-Warning "Service $Name was not found" diff --git a/functions/public/Invoke-WPFtweaksbutton.ps1 b/functions/public/Invoke-WPFtweaksbutton.ps1 index ef3031cd..07a0a89c 100644 --- a/functions/public/Invoke-WPFtweaksbutton.ps1 +++ b/functions/public/Invoke-WPFtweaksbutton.ps1 @@ -22,6 +22,8 @@ function Invoke-WPFtweaksbutton { return } + Set-WinUtilRestorePoint + Invoke-WPFRunspace -ArgumentList $Tweaks -ScriptBlock { param($Tweaks) diff --git a/winutil.ps1 b/winutil.ps1 index c32545bf..9a47ab20 100644 --- a/winutil.ps1 +++ b/winutil.ps1 @@ -10,7 +10,7 @@ Author : Chris Titus @christitustech Runspace Author: @DeveloperDurp GitHub : https://github.com/ChrisTitusTech - Version : 23.08.03 + Version : 23.08.08 #> Start-Transcript $ENV:TEMP\Winutil.log -Append @@ -21,7 +21,7 @@ Add-Type -AssemblyName System.Windows.Forms # variable to sync between runspaces $sync = [Hashtable]::Synchronized(@{}) $sync.PSScriptRoot = $PSScriptRoot -$sync.version = "23.08.03" +$sync.version = "23.08.08" $sync.configs = @{} $sync.ProcessRunning = $false @@ -812,6 +812,38 @@ function Set-WinUtilRegistry { Write-Warning $psitem.Exception.StackTrace } } +function Set-WinUtilRestorePoint { + <# + + .DESCRIPTION + This function will make a Restore Point + + #> + + # Check if the user has administrative privileges + if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { + Write-Host "Please run this script as an administrator." + return + } + + # Check if System Restore is enabled for the main drive + try { + # Try getting restore points to check if System Restore is enabled + Enable-ComputerRestore -Drive "$env:SystemDrive" + } catch { + Write-Host "An error occurred while enabling System Restore: $_" + } + + # Get all the restore points for the current day + $existingRestorePoints = Get-ComputerRestorePoint | Where-Object { $_.CreationTime.Date -eq (Get-Date).Date } + + # Check if there is already a restore point created today + if ($existingRestorePoints.Count -eq 0) { + $description = "System Restore Point created by WinUtil" + + Checkpoint-Computer -Description $description -RestorePointType "MODIFY_SETTINGS" + } +} function Set-WinUtilScheduledTask { <# @@ -875,15 +907,6 @@ Function Set-WinUtilService { # Service exists, proceed with changing properties $service | Set-Service -StartupType $StartupType -ErrorAction Stop - - if ($StartupType -eq "Disabled") { - Write-Host "Stopping $Name" - Stop-Service -Name $Name -Force -ErrorAction Stop - } - elseif ($StartupType -eq "Manual") { - Write-Host "Stopping $Name" - Stop-Service -Name $Name -Force -ErrorAction Stop - } } catch [System.ServiceProcess.ServiceNotFoundException] { Write-Warning "Service $Name was not found" @@ -1651,6 +1674,8 @@ function Invoke-WPFtweaksbutton { return } + Set-WinUtilRestorePoint + Invoke-WPFRunspace -ArgumentList $Tweaks -ScriptBlock { param($Tweaks) @@ -2405,6 +2430,7 @@ $inputXML = '