mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-02-06 16:00:10 +00:00
Compare commits
28 Commits
b02c7f3eab
...
fix-adobe-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1444cf581f | ||
|
|
8ed3a31424 | ||
|
|
424d4030c1 | ||
|
|
f88c9be70d | ||
|
|
bc4cd84127 | ||
|
|
54b4bcdda1 | ||
|
|
c5c23d8d18 | ||
|
|
28e84af33d | ||
|
|
832af914e9 | ||
|
|
6d9ed9026d | ||
|
|
9e877afe0e | ||
|
|
0c0ced381a | ||
|
|
8ebd127857 | ||
|
|
25a392877f | ||
|
|
ef2c91b616 | ||
|
|
b52ead87f4 | ||
|
|
2dcfc2b109 | ||
|
|
59a9c59064 | ||
|
|
fcc57fde50 | ||
|
|
06e5477d0e | ||
|
|
a5271597e9 | ||
|
|
d841792f8d | ||
|
|
132260ab96 | ||
|
|
919b2e0b8f | ||
|
|
22e083182d | ||
|
|
2ec37f952a | ||
|
|
aa719b49bf | ||
|
|
e9a6cd32d8 |
59
.github/CODEOWNERS
vendored
59
.github/CODEOWNERS
vendored
@@ -1,59 +1,2 @@
|
||||
# This is a comment.
|
||||
# Each line is a file pattern followed by one or more owners.
|
||||
|
||||
# These owners will be the default owners for everything in
|
||||
# the repo. Unless a later match takes precedence,
|
||||
# @global-owner1 and @global-owner2 will be requested for
|
||||
# review when someone opens a pull request.
|
||||
# Chris rules EVERYTHING (including paths listed below)
|
||||
* @ChrisTitusTech
|
||||
|
||||
# Order is important; the last matching pattern takes the most
|
||||
# precedence. When someone opens a pull request that only
|
||||
# modifies JS files, only @js-owner and not the global
|
||||
# owner(s) will be requested for a review.
|
||||
# *.js @js-owner #This is an inline comment.
|
||||
|
||||
# You can also use email addresses if you prefer. They'll be
|
||||
# used to look up users just like we do for commit author
|
||||
# emails.
|
||||
# *.go docs@example.com
|
||||
|
||||
# Teams can be specified as code owners as well. Teams should
|
||||
# be identified in the format @org/team-name. Teams must have
|
||||
# explicit write access to the repository. In this example,
|
||||
# the octocats team in the octo-org organization owns all .txt files.
|
||||
# *.txt @octo-org/octocats
|
||||
|
||||
# In this example, @doctocat owns any files in the build/logs
|
||||
# directory at the root of the repository and any of its
|
||||
# subdirectories.
|
||||
# /build/logs/ @doctocat
|
||||
|
||||
# The `docs/*` pattern will match files like
|
||||
# `docs/getting-started.md` but not further nested files like
|
||||
# `docs/build-app/troubleshooting.md`.
|
||||
# docs/* docs@example.com
|
||||
|
||||
# In this example, @octocat owns any file in an apps directory
|
||||
# anywhere in your repository.
|
||||
# apps/ @octocat
|
||||
|
||||
# In this example, @doctocat owns any file in the `/docs`
|
||||
# directory in the root of your repository and any of its
|
||||
# subdirectories.
|
||||
# /docs/ @doctocat
|
||||
|
||||
# In this example, any change inside the `/scripts` directory
|
||||
# will require approval from @doctocat or @octocat.
|
||||
# /scripts/ @doctocat @octocat
|
||||
|
||||
# In this example, @octocat owns any file in a `/logs` directory such as
|
||||
# `/build/logs`, `/scripts/logs`, and `/deeply/nested/logs`. Any changes
|
||||
# in a `/logs` directory will require approval from @octocat.
|
||||
# **/logs @octocat
|
||||
|
||||
# In this example, @octocat owns any file in the `/apps`
|
||||
# directory in the root of your repository except for the `/apps/github`
|
||||
# subdirectory, as its owners are left empty.
|
||||
# /apps/ @octocat
|
||||
# /apps/github
|
||||
6
.github/PULL_REQUEST_TEMPLATE.md
vendored
6
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -4,11 +4,11 @@
|
||||
- [ ] New feature
|
||||
- [ ] Bug fix
|
||||
- [ ] Documentation update
|
||||
- [ ] Refactoring
|
||||
- [ ] Hotfix
|
||||
- [ ] Security patch
|
||||
- [ ] UI/UX improvement
|
||||
|
||||
<!-- This automatically adds labels to your PR based on the selections above. -->
|
||||
|
||||
## Description
|
||||
<!--[Provide a detailed explanation of the changes you have made. Include the reasons behind these changes and any relevant context. Link any related issues.]-->
|
||||
|
||||
@@ -18,7 +18,5 @@
|
||||
|
||||
## Checklist
|
||||
- [ ] My code adheres to the coding and style guidelines of the project.
|
||||
- [ ] I have performed a self-review of my own code.
|
||||
- [ ] I have commented my code, particularly in hard-to-understand areas.
|
||||
- [ ] I have made corresponding changes to the documentation.
|
||||
- [ ] My changes generate no errors/warnings/merge conflicts.
|
||||
|
||||
12
.github/release-drafter.yml
vendored
12
.github/release-drafter.yml
vendored
@@ -4,15 +4,16 @@ categories:
|
||||
labels:
|
||||
- 'feature'
|
||||
- 'enhancement'
|
||||
- 'new feature'
|
||||
- title: '🐛 Bug Fixes'
|
||||
labels:
|
||||
- 'fix'
|
||||
- 'hotfix'
|
||||
- 'bugfix'
|
||||
- 'bug'
|
||||
- title: '📚 Documentation'
|
||||
label: 'documentation'
|
||||
- title: '🔒 Security'
|
||||
label: 'security'
|
||||
- title: '🎨 UI/UX Improvements'
|
||||
label: 'ui update'
|
||||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
||||
template: |
|
||||
## Changes
|
||||
@@ -31,7 +32,7 @@ autolabeler:
|
||||
- '/fix\/.+/'
|
||||
title:
|
||||
- '/fix/i'
|
||||
- label: 'enhancement'
|
||||
- label: 'new feature'
|
||||
branch:
|
||||
- '/feature\/.+/'
|
||||
body:
|
||||
@@ -40,9 +41,6 @@ autolabeler:
|
||||
files:
|
||||
- '**/*.md'
|
||||
- 'docs/**/*'
|
||||
- label: 'security'
|
||||
branch:
|
||||
- '/security\/.+/'
|
||||
replacers:
|
||||
- search: /"/g
|
||||
replace: ''
|
||||
|
||||
2
.github/workflows/issue-slash-commands.yaml
vendored
2
.github/workflows/issue-slash-commands.yaml
vendored
@@ -67,7 +67,7 @@ jobs:
|
||||
id: check_user
|
||||
if: env.command == 'true'
|
||||
run: |
|
||||
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC" "CodingWonders")
|
||||
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC" "CodingWonders" "GabiNun")
|
||||
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then
|
||||
echo "user=true" >> $GITHUB_ENV
|
||||
else
|
||||
|
||||
45
.github/workflows/label-pr.yaml
vendored
Normal file
45
.github/workflows/label-pr.yaml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Label PRs by Type of Change
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, edited, synchronize]
|
||||
|
||||
jobs:
|
||||
label-pr:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
issues: write
|
||||
contents: read # Often needed for github-script
|
||||
steps:
|
||||
- name: Check PR body for Type of Change
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const prBody = context.payload.pull_request.body || '';
|
||||
const labelsToAdd = [];
|
||||
|
||||
if (/\[x\]\s*New feature/i.test(prBody)) {
|
||||
labelsToAdd.push('new feature');
|
||||
}
|
||||
if (/\[x\]\s*Bug fix/i.test(prBody)) {
|
||||
labelsToAdd.push('bug');
|
||||
}
|
||||
if (/\[x\]\s*Documentation update/i.test(prBody)) {
|
||||
labelsToAdd.push('documentation');
|
||||
}
|
||||
if (/\[x\]\s*Hotfix/i.test(prBody)) {
|
||||
labelsToAdd.push('hotfix');
|
||||
}
|
||||
if (/\[x\]\s*UI\/UX improvement/i.test(prBody)) {
|
||||
labelsToAdd.push('ui update');
|
||||
}
|
||||
|
||||
if (labelsToAdd.length > 0) {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.payload.pull_request.number,
|
||||
labels: labelsToAdd
|
||||
});
|
||||
}
|
||||
2
.github/workflows/pre-release.yaml
vendored
2
.github/workflows/pre-release.yaml
vendored
@@ -56,7 +56,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
config-name: release-drafter.yml
|
||||
version: ${{ env.VERSION }} # Pass the version variable
|
||||
version: ${{ env.VERSION }}
|
||||
|
||||
- name: Create and Upload Release
|
||||
id: create_release
|
||||
|
||||
12
Compile.ps1
12
Compile.ps1
@@ -36,15 +36,6 @@ function Update-Progress {
|
||||
Write-Progress -Activity $Activity -Status $StatusMessage -PercentComplete $Percent
|
||||
}
|
||||
|
||||
$header = @"
|
||||
################################################################################################################
|
||||
### ###
|
||||
### WARNING: This file is automatically generated DO NOT modify this file directly as it will be overwritten ###
|
||||
### ###
|
||||
################################################################################################################
|
||||
"@
|
||||
|
||||
|
||||
Update-Progress "Pre-req: Running Preprocessor..." 0
|
||||
|
||||
# Dot source the 'Invoke-Preprocessing' Function from 'tools/Invoke-Preprocessing.ps1' Script
|
||||
@@ -76,9 +67,6 @@ Invoke-Preprocessing -WorkingDir "$workingdir" -ExcludedFiles $excludedFiles -Pr
|
||||
Update-Progress "Pre-req: Allocating Memory" 0
|
||||
$script_content = [System.Collections.Generic.List[string]]::new()
|
||||
|
||||
Update-Progress "Adding: Header" 5
|
||||
$script_content.Add($header)
|
||||
|
||||
Update-Progress "Adding: Version" 10
|
||||
$script_content.Add($(Get-Content "scripts\start.ps1").replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)"))
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ You'll see a new file named `winutil.ps1`, which's created by `Compile.ps1` scri
|
||||
|
||||
These are the sponsors that help keep this project alive with monthly contributions.
|
||||
|
||||
<!-- sponsors --><a href="https://github.com/markamos"><img src="https://github.com/markamos.png" width="60px" alt="User avatar: Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="User avatar: Martin Stockzell" /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/KenichiQaz"><img src="https://github.com/KenichiQaz.png" width="60px" alt="User avatar: Stefan" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="User avatar: Dave J (WhamGeek)" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/FatBastard0"><img src="https://github.com/FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DursleyGuy"><img src="https://github.com/DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/quaszi"><img src="https://github.com/quaszi.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DwayneTheRockLobster1"><img src="https://github.com/DwayneTheRockLobster1.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KieraKujisawa"><img src="https://github.com/KieraKujisawa.png" width="60px" alt="User avatar: Kiera Meredith" /></a><a href="https://github.com/TaNorbs"><img src="https://github.com/TaNorbs.png" width="60px" alt="User avatar: Norbs" /></a><!-- sponsors -->
|
||||
<!-- sponsors --><a href="https://github.com/markamos"><img src="https://github.com/markamos.png" width="60px" alt="User avatar: Mark Amos" /></a><a href="https://github.com/dwelfusius"><img src="https://github.com/dwelfusius.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/mews-se"><img src="https://github.com/mews-se.png" width="60px" alt="User avatar: Martin Stockzell" /></a><a href="https://github.com/jdiegmueller"><img src="https://github.com/jdiegmueller.png" width="60px" alt="User avatar: Jason A. Diegmueller" /></a><a href="https://github.com/robertsandrock"><img src="https://github.com/robertsandrock.png" width="60px" alt="User avatar: RMS" /></a><a href="https://github.com/KenichiQaz"><img src="https://github.com/KenichiQaz.png" width="60px" alt="User avatar: Stefan" /></a><a href="https://github.com/paulsheets"><img src="https://github.com/paulsheets.png" width="60px" alt="User avatar: Paul" /></a><a href="https://github.com/djones369"><img src="https://github.com/djones369.png" width="60px" alt="User avatar: Dave J (WhamGeek)" /></a><a href="https://github.com/anthonymendez"><img src="https://github.com/anthonymendez.png" width="60px" alt="User avatar: Anthony Mendez" /></a><a href="https://github.com/FatBastard0"><img src="https://github.com/FatBastard0.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DursleyGuy"><img src="https://github.com/DursleyGuy.png" width="60px" alt="User avatar: DursleyGuy" /></a><a href="https://github.com/quaszi"><img src="https://github.com/quaszi.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/DwayneTheRockLobster1"><img src="https://github.com/DwayneTheRockLobster1.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/KieraKujisawa"><img src="https://github.com/KieraKujisawa.png" width="60px" alt="User avatar: Kiera Meredith" /></a><a href="https://github.com/andrewpayne68"><img src="https://github.com/andrewpayne68.png" width="60px" alt="User avatar: Andrew P" /></a><!-- sponsors -->
|
||||
|
||||
## 🏅 Thanks to all Contributors
|
||||
Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻.
|
||||
|
||||
@@ -552,6 +552,14 @@
|
||||
"link": "https://espanso.org/",
|
||||
"winget": "Espanso.Espanso"
|
||||
},
|
||||
"ffmpeg": {
|
||||
"category": "Utilities",
|
||||
"choco": "na",
|
||||
"content": "eibol.FFmpegBatchAVConverter",
|
||||
"description": "FFmpeg Batch AV Converter is a universal audio and video encoder, that allows to use the full potential of ffmpeg command line with a few mouse clicks in a convenient GUI with drag and drop, progress information.",
|
||||
"link": "https://ffmpeg-batch.sourceforge.io/",
|
||||
"winget": "eibol.FFmpegBatchAVConverter"
|
||||
},
|
||||
"falkon": {
|
||||
"category": "Browsers",
|
||||
"choco": "falkon",
|
||||
@@ -912,6 +920,14 @@
|
||||
"link": "https://www.cpuid.com/softwares/hwmonitor.html",
|
||||
"winget": "CPUID.HWMonitor"
|
||||
},
|
||||
"imhex": {
|
||||
"category": "Development",
|
||||
"choco": "na",
|
||||
"content": "ImHex (Hex Editor)",
|
||||
"description": "A modern, featureful Hex Editor for Reverse Engineers and Developers.",
|
||||
"link": "https://imhex.werwolv.net/",
|
||||
"winget": "WerWolv.ImHex"
|
||||
},
|
||||
"imageglass": {
|
||||
"category": "Multimedia Tools",
|
||||
"choco": "imageglass",
|
||||
|
||||
@@ -1140,6 +1140,13 @@
|
||||
"Type": "DWord",
|
||||
"Value": "0",
|
||||
"OriginalValue": "<RemoveEntry>"
|
||||
},
|
||||
{
|
||||
"Path": "HKLM:\\SOFTWARE\\Policies\\BraveSoftware\\Brave",
|
||||
"Name": "BraveStatsPingEnabled",
|
||||
"Type": "DWord",
|
||||
"Value": "0",
|
||||
"OriginalValue": "<RemoveEntry>"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1164,6 +1171,13 @@
|
||||
"Value": "0",
|
||||
"OriginalValue": "<RemoveEntry>"
|
||||
},
|
||||
{
|
||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||
"Name": "ofefcgjbeghpigppfmkologfjadafddi",
|
||||
"Type": "String",
|
||||
"Value": "1",
|
||||
"OriginalValue": "<RemoveEntry>"
|
||||
},
|
||||
{
|
||||
"Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Edge",
|
||||
"Name": "ShowRecommendationsEnabled",
|
||||
@@ -1584,71 +1598,26 @@
|
||||
"
|
||||
# Disable Defender Auto Sample Submission
|
||||
Set-MpPreference -SubmitSamplesConsent 2
|
||||
|
||||
$Memory = (Get-CimInstance Win32_PhysicalMemory | Measure-Object Capacity -Sum).Sum / 1KB
|
||||
Set-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\" -Name SvcHostSplitThresholdInKB -Value $Memory
|
||||
"
|
||||
],
|
||||
"link": "https://winutil.christitus.com/dev/tweaks/essential-tweaks/tele"
|
||||
},
|
||||
"WPFTweaksDisableEdge": {
|
||||
"Content": "Disable Edge",
|
||||
"Description": "Prevent msedge.exe from running with explorer policies.",
|
||||
"WPFTweaksRemoveEdge": {
|
||||
"Content": "Remove Microsoft Edge",
|
||||
"Description": "Unblocks Microsoft Edge uninstaller restrictions than uses that uninstaller to remove Microsoft Edge",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a023_",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\DisallowRun",
|
||||
"Name": "DisableEdge",
|
||||
"Type": "String",
|
||||
"Value": "msedge.exe",
|
||||
"OriginalValue": "<RemoveEntry>"
|
||||
},
|
||||
{
|
||||
"Path": "HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
|
||||
"Name": "DisallowRun",
|
||||
"Type": "DWord",
|
||||
"Value": "1",
|
||||
"OriginalValue": "<RemoveEntry>"
|
||||
}
|
||||
],
|
||||
"link": ""
|
||||
},
|
||||
"WPFTweaksMakeEdgeUninstallable": {
|
||||
"Content": "Make Edge Uninstallable via settings",
|
||||
"Description": "Makes it so you can uninstall edge via settings > installed apps",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a026_",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Microsoft Edge",
|
||||
"Name": "NoRemove",
|
||||
"Type": "Dword",
|
||||
"Value": "0",
|
||||
"OriginalValue": "1"
|
||||
}
|
||||
],
|
||||
"Order": "a028_",
|
||||
"InvokeScript": [
|
||||
"
|
||||
$File = \"C:\\Windows\\System32\\IntegratedServicesRegionPolicySet.json\"
|
||||
|
||||
takeown /f $File
|
||||
icacls $File /grant \"Administrators:(F)\"
|
||||
|
||||
$FileContent = Get-Content $File
|
||||
$FileContent[7] = $FileContent[7] -replace \"disabled\", \"enabled\"
|
||||
Set-Content $File $FileContent
|
||||
"
|
||||
"Invoke-WinUtilRemoveEdge"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
$File = \"C:\\Windows\\System32\\IntegratedServicesRegionPolicySet.json\"
|
||||
|
||||
takeown /f $File
|
||||
icacls $File /grant \"Administrators:(F)\"
|
||||
|
||||
$FileContent = Get-Content $File
|
||||
$FileContent[7] = $FileContent[7] -replace \"enabled\", \"disabled\"
|
||||
Set-Content $File $FileContent
|
||||
Write-Host 'Installing Microsoft Edge...'
|
||||
winget install Microsoft.Edge --source winget
|
||||
"
|
||||
],
|
||||
"link": ""
|
||||
@@ -1663,13 +1632,45 @@
|
||||
{
|
||||
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
|
||||
"Name": "RealTimeIsUniversal",
|
||||
"Type": "DWord",
|
||||
"Type": "QWord",
|
||||
"Value": "1",
|
||||
"OriginalValue": "0"
|
||||
}
|
||||
],
|
||||
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/utc"
|
||||
},
|
||||
"WPFTweaksRemoveOneDrive": {
|
||||
"Content": "Remove OneDrive",
|
||||
"Description": "Denys permission to remove onedrive user files than uses its own uninstaller to remove it than brings back permissions",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a029_",
|
||||
"InvokeScript": [
|
||||
"
|
||||
# Deny permission to remove OneDrive folder
|
||||
icacls $Env:OneDrive /deny \"Administrators:(D,DC)\"
|
||||
|
||||
Write-Host \"Uninstalling OneDrive...\"
|
||||
Start-Process 'C:\\Windows\\System32\\OneDriveSetup.exe' -ArgumentList '/uninstall' -Wait
|
||||
|
||||
# Some of OneDrive files use explorer, and OneDrive uses FileCoAuth
|
||||
Write-Host \"Removing leftover OneDrive Files...\"
|
||||
Stop-Process -Name FileCoAuth,Explorer
|
||||
Remove-Item \"$Env:LocalAppData\\Microsoft\\OneDrive\" -Recurse -Force
|
||||
Remove-Item \"C:\\ProgramData\\Microsoft OneDrive\" -Recurse -Force
|
||||
|
||||
# Grant back permission to accses OneDrive folder
|
||||
icacls $Env:OneDrive /grant \"Administrators:(D,DC)\"
|
||||
"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
Write-Host \"Installing OneDrive\"
|
||||
winget install Microsoft.Onedrive --source winget
|
||||
"
|
||||
],
|
||||
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/removeonedrive"
|
||||
},
|
||||
"WPFTweaksRemoveHome": {
|
||||
"Content": "Remove Home from Explorer",
|
||||
"Description": "Removes the Home from Explorer and sets This PC as default",
|
||||
@@ -2151,9 +2152,9 @@
|
||||
$hostsUrl = \"https://github.com/Ruddernation-Designs/Adobe-URL-Block-List/raw/refs/heads/master/hosts\"
|
||||
$hosts = \"$env:SystemRoot\\System32\\drivers\\etc\\hosts\"
|
||||
|
||||
Copy-Item $hosts \"$hosts.bak\"
|
||||
Copy-Item $hosts \"$env:SystemRoot\\System32\\drivers\\etc\\hosts\\$hosts.bak\"
|
||||
Invoke-WebRequest $hostsUrl -OutFile $hosts
|
||||
ipconfig flushdns
|
||||
ipconfig /flushdns
|
||||
|
||||
Write-Host \"Added Adobe url block list from host file\"
|
||||
"
|
||||
@@ -2161,11 +2162,10 @@
|
||||
"UndoScript": [
|
||||
"
|
||||
$hosts = \"$env:SystemRoot\\System32\\drivers\\etc\\hosts\"
|
||||
$backup = \"$hosts.bak\"
|
||||
$backup = \"$env:SystemRoot\\System32\\drivers\\etc\\hosts\\$hosts.bak\"
|
||||
|
||||
Copy-Item $backup $hosts
|
||||
Remove-Item $backup
|
||||
ipconfig flushdns
|
||||
Remove-Item $hosts
|
||||
ipconfig /flushdns
|
||||
|
||||
Write-Host \"Removed Adobe url block list from host file\"
|
||||
"
|
||||
|
||||
@@ -45,6 +45,7 @@ weight: 3
|
||||
- [Remove Home and Gallery from explorer](tweaks/z--advanced-tweaks---caution/removehomegallery/)
|
||||
- [Make Edge Uninstallable](tweaks/z--advanced-tweaks---caution/edgeuninstall/)
|
||||
- [Run OO Shutup 10](tweaks/z--advanced-tweaks---caution/oosubutton/)
|
||||
- [Remove OneDrive](tweaks/z--advanced-tweaks---caution//removeonedrive)
|
||||
- [Set Classic Right-Click Menu ](tweaks/z--advanced-tweaks---caution/rightclickmenu/)
|
||||
- [Set Display for Performance](tweaks/z--advanced-tweaks---caution/display/)
|
||||
- [Set Time to UTC (Dual Boot)](tweaks/z--advanced-tweaks---caution/utc/)
|
||||
@@ -76,7 +77,7 @@ weight: 3
|
||||
|
||||
### Fixes
|
||||
|
||||
- [Remove Adobe Creative Cloud](features/fixes/runadobecccl cleanertool/)
|
||||
- [Remove Adobe Creative Cloud](features/fixes/RunAdobeCCCleanerTool/)
|
||||
- [Reset Network](features/fixes/network/)
|
||||
- [Reset Windows Update](features/fixes/update/)
|
||||
- [Set Up Autologin](features/fixes/autologin/)
|
||||
|
||||
@@ -960,3 +960,46 @@
|
||||
}
|
||||
],
|
||||
```
|
||||
#Function
|
||||
```powershell
|
||||
Function Set-WinUtilService {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Changes the startup type of the given service
|
||||
|
||||
.PARAMETER Name
|
||||
The name of the service to modify
|
||||
|
||||
.PARAMETER StartupType
|
||||
The startup type to set the service to
|
||||
|
||||
.EXAMPLE
|
||||
Set-WinUtilService -Name "HomeGroupListener" -StartupType "Manual"
|
||||
|
||||
#>
|
||||
param (
|
||||
$Name,
|
||||
$StartupType
|
||||
)
|
||||
try {
|
||||
Write-Host "Setting Service $Name to $StartupType"
|
||||
|
||||
# Check if the service exists
|
||||
$service = Get-Service -Name $Name -ErrorAction Stop
|
||||
|
||||
# Service exists, proceed with changing properties -- while handling auto delayed start for PWSH 5
|
||||
if (($PSVersionTable.PSVersion.Major -lt 7) -and ($StartupType -eq "AutomaticDelayedStart")) {
|
||||
sc.exe config $Name start=delayed-auto
|
||||
} else {
|
||||
$service | Set-Service -StartupType $StartupType -ErrorAction Stop
|
||||
}
|
||||
} catch [System.ServiceProcess.ServiceNotFoundException] {
|
||||
Write-Warning "Service $Name was not found"
|
||||
} catch {
|
||||
Write-Warning "Unable to set $Name due to unhandled exception"
|
||||
Write-Warning $_.Exception.Message
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
- [Remove Gallery from explorer](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveGallery.md)
|
||||
- [Remove Home from explorer](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveHome.md)
|
||||
- [Run OO Shutup 10](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/OOSUbutton.md)
|
||||
- [Remove OneDrive](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveOneDrive.md)
|
||||
- [Set Classic Right-Click Menu](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/RightClickMenu.md)
|
||||
- [Set Display for Performance](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/Display.md)
|
||||
- [Set Time to UTC (Dual Boot)](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/UTC.md)
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
# Remove Microsoft Edge
|
||||
|
||||
```json
|
||||
"WPFTweaksMakeEdgeUninstallable": {
|
||||
"Content": "Make Edge Uninstallable via settings",
|
||||
"Description": "Makes it so you can uninstall edge via settings > installed apps",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a026_",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Microsoft Edge",
|
||||
"Name": "NoRemove",
|
||||
"Type": "Dword",
|
||||
"Value": "0",
|
||||
"OriginalValue": "1"
|
||||
}
|
||||
],
|
||||
"InvokeScript": [
|
||||
"
|
||||
$File = \"C:\\Windows\\System32\\IntegratedServicesRegionPolicySet.json\"
|
||||
|
||||
takeown /f $File
|
||||
icacls $File /grant \"Administrators:(F)\"
|
||||
|
||||
$FileContent = Get-Content $File
|
||||
$FileContent[7] = $FileContent[7] -replace \"disabled\", \"enabled\"
|
||||
Set-Content $File $FileContent
|
||||
"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
$File = \"C:\\Windows\\System32\\IntegratedServicesRegionPolicySet.json\"
|
||||
|
||||
takeown /f $File
|
||||
icacls $File /grant \"Administrators:(F)\"
|
||||
|
||||
$FileContent = Get-Content $File
|
||||
$FileContent[7] = $FileContent[7] -replace \"enabled\", \"disabled\"
|
||||
Set-Content $File $FileContent
|
||||
"
|
||||
],
|
||||
```
|
||||
|
||||
## Registry Changes
|
||||
Applications and System Components store and retrieve configuration data to modify windows settings, so we can use the registry to change many settings in one place.
|
||||
|
||||
You can find information about the registry on [Wikipedia](https://www.wikiwand.com/en/Windows_Registry) and [Microsoft's Website](https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry).
|
||||
@@ -0,0 +1,30 @@
|
||||
# Remove Microsoft Edge
|
||||
|
||||
# Json File
|
||||
```json
|
||||
"WPFTweaksRemoveEdge": {
|
||||
"Content": "Remove Microsoft Edge",
|
||||
"Description": "Unblocks Microsoft Edge uninstaller restrictions than uses that uninstaller to remove Microsoft Edge",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a028_",
|
||||
"InvokeScript": [
|
||||
"Invoke-WinUtilRemoveEdge"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
Write-Host 'Installing Microsoft Edge...'
|
||||
winget install Microsoft.Edge --source winget
|
||||
"
|
||||
],
|
||||
```
|
||||
# Function
|
||||
```json
|
||||
function Invoke-WinUtilRemoveEdge {
|
||||
Write-Host "Unlocking The Offical Edge Uninstaller And Removing Microsoft Edge..."
|
||||
|
||||
$Path = (Get-ChildItem "C:\Program Files (x86)\Microsoft\Edge\Application\*\Installer\setup.exe")[0].FullName
|
||||
New-Item "C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe" -Force
|
||||
Start-Process $Path -ArgumentList '--uninstall --system-level --force-uninstall --delete-profile'
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,33 @@
|
||||
# Remove OneDrive
|
||||
```json
|
||||
"WPFTweaksRemoveOneDrive": {
|
||||
"Content": "Remove OneDrive",
|
||||
"Description": "Denys permission to remove onedrive user files than uses its own uninstaller to remove it than brings back permissions",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a029_",
|
||||
"InvokeScript": [
|
||||
"
|
||||
# Deny permission to remove OneDrive folder
|
||||
icacls $Env:OneDrive /deny \"Administrators:(D,DC)\"
|
||||
|
||||
Write-Host \"Uninstalling OneDrive...\"
|
||||
Start-Process 'C:\\Windows\\System32\\OneDriveSetup.exe' -ArgumentList '/uninstall' -Wait
|
||||
|
||||
# Some of OneDrive files use explorer, and OneDrive uses FileCoAuth
|
||||
Write-Host \"Removing leftover OneDrive Files...\"
|
||||
Stop-Process -Name FileCoAuth,Explorer
|
||||
Remove-Item \"$Env:LocalAppData\\Microsoft\\OneDrive\" -Recurse -Force
|
||||
Remove-Item \"C:\\ProgramData\\Microsoft OneDrive\" -Recurse -Force
|
||||
|
||||
# Grant back permission to accses OneDrive folder
|
||||
icacls $Env:OneDrive /grant \"Administrators:(D,DC)\"
|
||||
"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
Write-Host \"Installing OneDrive\"
|
||||
winget install Microsoft.Onedrive --source winget
|
||||
"
|
||||
],
|
||||
```
|
||||
@@ -11,6 +11,7 @@
|
||||
- [Remove Home from explorer](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveHome.md)
|
||||
- [Make Edge Uninstallable](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/EdgeUninstall.md)
|
||||
- [Run OO Shutup 10](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/OOSUbutton.md)
|
||||
- [Remove OneDrive](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveOneDrive.md)
|
||||
- [Set Classic Right-Click Menu](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/RightClickMenu.md)
|
||||
- [Set Display for Performance](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/Display.md)
|
||||
- [Set Time to UTC (Dual Boot)](https://github.com/ChrisTitusTech/winutil/blob/main/docs/content/dev/tweaks/z--Advanced-Tweaks---CAUTION/UTC.md)
|
||||
|
||||
@@ -8,7 +8,7 @@ The utility provides three distinct settings for managing Windows updates: Defau
|
||||
### Security (Recommended) Settings
|
||||
- **Description**: This is the recommended setting for all computers.
|
||||
- **Update Schedule**:
|
||||
- **Feature Updates**: Delays feature updates by 2 years to avoid potential bugs and instability.
|
||||
- **Feature Updates**: Delays feature updates by 365 days to avoid potential bugs and instability.
|
||||
- **Security Updates**: Installs security updates 4 days after their release to ensure system protection against pressing security flaws.
|
||||
- **Rationale**:
|
||||
- **Feature Updates**: Often introduce new features and bugs; delaying these updates minimizes the risk of system disruptions.
|
||||
|
||||
@@ -54,14 +54,9 @@ public class PowerManagement {
|
||||
$index = $sync.MicrowinWindowsFlavors.SelectedValue.Split(":")[0].Trim()
|
||||
Write-Host "Index chosen: '$index' from $($sync.MicrowinWindowsFlavors.SelectedValue)"
|
||||
|
||||
$copyToUSB = $sync.WPFMicrowinCopyToUsb.IsChecked
|
||||
$injectDrivers = $sync.MicrowinInjectDrivers.IsChecked
|
||||
$importDrivers = $sync.MicrowinImportDrivers.IsChecked
|
||||
|
||||
$WPBT = $sync.MicroWinWPBT.IsChecked
|
||||
$unsupported = $sync.MicroWinUnsupported.IsChecked
|
||||
$skipFla = $sync.MicroWinNoFLA.IsChecked
|
||||
|
||||
$importVirtIO = $sync.MicrowinCopyVirtIO.IsChecked
|
||||
|
||||
$mountDir = $sync.MicrowinMountDir.Text
|
||||
@@ -90,8 +85,11 @@ public class PowerManagement {
|
||||
}
|
||||
}
|
||||
|
||||
$imgVersion = (Get-WindowsImage -ImagePath $mountDir\sources\install.wim -Index $index).Version
|
||||
$imgVersion = (Get-WindowsImage -ImagePath "$mountDir\sources\install.wim" -Index $index).Version
|
||||
# Windows Setup is the second index in the boot image.
|
||||
$bootVersion = (Get-WindowsImage -ImagePath "$mountDir\sources\boot.wim" -Index 2).Version
|
||||
Write-Host "The Windows Image Build Version is: $imgVersion"
|
||||
Write-Host "The WinPE boot image Build Version is: $bootVersion"
|
||||
|
||||
# Detect image version to avoid performing MicroWin processing on Windows 8 and earlier
|
||||
if ((Microwin-TestCompatibleImage $imgVersion $([System.Version]::new(10,0,10240,0))) -eq $false) {
|
||||
@@ -175,33 +173,31 @@ public class PowerManagement {
|
||||
}
|
||||
}
|
||||
|
||||
if ($WPBT) {
|
||||
Write-Host "Disabling WPBT Execution"
|
||||
reg load HKLM\zSYSTEM "$($scratchDir)\Windows\System32\config\SYSTEM"
|
||||
reg add "HKLM\zSYSTEM\ControlSet001\Control\Session Manager" /v DisableWpbtExecution /t REG_DWORD /d 1 /f
|
||||
reg unload HKLM\zSYSTEM
|
||||
}
|
||||
|
||||
if ($skipFla) {
|
||||
Write-Host "Skipping first logon animation..."
|
||||
reg load HKLM\zSOFTWARE "$($scratchDir)\Windows\System32\config\SOFTWARE"
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Active Setup\Installed Components\CMP_NoFla" /f
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Active Setup\Installed Components\CMP_NoFla" /ve /t REG_SZ /d "Stop First Logon Animation Process" /f
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Active Setup\Installed Components\CMP_NoFla" /v StubPath /t REG_EXPAND_SZ /d '""%WINDIR%\System32\cmd.exe"" /C ""taskkill /f /im firstlogonanim.exe""' /f
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Active Setup\Installed Components\CMP_NoFla" /f /ve /t REG_SZ /d "Stop First Logon Animation Process"
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Active Setup\Installed Components\CMP_NoFla" /f /v StubPath /t REG_EXPAND_SZ /d '\"%WINDIR%\System32\cmd.exe\" /C \"taskkill /f /im firstlogonanim.exe\"'
|
||||
reg unload HKLM\zSOFTWARE
|
||||
}
|
||||
|
||||
if ($unsupported) {
|
||||
Write-Host "Bypassing system requirements (locally)"
|
||||
reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d 0 /f
|
||||
reg add "HKCU\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d 0 /f
|
||||
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d 1 /f
|
||||
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d 1 /f
|
||||
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d 1 /f
|
||||
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d 1 /f
|
||||
reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d 1 /f
|
||||
reg add "HKLM\SYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d 1 /f
|
||||
}
|
||||
# We have to prepare the target system to accept the diagnostics script
|
||||
reg load HKLM\zSOFTWARE "$($scratchDir)\Windows\System32\config\SOFTWARE"
|
||||
reg add "HKLM\zSOFTWARE\WinUtil" /f
|
||||
reg add "HKLM\zSOFTWARE\WinUtil" /f /v "ToolboxVersion" /t REG_SZ /d "$($sync.version)"
|
||||
reg add "HKLM\zSOFTWARE\WinUtil" /f /v "MicroWinBuildDate" /t REG_SZ /d "$((Get-Date).ToString('yyMMdd-HHmm'))"
|
||||
|
||||
# REAL software developers set execution policies to unrestricted but, because we're targeting
|
||||
# mainstream population, we have to lower the level of "riskiness" -- set remotesigned; at least that
|
||||
# lets us run PWSH scripts that WE create. Execution policies don't really make sense anyway if common sense
|
||||
# is lacking.
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" /v "ExecutionPolicy" /t REG_SZ /d "RemoteSigned" /f
|
||||
|
||||
reg unload HKLM\zSOFTWARE
|
||||
|
||||
if ($importVirtIO) {
|
||||
Write-Host "Copying VirtIO drivers..."
|
||||
@@ -217,7 +213,10 @@ public class PowerManagement {
|
||||
Microwin-RemoveProvisionedPackages -UseCmdlets $true
|
||||
|
||||
# Detect Windows 11 24H2 and add dependency to FileExp to prevent Explorer look from going back - thanks @WitherOrNot and @thecatontheceiling
|
||||
if ((Microwin-TestCompatibleImage $imgVersion $([System.Version]::new(10,0,26100,1))) -eq $true) {
|
||||
# ----- UPDATE UPDATE UPDATE: they fixed this in 10.0.26100.7019. DO NOT DO THIS OTHERWISE IT BREAKS EXPLORER AGAIN BECAUSE THE CHEEKY LITTLE
|
||||
# ----- PoS CHANGED APPRUNTIME.CBS TO APPRUNTIME.CBS.1.6. Thing is, we don't need to patch this in those builds because it no longer breaks
|
||||
# ----- when you don't patch.
|
||||
if (((Microwin-TestCompatibleImage $imgVersion $([System.Version]::new(10,0,26100,1))) -eq $true) -and ((Microwin-TestCompatibleImage $imgVersion $([System.Version]::new(10,0,26100,7019))) -eq $false)) {
|
||||
try {
|
||||
if (Test-Path "$scratchDir\Windows\SystemApps\MicrosoftWindows.Client.FileExp_cw5n1h2txyewy\appxmanifest.xml" -PathType Leaf) {
|
||||
# Found the culprit. Do the following:
|
||||
@@ -302,11 +301,6 @@ public class PowerManagement {
|
||||
Copy-Item "$env:temp\FirstStartup.ps1" "$($scratchDir)\Windows\FirstStartup.ps1" -force
|
||||
Write-Host "Done copy FirstRun.ps1"
|
||||
|
||||
Write-Host "Copy link to winutil.ps1 into the ISO"
|
||||
$desktopDir = "$($scratchDir)\Windows\Users\Default\Desktop"
|
||||
New-Item -ItemType Directory -Force -Path "$desktopDir"
|
||||
dism /English /image:$($scratchDir) /set-profilepath:"$($scratchDir)\Windows\Users\Default"
|
||||
|
||||
Write-Host "Copy checkinstall.cmd into the ISO"
|
||||
Microwin-NewCheckInstall
|
||||
Copy-Item "$env:temp\checkinstall.cmd" "$($scratchDir)\Windows\checkinstall.cmd" -force
|
||||
@@ -316,7 +310,6 @@ public class PowerManagement {
|
||||
New-Item -ItemType Directory -Force -Path "$($scratchDir)\Windows\System32\OOBE\BYPASSNRO"
|
||||
|
||||
Write-Host "Loading registry"
|
||||
reg load HKLM\zCOMPONENTS "$($scratchDir)\Windows\System32\config\COMPONENTS"
|
||||
reg load HKLM\zDEFAULT "$($scratchDir)\Windows\System32\config\default"
|
||||
reg load HKLM\zNTUSER "$($scratchDir)\Users\Default\ntuser.dat"
|
||||
reg load HKLM\zSOFTWARE "$($scratchDir)\Windows\System32\config\SOFTWARE"
|
||||
@@ -375,9 +368,8 @@ public class PowerManagement {
|
||||
Write-Host "Disabling Reserved Storage"
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" /v "ShippedWithReserves" /t REG_DWORD /d 0 /f
|
||||
|
||||
Write-Host "Changing theme to dark. This only works on Activated Windows"
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "AppsUseLightTheme" /t REG_DWORD /d 0 /f
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "SystemUsesLightTheme" /t REG_DWORD /d 0 /f
|
||||
Write-Host "Showing file extensions..."
|
||||
reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f
|
||||
|
||||
if ((Microwin-TestCompatibleImage $imgVersion $([System.Version]::new(10,0,21996,1))) -eq $false) {
|
||||
# We're dealing with Windows 10. Configure sane desktop settings. NOTE: even though stuff to disable News and Interests is there,
|
||||
@@ -397,7 +389,6 @@ public class PowerManagement {
|
||||
Write-Error "An unexpected error occurred: $_"
|
||||
} finally {
|
||||
Write-Host "Unmounting Registry..."
|
||||
reg unload HKLM\zCOMPONENTS
|
||||
reg unload HKLM\zDEFAULT
|
||||
reg unload HKLM\zNTUSER
|
||||
reg unload HKLM\zSOFTWARE
|
||||
@@ -406,9 +397,45 @@ public class PowerManagement {
|
||||
Write-Host "Cleaning up image..."
|
||||
dism /English /image:$scratchDir /Cleanup-Image /StartComponentCleanup /ResetBase
|
||||
Write-Host "Cleanup complete."
|
||||
$committed = $false
|
||||
$unmounted = $false
|
||||
|
||||
Write-Host "Saving image..."
|
||||
|
||||
try {
|
||||
Save-WindowsImage -Path "$scratchDir"
|
||||
$committed = $true
|
||||
} catch {
|
||||
do {
|
||||
# we'll prevent stuff inside this loop from throwing exceptions and breaking from the loop.
|
||||
try {
|
||||
Save-WindowsImage -Path "$scratchDir"
|
||||
$committed = $true
|
||||
} catch {
|
||||
Write-Host "Commit operation unsuccessful. Trying again after 3 seconds..."
|
||||
Start-Sleep -Seconds 3
|
||||
}
|
||||
} until ($committed)
|
||||
}
|
||||
|
||||
Write-Host "Unmounting image..."
|
||||
Dismount-WindowsImage -Path "$scratchDir" -Save
|
||||
|
||||
try {
|
||||
# because we've already saved the changes earlier, we can safely discard
|
||||
Dismount-WindowsImage -Discard -Path "$scratchDir"
|
||||
$unmounted = $true
|
||||
} catch {
|
||||
do {
|
||||
# we'll prevent stuff inside this loop from throwing exceptions and breaking from the loop.
|
||||
try {
|
||||
Dismount-WindowsImage -Discard -Path "$scratchDir"
|
||||
$unmounted = $true
|
||||
} catch {
|
||||
Write-Host "Unmount operation unsuccessful. Trying again after 3 seconds..."
|
||||
Start-Sleep -Seconds 3
|
||||
}
|
||||
} until ($unmounted)
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -433,20 +460,6 @@ public class PowerManagement {
|
||||
}
|
||||
Write-Host "Windows image completed. Continuing with boot.wim."
|
||||
|
||||
$esd = $sync.MicroWinESD.IsChecked
|
||||
if ($esd) {
|
||||
Write-Host "Converting install image to ESD."
|
||||
try {
|
||||
Export-WindowsImage -SourceImagePath "$mountDir\sources\install.wim" -SourceIndex $index -DestinationImagePath "$mountDir\sources\install.esd" -CompressionType "Recovery"
|
||||
Remove-Item "$mountDir\sources\install.wim"
|
||||
Write-Host "Converted install image to ESD."
|
||||
} catch {
|
||||
Start-Process -FilePath "$env:SystemRoot\System32\dism.exe" -ArgumentList "/export-image /sourceimagefile:`"$mountDir\sources\install.wim`" /sourceindex:1 /destinationimagefile:`"$mountDir\sources\install.esd`" /compress:recovery" -Wait -NoNewWindow
|
||||
Remove-Item "$mountDir\sources\install.wim"
|
||||
Write-Host "Converted install image to ESD."
|
||||
}
|
||||
}
|
||||
|
||||
# Next step boot image
|
||||
Write-Host "Mounting boot image $mountDir\sources\boot.wim into $scratchDir"
|
||||
Mount-WindowsImage -ImagePath "$mountDir\sources\boot.wim" -Index 2 -Path "$scratchDir"
|
||||
@@ -462,7 +475,6 @@ public class PowerManagement {
|
||||
}
|
||||
|
||||
Write-Host "Loading registry..."
|
||||
reg load HKLM\zCOMPONENTS "$($scratchDir)\Windows\System32\config\COMPONENTS" >$null
|
||||
reg load HKLM\zDEFAULT "$($scratchDir)\Windows\System32\config\default" >$null
|
||||
reg load HKLM\zNTUSER "$($scratchDir)\Users\Default\ntuser.dat" >$null
|
||||
reg load HKLM\zSOFTWARE "$($scratchDir)\Windows\System32\config\SOFTWARE" >$null
|
||||
@@ -480,27 +492,86 @@ public class PowerManagement {
|
||||
reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d 1 /f
|
||||
# Fix Computer Restarted Unexpectedly Error on New Bare Metal Install
|
||||
reg add "HKLM\zSYSTEM\Setup\Status\ChildCompletion" /v "setup.exe" /t REG_DWORD /d 3 /f
|
||||
|
||||
# Force old Setup on 24H2+ WinPE images due to personal preference; it's simply faster and
|
||||
# more reliable than MoSetup. I simply can't stand that new setup system.
|
||||
if ((Microwin-TestCompatibleImage $bootVersion $([System.Version]::new(10,0,26040,0))) -and (Test-Path -Path "$scratchDir\sources\setup.exe" -PathType Leaf)) {
|
||||
reg add "HKLM\zSYSTEM\Setup" /f /v "CmdLine" /t REG_SZ /d "\sources\setup.exe"
|
||||
}
|
||||
} catch {
|
||||
Write-Error "An unexpected error occurred: $_"
|
||||
} finally {
|
||||
Write-Host "Unmounting Registry..."
|
||||
reg unload HKLM\zCOMPONENTS
|
||||
reg unload HKLM\zDEFAULT
|
||||
reg unload HKLM\zNTUSER
|
||||
reg unload HKLM\zSOFTWARE
|
||||
reg unload HKLM\zSYSTEM
|
||||
|
||||
$committed = $false
|
||||
$unmounted = $false
|
||||
|
||||
Write-Host "Saving image..."
|
||||
|
||||
try {
|
||||
Save-WindowsImage -Path "$scratchDir"
|
||||
$committed = $true
|
||||
} catch {
|
||||
do {
|
||||
# we'll prevent stuff inside this loop from throwing exceptions and breaking from the loop.
|
||||
try {
|
||||
Save-WindowsImage -Path "$scratchDir"
|
||||
$committed = $true
|
||||
} catch {
|
||||
Write-Host "Commit operation unsuccessful. Trying again after 3 seconds..."
|
||||
Start-Sleep -Seconds 3
|
||||
}
|
||||
} until ($committed)
|
||||
}
|
||||
|
||||
Write-Host "Unmounting image..."
|
||||
Dismount-WindowsImage -Path "$scratchDir" -Save
|
||||
|
||||
try {
|
||||
# because we've already saved the changes earlier, we can safely discard
|
||||
Dismount-WindowsImage -Discard -Path "$scratchDir"
|
||||
$unmounted = $true
|
||||
} catch {
|
||||
do {
|
||||
# we'll prevent stuff inside this loop from throwing exceptions and breaking from the loop.
|
||||
try {
|
||||
Dismount-WindowsImage -Discard -Path "$scratchDir"
|
||||
$unmounted = $true
|
||||
} catch {
|
||||
Write-Host "Unmount operation unsuccessful. Trying again after 3 seconds..."
|
||||
Start-Sleep -Seconds 3
|
||||
}
|
||||
} until ($unmounted)
|
||||
}
|
||||
|
||||
Write-Host "Creating ISO image"
|
||||
|
||||
$peToolsPath = ""
|
||||
|
||||
$adkKitsRoot = Microwin-GetKitsRoot -wow64environment $false
|
||||
$adkKitsRoot_WOW64Environ = Microwin-GetKitsRoot -wow64environment $true
|
||||
|
||||
$expectedADKPath = "$($adkKitsRoot)Assessment and Deployment Kit"
|
||||
$expectedADKPath_WOW64Environ = "$($adkKitsRoot_WOW64Environ)Assessment and Deployment Kit"
|
||||
|
||||
# if we downloaded oscdimg from github it will be in the temp directory so use it
|
||||
# if it is not in temp it is part of ADK and is in global PATH so just set it to oscdimg.exe
|
||||
$oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe'
|
||||
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
|
||||
if (!$oscdImgFound) {
|
||||
$oscdimgPath = "oscdimg.exe"
|
||||
$oscdImgFound = Test-Path -Path "$oscdimgPath" -PathType Leaf
|
||||
if ((-not ($oscdImgFound)) -and ((Microwin-TestKitsRootPaths -adkKitsRootPath "$expectedADKPath" -adkKitsRootPath_WOW64Environ "$expectedADKPath_WOW64Environ") -eq $true)) {
|
||||
if ($expectedADKPath -ne "Assessment and Deployment Kit") { $peToolsPath = $expectedADKPath }
|
||||
if (($peToolsPath -eq "") -and ($expectedADKPath_WOW64Environ -ne "Assessment and Deployment Kit")) { $peToolsPath = $expectedADKPath_WOW64Environ }
|
||||
|
||||
Write-Host "Using $peToolsPath as the Preinstallation Environment tools path..."
|
||||
# Paths change depending on platform
|
||||
if ([Environment]::Is64BitOperatingSystem) {
|
||||
$oscdimgPath = "$peToolsPath\Deployment Tools\amd64\Oscdimg\oscdimg.exe"
|
||||
} else {
|
||||
$oscdimgPath = "$peToolsPath\Deployment Tools\x86\Oscdimg\oscdimg.exe"
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "[INFO] Using oscdimg.exe from: $oscdimgPath"
|
||||
@@ -511,12 +582,6 @@ public class PowerManagement {
|
||||
|
||||
Write-Host "OSCDIMG Error Level : $($oscdimgProc.ExitCode)"
|
||||
|
||||
if ($copyToUSB) {
|
||||
Write-Host "Copying target ISO to the USB drive"
|
||||
Microwin-CopyToUSB("$($SaveDialog.FileName)")
|
||||
if ($?) { Write-Host "Done Copying target ISO to USB drive!" } else { Write-Host "ISO copy failed." }
|
||||
}
|
||||
|
||||
Write-Host " _____ "
|
||||
Write-Host "(____ \ "
|
||||
Write-Host " _ \ \ ___ ____ ____ "
|
||||
|
||||
@@ -122,46 +122,60 @@ function Invoke-MicrowinGetIso {
|
||||
Set-WinUtilTaskbaritem -state "Indeterminate" -overlay "logo"
|
||||
Invoke-MicrowinBusyInfo -action "wip" -message "Checking system requirements..." -interactive $false
|
||||
|
||||
$adkKitsRoot = Microwin-GetKitsRoot -wow64environment $false
|
||||
$adkKitsRoot_WOW64Environ = Microwin-GetKitsRoot -wow64environment $true
|
||||
|
||||
$expectedADKPath = "$($adkKitsRoot)Assessment and Deployment Kit"
|
||||
$expectedADKPath_WOW64Environ = "$($adkKitsRoot_WOW64Environ)Assessment and Deployment Kit"
|
||||
|
||||
$oscdimgPath = Join-Path $env:TEMP 'oscdimg.exe'
|
||||
$oscdImgFound = [bool] (Get-Command -ErrorAction Ignore -Type Application oscdimg.exe) -or (Test-Path $oscdimgPath -PathType Leaf)
|
||||
$oscdImgFound = [bool] (Microwin-TestKitsRootPaths -adkKitsRootPath "$expectedADKPath" -adkKitsRootPath_WOW64Environ "$expectedADKPath_WOW64Environ") -or (Test-Path $oscdimgPath -PathType Leaf)
|
||||
Write-Host "oscdimg.exe on system: $oscdImgFound"
|
||||
|
||||
if (!$oscdImgFound) {
|
||||
$downloadFromGitHub = $sync.WPFMicrowinDownloadFromGitHub.IsChecked
|
||||
|
||||
if (!$downloadFromGitHub) {
|
||||
# only show the message to people who did check the box to download from github, if you check the box
|
||||
# you consent to downloading it, no need to show extra dialogs
|
||||
[System.Windows.MessageBox]::Show("oscdimg.exe is not found on the system, winutil will now attempt do download and install it using choco. This might take a long time.")
|
||||
# the step below needs choco to download oscdimg
|
||||
# Install Choco if not already present
|
||||
Install-WinUtilChoco
|
||||
$chocoFound = [bool] (Get-Command -ErrorAction Ignore -Type Application choco)
|
||||
Write-Host "choco on system: $chocoFound"
|
||||
if (!$chocoFound) {
|
||||
[System.Windows.MessageBox]::Show("choco.exe is not found on the system, you need choco to download oscdimg.exe")
|
||||
if (-not ($oscdImgFound)) {
|
||||
# First we try to grab it from github, if not, run the ADK installer.
|
||||
if ((Microwin-GetOscdimg -oscdimgPath $oscdimgPath) -eq $true) {
|
||||
Write-Host "OSCDIMG download succeeded."
|
||||
} else {
|
||||
Write-Host "OSCDIMG could not be downloaded from GitHub. Downloading deployment tools..."
|
||||
if (-not (Microwin-GetAdkDeploymentTools)) {
|
||||
Invoke-MicrowinBusyInfo -action "warning" -message "Neither OSCDIMG nor ADK could be downloaded."
|
||||
Write-Host "Neither OSCDIMG nor ADK could be downloaded."
|
||||
return
|
||||
}
|
||||
|
||||
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install windows-adk-oscdimg"
|
||||
$msg = "oscdimg is installed, now close, reopen PowerShell terminal and re-launch winutil.ps1"
|
||||
} else {
|
||||
$msg = "ADK/OSCDIMG is installed, now restart this process."
|
||||
Invoke-MicrowinBusyInfo -action "done" -message $msg # We set it to done because it immediately returns from this function
|
||||
[System.Windows.MessageBox]::Show($msg)
|
||||
Remove-Item -Path "$env:TEMP\adksetup.exe" -Force -ErrorAction SilentlyContinue
|
||||
return
|
||||
} else {
|
||||
[System.Windows.MessageBox]::Show("oscdimg.exe is not found on the system, winutil will now attempt do download and install it from github. This might take a long time.")
|
||||
Invoke-MicrowinBusyInfo -action "wip" -message "Downloading oscdimg.exe..." -interactive $false
|
||||
Microwin-GetOscdimg -oscdimgPath $oscdimgPath
|
||||
$oscdImgFound = Test-Path $oscdimgPath -PathType Leaf
|
||||
if (!$oscdImgFound) {
|
||||
$msg = "oscdimg was not downloaded can not proceed"
|
||||
Invoke-MicrowinBusyInfo -action "warning" -message $msg
|
||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error)
|
||||
return
|
||||
} else {
|
||||
Write-Host "oscdimg.exe was successfully downloaded from github"
|
||||
}
|
||||
}
|
||||
} elseif (Microwin-TestKitsRootPaths -adkKitsRootPath "$expectedADKPath" -adkKitsRootPath_WOW64Environ "$expectedADKPath_WOW64Environ") {
|
||||
# We have to guess where oscdimg is. We'll check both values...
|
||||
$peToolsPath = ""
|
||||
|
||||
if ($expectedADKPath -ne "Assessment and Deployment Kit") { $peToolsPath = $expectedADKPath }
|
||||
if (($peToolsPath -eq "") -and ($expectedADKPath_WOW64Environ -ne "Assessment and Deployment Kit")) { $peToolsPath = $expectedADKPath_WOW64Environ }
|
||||
|
||||
Write-Host "Using $peToolsPath as the Preinstallation Environment tools path..."
|
||||
# Paths change depending on platform
|
||||
if ([Environment]::Is64BitOperatingSystem) {
|
||||
$oscdimgPath = "$peToolsPath\Deployment Tools\amd64\Oscdimg\oscdimg.exe"
|
||||
} else {
|
||||
$oscdimgPath = "$peToolsPath\Deployment Tools\x86\Oscdimg\oscdimg.exe"
|
||||
}
|
||||
|
||||
# If it's a non-existent file, we won't continue.
|
||||
if (-not (Test-Path -Path "$oscdimgPath" -PathType Leaf)) {
|
||||
$oscdimgFound = $false
|
||||
}
|
||||
}
|
||||
|
||||
$oscdImgFound = [bool] (Microwin-TestKitsRootPaths -adkKitsRootPath "$expectedADKPath" -adkKitsRootPath_WOW64Environ "$expectedADKPath_WOW64Environ") -or (Test-Path $oscdimgPath -PathType Leaf)
|
||||
|
||||
if (-not ($oscdimgFound)) {
|
||||
[System.Windows.MessageBox]::Show("oscdimg.exe is not found on the system. Cannot continue.")
|
||||
return
|
||||
}
|
||||
|
||||
Invoke-MicrowinBusyInfo -action "wip" -message "Checking disk space..." -interactive $false
|
||||
@@ -209,23 +223,6 @@ function Invoke-MicrowinGetIso {
|
||||
# there is probably a better way of doing this, I don't have time to figure this out
|
||||
$sync.MicrowinIsoDrive.Text = $driveLetter
|
||||
|
||||
$mountedISOPath = (Split-Path -Path "$filePath")
|
||||
if ($sync.MicrowinScratchDirBox.Text.Trim() -eq "Scratch") {
|
||||
$sync.MicrowinScratchDirBox.Text =""
|
||||
}
|
||||
|
||||
$UseISOScratchDir = $sync.WPFMicrowinISOScratchDir.IsChecked
|
||||
|
||||
if ($UseISOScratchDir) {
|
||||
$sync.MicrowinScratchDirBox.Text=$mountedISOPath
|
||||
}
|
||||
|
||||
if( -Not $sync.MicrowinScratchDirBox.Text.EndsWith('\') -And $sync.MicrowinScratchDirBox.Text.Length -gt 1) {
|
||||
|
||||
$sync.MicrowinScratchDirBox.Text = Join-Path $sync.MicrowinScratchDirBox.Text.Trim() '\'
|
||||
|
||||
}
|
||||
|
||||
# Detect if the folders already exist and remove them
|
||||
if (($sync.MicrowinMountDir.Text -ne "") -and (Test-Path -Path $sync.MicrowinMountDir.Text)) {
|
||||
try {
|
||||
@@ -244,13 +241,8 @@ function Invoke-MicrowinGetIso {
|
||||
$randomMicrowinScratch = "MicrowinScratch_${timestamp}_${randomNumber}"
|
||||
$sync.BusyText.Text=" - Mounting"
|
||||
Write-Host "Mounting Iso. Please wait."
|
||||
if ($sync.MicrowinScratchDirBox.Text -eq "") {
|
||||
$mountDir = Join-Path $env:TEMP $randomMicrowin
|
||||
$scratchDir = Join-Path $env:TEMP $randomMicrowinScratch
|
||||
} else {
|
||||
$scratchDir = $sync.MicrowinScratchDirBox.Text+"Scratch"
|
||||
$mountDir = $sync.MicrowinScratchDirBox.Text+"micro"
|
||||
}
|
||||
|
||||
$sync.MicrowinMountDir.Text = $mountDir
|
||||
$sync.MicrowinScratchDir.Text = $scratchDir
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
function Microwin-CopyToUSB([string]$fileToCopy) {
|
||||
foreach ($volume in Get-Volume) {
|
||||
if ($volume -and $volume.FileSystemLabel -ieq "ventoy") {
|
||||
$destinationPath = "$($volume.DriveLetter):\"
|
||||
#Copy-Item -Path $fileToCopy -Destination $destinationPath -Force
|
||||
# Get the total size of the file
|
||||
$totalSize = (Get-Item "$fileToCopy").length
|
||||
|
||||
Copy-Item -Path "$fileToCopy" -Destination "$destinationPath" -Verbose -Force -Recurse -Container -PassThru |
|
||||
ForEach-Object {
|
||||
# Calculate the percentage completed
|
||||
$completed = ($_.BytesTransferred / $totalSize) * 100
|
||||
|
||||
# Display the progress bar
|
||||
Write-Progress -Activity "Copying File" -Status "Progress" -PercentComplete $completed -CurrentOperation ("{0:N2} MB / {1:N2} MB" -f ($_.BytesTransferred / 1MB), ($totalSize / 1MB))
|
||||
}
|
||||
|
||||
Write-Host "File copied to Ventoy drive $($volume.DriveLetter)"
|
||||
|
||||
# Detect if config files are present, move them if they are, and configure the Ventoy drive to not bypass the requirements
|
||||
$customVentoyConfig = @'
|
||||
{
|
||||
"control":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
],
|
||||
"control_legacy":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
],
|
||||
"control_uefi":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
],
|
||||
"control_ia32":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
],
|
||||
"control_aa64":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
],
|
||||
"control_mips":[
|
||||
{ "VTOY_WIN11_BYPASS_CHECK": "0" },
|
||||
{ "VTOY_WIN11_BYPASS_NRO": "0" }
|
||||
]
|
||||
}
|
||||
'@
|
||||
|
||||
try {
|
||||
Write-Host "Writing custom Ventoy configuration. Please wait..."
|
||||
if (Test-Path -Path "$($volume.DriveLetter):\ventoy\ventoy.json" -PathType Leaf) {
|
||||
Write-Host "A Ventoy configuration file exists. Moving it..."
|
||||
Move-Item -Path "$($volume.DriveLetter):\ventoy\ventoy.json" -Destination "$($volume.DriveLetter):\ventoy\ventoy.json.old" -Force
|
||||
Write-Host "Existing Ventoy configuration has been moved to `"ventoy.json.old`". Feel free to put your config back into the `"ventoy.json`" file."
|
||||
}
|
||||
if (-not (Test-Path -Path "$($volume.DriveLetter):\ventoy")) {
|
||||
New-Item -Path "$($volume.DriveLetter):\ventoy" -ItemType Directory -Force | Out-Null
|
||||
}
|
||||
$customVentoyConfig | Out-File -FilePath "$($volume.DriveLetter):\ventoy\ventoy.json" -Encoding utf8 -Force
|
||||
Write-Host "The Ventoy drive has been successfully configured."
|
||||
} catch {
|
||||
Write-Host "Could not configure Ventoy drive. Error: $($_.Exception.Message)`n"
|
||||
Write-Host "Be sure to add the following configuration to the Ventoy drive by either creating a `"ventoy.json`" file in the `"ventoy`" directory (create it if it doesn't exist) or by editing an existing one: `n`n$customVentoyConfig`n"
|
||||
Write-Host "Failure to do this will cause conflicts with your target ISO file."
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
Write-Host "Ventoy USB Key is not inserted"
|
||||
}
|
||||
25
functions/microwin/Microwin-GetAdkDeploymentTools.ps1
Normal file
25
functions/microwin/Microwin-GetAdkDeploymentTools.ps1
Normal file
@@ -0,0 +1,25 @@
|
||||
function Microwin-GetAdkDeploymentTools {
|
||||
<#
|
||||
.DESCRIPTION
|
||||
This function will download the deployment tools from Microsoft
|
||||
|
||||
.EXAMPLE
|
||||
Microwin-GetAdkDeploymentTools
|
||||
#>
|
||||
|
||||
# ADK 10.1.28000.1 download link is the same; no need to guess it
|
||||
$adkDownloadLink = "https://download.microsoft.com/download/615540bc-be0b-433a-b91b-1f2b0642bb24/adk/adksetup.exe"
|
||||
$adkVersion = "10.1.28000.1"
|
||||
Write-Host "Downloading ADK version $adkVersion ..."
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "$adkDownloadLink" -OutFile "$env:TEMP\adksetup.exe"
|
||||
|
||||
if ((-not ($?)) -or (-not (Test-Path -Path "$env:TEMP\adksetup.exe" -PathType Leaf))) {
|
||||
Write-Host "ADK could not be downloaded."
|
||||
return $false
|
||||
}
|
||||
|
||||
Write-Host "Installing ADK version $adkVersion -- This may take a few minutes..."
|
||||
Start-Process -FilePath "$env:TEMP\adksetup.exe" -ArgumentList "/features OptionId.DeploymentTools /q /ceip off" -Wait
|
||||
|
||||
return $?
|
||||
}
|
||||
40
functions/microwin/Microwin-GetKitsRoot.ps1
Normal file
40
functions/microwin/Microwin-GetKitsRoot.ps1
Normal file
@@ -0,0 +1,40 @@
|
||||
function Microwin-GetKitsRoot {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gets the kits root path for the Windows Assessment and Deployment Kit (ADK)
|
||||
.PARAMETER wow64environment
|
||||
Determines whether to search in a WOW64 compatibility environment (HKLM\SOFTWARE\WOW6432Node)
|
||||
.OUTPUTS
|
||||
The path to the kits root
|
||||
#>
|
||||
|
||||
param (
|
||||
[Parameter(Mandatory = $true, Position = 0)] [bool]$wow64environment
|
||||
)
|
||||
|
||||
$adk10KitsRoot = ""
|
||||
|
||||
# if we set the wow64 bit on and we're on a 32-bit system, then we prematurely return the value
|
||||
if (($wow64environment -eq $true) -and (-not [Environment]::Is64BitOperatingSystem)) {
|
||||
return $adk10KitsRoot
|
||||
}
|
||||
|
||||
$regPath = ""
|
||||
if ($wow64environment) {
|
||||
$regPath = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows Kits\Installed Roots"
|
||||
} else {
|
||||
$regPath = "HKLM:\SOFTWARE\Microsoft\Windows Kits\Installed Roots"
|
||||
}
|
||||
|
||||
if ((Test-Path "$regPath") -eq $false) {
|
||||
return $adk10KitsRoot
|
||||
}
|
||||
|
||||
try {
|
||||
$adk10KitsRoot = Get-ItemPropertyValue -Path $regPath -Name "KitsRoot10" -ErrorAction Stop
|
||||
} catch {
|
||||
Write-Debug "Could not find ADK."
|
||||
}
|
||||
|
||||
return $adk10KitsRoot
|
||||
}
|
||||
@@ -15,6 +15,10 @@ function Microwin-GetOscdimg {
|
||||
$oscdimgPath = "$env:TEMP\oscdimg.exe"
|
||||
$downloadUrl = "https://github.com/ChrisTitusTech/winutil/raw/main/releases/oscdimg.exe"
|
||||
Invoke-RestMethod -Uri $downloadUrl -OutFile $oscdimgPath
|
||||
if (-not (Test-Path "$oscdimgPath" -PathType Leaf)) {
|
||||
Write-Host "OSCDIMG could not be downloaded."
|
||||
return $false
|
||||
}
|
||||
$hashResult = Get-FileHash -Path $oscdimgPath -Algorithm SHA256
|
||||
$sha256Hash = $hashResult.Hash
|
||||
|
||||
@@ -23,7 +27,9 @@ function Microwin-GetOscdimg {
|
||||
$expectedHash = "AB9E161049D293B544961BFDF2D61244ADE79376D6423DF4F60BF9B147D3C78D" # Replace with the actual expected hash
|
||||
if ($sha256Hash -eq $expectedHash) {
|
||||
Write-Host "Hashes match. File is verified."
|
||||
return $true
|
||||
} else {
|
||||
Write-Host "Hashes do not match. File may be corrupted or tampered with."
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,11 @@ function Microwin-NewFirstRun {
|
||||
|
||||
}
|
||||
|
||||
if ((Get-BitLockerVolume -MountPoint $Env:SystemDrive).ProtectionStatus -eq 'On') {
|
||||
Write-Host "Disabling BitLocker..."
|
||||
Disable-BitLocker -MountPoint $Env:SystemDrive
|
||||
}
|
||||
|
||||
# Get BCD entries and set bootmgr timeout accordingly
|
||||
try
|
||||
{
|
||||
@@ -103,6 +108,35 @@ function Microwin-NewFirstRun {
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Start" /v ShowRecentList /t REG_DWORD /d 0 /f
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Start_TrackDocs /t REG_DWORD /d 0 /f
|
||||
|
||||
# Color Modes -- requires sending messages to apply to everything
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "AppsUseLightTheme" /t REG_DWORD /d 0 /f
|
||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" /v "SystemUsesLightTheme" /t REG_DWORD /d 0 /f
|
||||
|
||||
# Send the WM_SETTINGCHANGE message to all windows
|
||||
Add-Type -TypeDefinition @"
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
public class Win32 {
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
|
||||
public static extern IntPtr SendMessageTimeout(
|
||||
IntPtr hWnd,
|
||||
uint Msg,
|
||||
IntPtr wParam,
|
||||
string lParam,
|
||||
uint fuFlags,
|
||||
uint uTimeout,
|
||||
out IntPtr lpdwResult);
|
||||
}
|
||||
"@
|
||||
|
||||
$HWND_BROADCAST = [IntPtr]0xffff
|
||||
$WM_SETTINGCHANGE = 0x1A
|
||||
$SMTO_ABORTIFHUNG = 0x2
|
||||
$timeout = 100
|
||||
|
||||
# Send the broadcast message to all windows
|
||||
[Win32]::SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, [IntPtr]::Zero, "ImmersiveColorSet", $SMTO_ABORTIFHUNG, $timeout, [ref]([IntPtr]::Zero))
|
||||
|
||||
Clear-Host
|
||||
Write-Host "The taskbar will take around a minute to show up, but you can start using your computer now. Try pressing the Windows key to open the Start menu, or Windows + E to launch File Explorer."
|
||||
Start-Sleep -Seconds 10
|
||||
|
||||
11
functions/microwin/Microwin-TestKitsRootPaths.ps1
Normal file
11
functions/microwin/Microwin-TestKitsRootPaths.ps1
Normal file
@@ -0,0 +1,11 @@
|
||||
function Microwin-TestKitsRootPaths {
|
||||
param (
|
||||
[Parameter(Mandatory = $true, Position = 0)] [string]$adkKitsRootPath,
|
||||
[Parameter(Mandatory = $true, Position = 1)] [string]$adkKitsRootPath_WOW64Environ
|
||||
)
|
||||
|
||||
if (Test-Path "$adkKitsRootPath") { return $true }
|
||||
if (Test-Path "$adkKitsRootPath_WOW64Environ") { return $true }
|
||||
|
||||
return $false
|
||||
}
|
||||
@@ -39,9 +39,9 @@ Function Install-WinUtilProgramWinget {
|
||||
|
||||
$commonArguments = "--id $wingetId --silent"
|
||||
$arguments = if ($Action -eq "Install") {
|
||||
"install $commonArguments --accept-source-agreements --accept-package-agreements"
|
||||
"install $commonArguments --accept-source-agreements --accept-package-agreements --source winget"
|
||||
} else {
|
||||
"uninstall $commonArguments"
|
||||
"uninstall $commonArguments --source winget"
|
||||
}
|
||||
|
||||
$processParams = @{
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
function Invoke-ScratchDialog {
|
||||
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Enable Editable Text box Alternate Scratch path
|
||||
|
||||
.PARAMETER Button
|
||||
#>
|
||||
$sync.WPFMicrowinISOScratchDir.IsChecked
|
||||
|
||||
|
||||
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
|
||||
$Dialog = New-Object System.Windows.Forms.FolderBrowserDialog
|
||||
$Dialog.SelectedPath = $sync.MicrowinScratchDirBox.Text
|
||||
$Dialog.ShowDialog()
|
||||
$filePath = $Dialog.SelectedPath
|
||||
Write-Host "No ISO is chosen+ $filePath"
|
||||
|
||||
if ([string]::IsNullOrEmpty($filePath)) {
|
||||
Write-Host "No Folder had chosen"
|
||||
return
|
||||
}
|
||||
|
||||
$sync.MicrowinScratchDirBox.Text = Join-Path $filePath "\"
|
||||
|
||||
}
|
||||
@@ -59,7 +59,6 @@ function Invoke-WPFButton {
|
||||
"WPFGetIso" {Invoke-MicrowinGetIso}
|
||||
"WPFMicrowin" {Invoke-Microwin}
|
||||
"WPFCloseButton" {Invoke-WPFCloseButton}
|
||||
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
|
||||
"WPFWinUtilInstallPSProfile" {Invoke-WinUtilInstallPSProfile}
|
||||
"WPFWinUtilUninstallPSProfile" {Invoke-WinUtilUninstallPSProfile}
|
||||
"WPFWinUtilSSHServer" {Invoke-WPFSSHServer}
|
||||
|
||||
7
functions/public/Invoke-WinUtilRemoveEdge.ps1
Normal file
7
functions/public/Invoke-WinUtilRemoveEdge.ps1
Normal file
@@ -0,0 +1,7 @@
|
||||
function Invoke-WinUtilRemoveEdge {
|
||||
Write-Host "Unlocking The Offical Edge Uninstaller And Removing Microsoft Edge..."
|
||||
|
||||
$Path = (Get-ChildItem "C:\Program Files (x86)\Microsoft\Edge\Application\*\Installer\setup.exe")[0].FullName
|
||||
New-Item "C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe" -Force
|
||||
Start-Process $Path -ArgumentList '--uninstall --system-level --force-uninstall --delete-profile'
|
||||
}
|
||||
@@ -1289,7 +1289,7 @@
|
||||
Foreground="{DynamicResource MainForegroundColor}">
|
||||
<Run FontWeight="Bold">Balanced Security Configuration</Run>
|
||||
<LineBreak/>
|
||||
- Feature updates delayed by 2 years
|
||||
- Feature updates delayed by 365 days
|
||||
<LineBreak/>
|
||||
- Security updates installed after 4 days
|
||||
<LineBreak/><LineBreak/>
|
||||
@@ -1350,41 +1350,11 @@
|
||||
HorizontalAlignment="Stretch">
|
||||
<StackPanel Name="MicrowinMain" Background="{DynamicResource MainBackgroundColor}" SnapsToDevicePixels="True" Grid.Column="0" Grid.Row="0">
|
||||
<StackPanel Name="MicrowinISOPanel" Background="Transparent" SnapsToDevicePixels="True" Margin="1">
|
||||
<CheckBox x:Name="WPFMicrowinDownloadFromGitHub" Content="Download oscdimg.exe from CTT GitHub repo" IsChecked="True" Margin="{DynamicResource MicrowinCheckBoxMargin}" />
|
||||
<TextBlock Margin="5" Padding="1" TextWrapping="Wrap" Foreground="{DynamicResource ComboBoxForegroundColor}">
|
||||
Choose a Windows ISO file that you've downloaded <LineBreak/>
|
||||
Check the status in the console
|
||||
</TextBlock>
|
||||
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||
<TextBlock Margin="5" Padding="1" TextWrapping="Wrap" Foreground="{DynamicResource ComboBoxForegroundColor}" ToolTip="Scratch directories act as a custom destination for image files"><Bold>Scratch directory settings (optional)</Bold></TextBlock>
|
||||
<CheckBox x:Name="WPFMicrowinISOScratchDir" Content="Use ISO directory for ScratchDir " IsChecked="False" Margin="{DynamicResource MicrowinCheckBoxMargin}"
|
||||
ToolTip="Check this to use the path of the ISO file you specify as a scratch directory" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" /> <!-- Takes the remaining space -->
|
||||
<ColumnDefinition Width="30" /> <!-- Fixed width for Button -->
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Name="MicrowinScratchDirBox" Background="Transparent" BorderBrush="{DynamicResource MainForegroundColor}"
|
||||
Text="Scratch"
|
||||
Margin="2"
|
||||
IsReadOnly="False"
|
||||
ToolTip="Specify an alternate path for the scratch directory"
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource LabelboxForegroundColor}">
|
||||
</TextBox>
|
||||
<Button Name="MicrowinScratchDirBT"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
Grid.Column="1"
|
||||
Margin="2"
|
||||
Padding="1" VerticalAlignment="Center">
|
||||
<Button.Content>
|
||||
...
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||
<TextBox Name="MicrowinFinalIsoLocation" Background="Transparent" BorderBrush="{DynamicResource MainForegroundColor}"
|
||||
Text="ISO location will be printed here"
|
||||
Margin="2"
|
||||
@@ -1458,8 +1428,6 @@
|
||||
<CheckBox Name="MicrowinImportDrivers" Content="Import drivers from current system" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="Export all third-party drivers from your system and inject them to the MicroWin image"/>
|
||||
<CheckBox Name="MicrowinCopyVirtIO" Content="Include VirtIO drivers" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="Copy VirtIO Guest Tools drivers to your ISO file. Check this only if you want to use it on QEMU/Proxmox VE"/>
|
||||
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||
<CheckBox Name="WPFMicrowinCopyToUsb" Content="Copy to Ventoy" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="Copy to USB disk with a label Ventoy"/>
|
||||
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap"><Bold>Custom user settings (leave empty for default user)</Bold></TextBlock>
|
||||
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">User name (20 characters max.):</TextBlock>
|
||||
<TextBox Name="MicrowinUserName" Background="Transparent" BorderThickness="1" BorderBrush="{DynamicResource MainForegroundColor}"
|
||||
@@ -1477,11 +1445,6 @@
|
||||
Foreground="{DynamicResource LabelboxForegroundColor}"
|
||||
/>
|
||||
<Rectangle Fill="{DynamicResource MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap"><Bold>Tweaks (leave empty for default settings)</Bold></TextBlock>
|
||||
<CheckBox Name="MicroWinWPBT" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="If enabled then allows your computer vendor to execute a program each time it boots. It enables computer vendors to force install anti-theft software, software drivers, or a software program conveniently. This could also be a security risk."><AccessText TextWrapping="Wrap" Text="Disable Windows Platform Binary Table (WPBT) (ADVANCED TWEAK)" /></CheckBox>
|
||||
<CheckBox Name="MicroWinUnsupported" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="If enabled then it will allow you to upgrade your PC to Windows 11 if your PC does not support Windows 11 yet. This is good for if you do not have a USB and want to upgrade to Windows 11 on unsupported hardware."><AccessText TextWrapping="Wrap" Text="Allow this PC to upgrade to Windows 11" /></CheckBox>
|
||||
<CheckBox Name="MicroWinESD" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="The ESD file format compresses the installation image even further, therefore reducing ISO file sizes a little more. Select this if you have a small USB."><AccessText TextWrapping="Wrap" Text="Convert this image to ESD (This will take longer)" /></CheckBox>
|
||||
<CheckBox Name="MicroWinNoFLA" Margin="{DynamicResource MicrowinCheckBoxMargin}" IsChecked="True" ToolTip="The First Logon Animation is an animation that is played when a user logs on for the first time. It can artificially increase wait times. Select this option to automatically close the first logon animation and reach the desktop quicker (additional system preparation will still be done)"><AccessText TextWrapping="Wrap" Text="Skip First Logon Animation" /></CheckBox>
|
||||
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">WinUtil configuration file (JSON)</TextBlock>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -1564,34 +1527,21 @@
|
||||
<Bold>MicroWin features:</Bold><LineBreak/>
|
||||
- Remove Telemetry and Tracking <LineBreak/>
|
||||
- Fast Install using either the "User" local account or the account of your choosing <LineBreak/>
|
||||
- Bypasses Windows 11 System Requirements on unsupported computers <LineBreak/>
|
||||
- No internet requirement for install <LineBreak/>
|
||||
- Apps debloat <LineBreak/>
|
||||
<LineBreak/>
|
||||
<LineBreak/>
|
||||
|
||||
<Bold>INSTRUCTIONS</Bold> <LineBreak/>
|
||||
- Download a Windows 11 ISO through the following options: <LineBreak/>
|
||||
<TextBlock Margin="15,0,0,0" Text="- Select your own ISO: Manually download the latest Windows 11 image from " Foreground="{DynamicResource ComboBoxForegroundColor}"/>
|
||||
<TextBlock Name="Win11DownloadLink" Style="{StaticResource HoverTextBlockStyle}" ToolTip="https://www.microsoft.com/software-download/windows11">Microsoft</TextBlock>. <LineBreak/>
|
||||
<TextBlock Margin="15,0,0,0" Text="- Get newest ISO automatically: Choose Windows 11 Edition and preferred language." Foreground="{DynamicResource ComboBoxForegroundColor}"/> <LineBreak/>
|
||||
May take several minutes to process the ISO depending on your machine and connection <LineBreak/>
|
||||
- Put it somewhere on the C:\ drive so it is easily accessible <LineBreak/>
|
||||
- Launch WinUtil and MicroWin <LineBreak/>
|
||||
- Click on the "Get Windows ISO" button and wait for WinUtil to process the image <LineBreak/>
|
||||
It will be processed and unpacked which may take some time <LineBreak/>
|
||||
- Once complete, choose which Windows flavor you want to base your image on <LineBreak/>
|
||||
- Click the "Start Process" button <LineBreak/>
|
||||
The process of creating the Windows image may take some time, please check the console and wait for it to say "Done" <LineBreak/>
|
||||
- Once complete, the target ISO file will be in the directory you have specified <LineBreak/>
|
||||
- Copy this image to your Ventoy USB Stick, boot to this image, gg
|
||||
<LineBreak/>
|
||||
If you are injecting drivers ensure you put all your inf, sys, and dll files for each driver into a separate directory <LineBreak/><LineBreak/>
|
||||
<Bold>Installing VirtIO drivers</Bold><LineBreak/>
|
||||
If you plan on using your ISO on QEMU/Proxmox VE, you can bundle VirtIO drivers with your ISO to automatically install drivers. Simply tick the "Include VirtIO drivers" checkbox before starting the process. Then, follow these instructions:<LineBreak/><LineBreak/>
|
||||
<TextBlock TextWrapping="WrapWithOverflow" Margin="15,0,0,0" Text="1. Proceed with Setup until you reach the disk selection screen, in which you won't see any drives" Foreground="{DynamicResource ComboBoxForegroundColor}"/><LineBreak/>
|
||||
<TextBlock TextWrapping="WrapWithOverflow" Margin="15,0,0,0" Text="2. Click "Load Driver" and click Browse" Foreground="{DynamicResource ComboBoxForegroundColor}"/><LineBreak/>
|
||||
<TextBlock TextWrapping="WrapWithOverflow" Margin="15,0,0,0" Text="3. In the folder selection dialog, point to this path: "D:\VirtIO\vioscsi\w11\amd64" (replace amd64 with ARM64 if you are using Windows on ARM, and "D:" with the drive letter of the ISO)" Foreground="{DynamicResource ComboBoxForegroundColor}"/><LineBreak/>
|
||||
<TextBlock TextWrapping="WrapWithOverflow" Margin="15,0,0,0" Text="4. Select all drivers that will appear in the list box and click OK" Foreground="{DynamicResource ComboBoxForegroundColor}"/><LineBreak/>
|
||||
1. Download Windows 11 ISO from <TextBlock Name="Win11DownloadLink" Style="{StaticResource HoverTextBlockStyle}" ToolTip="https://www.microsoft.com/software-download/windows11">Microsoft</TextBlock> directly, or use the "Get newest ISO" option and select your preferred language.<LineBreak/>
|
||||
2. Click "Get Windows ISO" then select your Windows ISO (may take several minutes depending on your machine and connection)<LineBreak/>
|
||||
3. Select Windows flavor > Click "Start Process" (may take time, check the console and wait for the "Done" message to appear)<LineBreak/>
|
||||
4. Finally, write the ISO to a USB drive using your preferred method and boot.<LineBreak/><LineBreak/>
|
||||
<Bold>Driver Injection:</Bold> <LineBreak/>
|
||||
Organize drivers in separate folders with .inf, .sys, and .dll files for each device <LineBreak/><LineBreak/>
|
||||
<Bold>VirtIO Drivers (QEMU/Proxmox):</Bold><LineBreak/>
|
||||
Check "Include VirtIO drivers" before starting. During setup, select Load Driver > Browse to D:\VirtIO\vioscsi\w11\amd64 (use ARM64 for Windows on ARM) > Select all drivers and click OK<LineBreak/>
|
||||
</TextBlock>
|
||||
<TextBlock Margin="15,0,15,15"
|
||||
Padding = "1"
|
||||
|
||||
Reference in New Issue
Block a user