2023-03-07 14:28:00 -06:00
|
|
|
<#
|
|
|
|
.NOTES
|
|
|
|
Author : Chris Titus @christitustech
|
|
|
|
Runspace Author: @DeveloperDurp
|
|
|
|
GitHub : https://github.com/ChrisTitusTech
|
|
|
|
Version : #{replaceme}
|
|
|
|
#>
|
2024-01-15 11:32:19 -06:00
|
|
|
param (
|
|
|
|
[switch]$Debug,
|
|
|
|
[string]$Config,
|
|
|
|
[switch]$Run
|
|
|
|
)
|
|
|
|
|
|
|
|
# Set DebugPreference based on the -Debug switch
|
|
|
|
if ($Debug) {
|
|
|
|
$DebugPreference = "Continue"
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($Config) {
|
|
|
|
$PARAM_CONFIG = $Config
|
|
|
|
}
|
|
|
|
|
|
|
|
$PARAM_RUN = $false
|
|
|
|
# Handle the -Run switch
|
|
|
|
if ($Run) {
|
|
|
|
Write-Host "Running config file tasks..."
|
|
|
|
$PARAM_RUN = $true
|
|
|
|
}
|
2023-03-07 14:28:00 -06:00
|
|
|
|
Test 2024 01 03 (#1384)
* Increase performance during loading. (#1348)
* Increase performance during loading.
Add a clear button to the search box.
Add link and description attributes to the applications JSON.
Use the link for linking to the app website.
Use the description as a tooltip for each app.
Add a clickable link to the website for each application (this took a long time; don't kick me if I got some wrong).
Pressing Escape now clears the filter box.
Pressing Alt-P prints your PID.
* Fix for services that are being stopped
* Compile winutil
* Adding new Get-LocalizedYesNo based on choice.exe which is faster and more reliable, thank you @dtm-r for implementing it and testing it on English, German, Dutch, French, Italian, Spansich and Russian. Incredible work by @dtm-r, all cridit and props go to him.
See this thread for details https://github.com/ChrisTitusTech/winutil/issues/1324
* Added error-checking logic for mounting ISOs and also created a wiki page that explains some of the errors.
---------
Co-authored-by: KonTy <KonTy@github.com>
* Compile Winutil
* Custom save targets for MicroWin ISOs (#1346)
* Workaround for Explorer freezes
Some people have reported that setting the Event Log service to Automatic and starting it can (temporarily) fix Explorer freezes.
This change detects whether the next service in the list is "EventLog" and skips it
* Allow user to save MicroWin ISOs anywhere
Adds a SaveFileDialog component to let the user specify the location of the MicroWin ISO and uses it during creation with oscdimg.
(It uses a Process object from System.Diagnostics because I couldn't get it to work with Start-Process)
* Removed temporary workaround
Removed my version of the workaround in favor of the version from @KonTy (merge PR #1348 first)
---------
Co-authored-by: Chris Titus <contact@christitus.com>
* Highly anticipated fix for small screens (#1358)
* Increase performance during loading.
Add a clear button to the search box.
Add link and description attributes to the applications JSON.
Use the link for linking to the app website.
Use the description as a tooltip for each app.
Add a clickable link to the website for each application (this took a long time; don't kick me if I got some wrong).
Pressing Escape now clears the filter box.
Pressing Alt-P prints your PID.
* Fix for services that are being stopped
* Compile winutil
* Adding new Get-LocalizedYesNo based on choice.exe which is faster and more reliable, thank you @dtm-r for implementing it and testing it on English, German, Dutch, French, Italian, Spansich and Russian. Incredible work by @dtm-r, all cridit and props go to him.
See this thread for details https://github.com/ChrisTitusTech/winutil/issues/1324
* Added error-checking logic for mounting ISOs and also created a wiki page that explains some of the errors.
* Highly anticipated fix for small screen computers
---------
Co-authored-by: KonTy <KonTy@github.com>
* Compile Winutil
* Winutil take a long time to create iso file and goes to sleep, this fixes that issue #1343 (#1371)
Co-authored-by: KonTy <KonTy@github.com>
* Compile Winutil
* Create .gitattributes
* Update .gitattributes
* add winget ventoy package (#1374)
* add winget ventoy package
* convert applications.json to utf-8
* update applications.json again
* Compile Winutil
* Update applications.json
fix encoding
* Compile Winutil
* Fix Encoding and Bad Symbols
* Compile Winutil
* feat: Add more software choices (#1379)
* Compile Winutil
* Update configs.Tests.ps1
* Update winutil.Tests.ps1
* Update applications.json
* Compile Winutil
* Update applications.json
* Compile Winutil
* Update applications.json
* Compile Winutil
* fix functions for unit tests
* Compile Winutil
* Update Invoke-MicroWin-Helper.ps1
* Compile Winutil
* fix name WPF Close Button
* Update inputXML.xaml
* Compile Winutil
* my bad that wasnt it
* modify unit test for stop on error
* Compile Winutil
* Update unittests.yaml
* Create test
* Update unittests.yaml
* Update unittests.yaml
* Update unittests.yaml
* Update unittests.yaml
* Update unittests.yaml
* Update unittests.yaml
* Update unittests.yaml
* Update unittests.yaml
* Compile Winutil
* Make restore points optional, enabled by default (#1380)
* Make restore points optional, enabled by default
* Tweaks order fix if restorepoint is checked
* Compile Winutil
* update unit tests
* Compile Winutil
* Update unittests.yaml
* Update unittests.yaml
* Update winutil.Tests.ps1
* tests
* Compile Winutil
* Update unittests.yaml
* Update unittests.yaml
* Update unittests.yaml
* fix unit test
* Update winutil.Tests.ps1
* rewrite all pester test for winutil
* Compile Winutil
* fix handle is invalid error
* final unit test
---------
Co-authored-by: KonTy <9524513+KonTy@users.noreply.github.com>
Co-authored-by: KonTy <KonTy@github.com>
Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com>
Co-authored-by: CodingWonders <101426328+CodingWonders@users.noreply.github.com>
Co-authored-by: Munkk <152475628+munkk01@users.noreply.github.com>
Co-authored-by: Kiril Vasilev <Kiril.v92@gmail.com>
2024-01-12 00:34:41 -06:00
|
|
|
if (!(Test-Path -Path $ENV:TEMP)) {
|
|
|
|
New-Item -ItemType Directory -Force -Path $ENV:TEMP
|
|
|
|
}
|
|
|
|
|
2023-03-07 14:28:00 -06:00
|
|
|
Start-Transcript $ENV:TEMP\Winutil.log -Append
|
|
|
|
|
2023-10-19 17:12:55 -05:00
|
|
|
# Load DLLs
|
2023-11-28 16:11:11 -06:00
|
|
|
Add-Type -AssemblyName PresentationFramework
|
2023-03-07 14:28:00 -06:00
|
|
|
Add-Type -AssemblyName System.Windows.Forms
|
|
|
|
|
2023-10-19 17:12:55 -05:00
|
|
|
# Variable to sync between runspaces
|
2023-03-07 14:28:00 -06:00
|
|
|
$sync = [Hashtable]::Synchronized(@{})
|
|
|
|
$sync.PSScriptRoot = $PSScriptRoot
|
|
|
|
$sync.version = "#{replaceme}"
|
|
|
|
$sync.configs = @{}
|
|
|
|
$sync.ProcessRunning = $false
|
2023-07-13 15:46:00 -05:00
|
|
|
|
2023-11-28 16:11:11 -06:00
|
|
|
$currentPid = [System.Security.Principal.WindowsIdentity]::GetCurrent()
|
|
|
|
$principal = new-object System.Security.Principal.WindowsPrincipal($currentPid)
|
|
|
|
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
|
2023-07-13 15:46:00 -05:00
|
|
|
|
2024-01-15 11:32:19 -06:00
|
|
|
|
2023-11-28 16:11:11 -06:00
|
|
|
if ($principal.IsInRole($adminRole))
|
|
|
|
{
|
|
|
|
$Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Admin)"
|
|
|
|
clear-host
|
2023-07-13 15:46:00 -05:00
|
|
|
}
|
2023-11-28 16:11:11 -06:00
|
|
|
else
|
|
|
|
{
|
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 "===========================================" -Foregroundcolor Red
|
|
|
|
Write-Host "-- Scripts must be run as Administrator ---" -Foregroundcolor Red
|
|
|
|
Write-Host "-- Right-Click Start -> Terminal(Admin) ---" -Foregroundcolor Red
|
|
|
|
Write-Host "===========================================" -Foregroundcolor Red
|
2023-11-28 16:11:11 -06:00
|
|
|
break
|
|
|
|
}
|