mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-01 10:32:35 -05:00
Compare commits
83 Commits
f63c312f22
...
revert-266
Author | SHA1 | Date | |
---|---|---|---|
1da39b1717 | |||
8e5fcceddb | |||
19a3c7070a | |||
343a72f528 | |||
0b13ca4b11 | |||
215de06a58 | |||
80555d945e | |||
314588283a | |||
00668755c9 | |||
d3ef94f175 | |||
1ac24c236e | |||
ff363d686f | |||
9abe11c975 | |||
14d20cd161 | |||
2b9b1b026c | |||
e9a45a002f | |||
6d996495a3 | |||
473f04ddc5 | |||
95db85f791 | |||
5059b93cd7 | |||
380e1e73a6 | |||
ad37371492 | |||
1bfd8bddcc | |||
6ad31edef1 | |||
c1009c3d7c | |||
885108df7e | |||
b21bc35443 | |||
e2d539048d | |||
588008612d | |||
859a733740 | |||
3bb1881254 | |||
8b37420eec | |||
af7528a60b | |||
0c6b2adb91 | |||
0635145896 | |||
2d751f4e8c | |||
9b9d0c58f5 | |||
531cb4c63c | |||
42bda0dc47 | |||
3414a3eee1 | |||
a4302742b3 | |||
2a0d121cf0 | |||
a397f20ac6 | |||
bddf57bcee | |||
2b3f1a811d | |||
2af864f7ab | |||
2b8592a50a | |||
aad0356c28 | |||
01515db90f | |||
2ba5572b6c | |||
7e1c593510 | |||
b6141808af | |||
a21845327b | |||
2a355c00c8 | |||
2d3dbe4f6a | |||
d315963693 | |||
6c82adbdc9 | |||
c1dd88d84a | |||
b67ec35cbb | |||
c45f36d58f | |||
1fc79bccf2 | |||
2b7d0b6c4b | |||
42061faa81 | |||
889ec8f57d | |||
be6b5b3aa0 | |||
90ddfb02a4 | |||
ece57f8ee2 | |||
6a99be9e05 | |||
488cd8dd98 | |||
7eed393902 | |||
97876348d9 | |||
f8db21bbee | |||
3697be1be4 | |||
51068d9670 | |||
46f827fe2f | |||
f6b238ec30 | |||
cc157f6976 | |||
9ae5092e29 | |||
c741e006eb | |||
322d527a0c | |||
99aff2aefc | |||
cfb9edbce7 | |||
bcfbce66fd |
128
.github/CODE_OF_CONDUCT.md
vendored
Normal file
128
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@ -0,0 +1,128 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
contact@christitus.com.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
10
.github/ISSUE_TEMPLATE/bug_report.md
vendored
10
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -2,12 +2,12 @@
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
labels: 'bug'
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
## Describe the bug
|
||||
A clear and concise description of what the bug is.
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
## To Reproduce
|
||||
Steps to reproduce the behavior:
|
||||
@ -17,10 +17,10 @@ Steps to reproduce the behavior:
|
||||
4. See error
|
||||
|
||||
## Expected behavior
|
||||
A clear and concise description of what you expected to happen.
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
## Screenshots
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
<!-- If applicable, add screenshots to help explain your problem. -->
|
||||
|
||||
## Additional context
|
||||
Add any other context about the problem here.
|
||||
<!-- Add any other context about the problem here. -->
|
||||
|
10
.github/ISSUE_TEMPLATE/feature_request.md
vendored
10
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -2,19 +2,19 @@
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
labels: 'enhancement'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
<!-- A clear and concise description of what you want to happen. -->
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
<!-- Add any other context or screenshots about the feature request here. -->
|
||||
|
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
15
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,7 +1,4 @@
|
||||
# Pull Request
|
||||
|
||||
## Title
|
||||
[Provide a succinct and descriptive title for the pull request.]
|
||||
<!--Before you make this PR have you followed the docs here? - https://christitustech.github.io/winutil/contribute/ -->
|
||||
|
||||
## Type of Change
|
||||
- [ ] New feature
|
||||
@ -13,20 +10,20 @@
|
||||
- [ ] UI/UX improvement
|
||||
|
||||
## 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.]
|
||||
<!--[Provide a detailed explanation of the changes you have made. Include the reasons behind these changes and any relevant context. Link any related issues.]-->
|
||||
|
||||
## Testing
|
||||
[Detail the testing you have performed to ensure that these changes function as intended. Include information about any added tests.]
|
||||
<!--[Detail the testing you have performed to ensure that these changes function as intended. Include information about any added tests.]-->
|
||||
|
||||
## Impact
|
||||
[Discuss the impact of your changes on the project. This might include effects on performance, new dependencies, or changes in behaviour.]
|
||||
<!--[Discuss the impact of your changes on the project. This might include effects on performance, new dependencies, or changes in behaviour.]-->
|
||||
|
||||
## Issue related to PR
|
||||
[What issue/discussion is related to this PR (if any)]
|
||||
<!--[What issue/discussion is related to this PR (if any)]-->
|
||||
- Resolves #
|
||||
|
||||
## Additional Information
|
||||
[Any additional information that reviewers should be aware of.]
|
||||
<!--[Any additional information that reviewers should be aware of.]-->
|
||||
|
||||
## Checklist
|
||||
- [ ] My code adheres to the coding and style guidelines of the project.
|
||||
|
2
.github/SECURITY.md
vendored
2
.github/SECURITY.md
vendored
@ -1,5 +1,5 @@
|
||||
# Security Policy
|
||||
|
||||
If you find a security issue please make post it in the issues tab. If you think it should be private you can email me at contact@christitus.com.
|
||||
If you find a security issue please make post it in the issues tab. If you think it should be private you can email me at contact@christitus.com.
|
||||
|
||||
For immediate response check out our discord server @ [](https://discord.gg/RUbZUZyByQ)
|
||||
|
58
.github/release-drafter.yml
vendored
Normal file
58
.github/release-drafter.yml
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
tag-prefix: ''
|
||||
categories:
|
||||
- title: '🚀 Features'
|
||||
labels:
|
||||
- 'feature'
|
||||
- 'enhancement'
|
||||
- title: '🐛 Bug Fixes'
|
||||
labels:
|
||||
- 'fix'
|
||||
- 'bugfix'
|
||||
- 'bug'
|
||||
- title: '📚 Documentation'
|
||||
label: 'documentation'
|
||||
- title: '🔒 Security'
|
||||
label: 'security'
|
||||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
|
||||
template: |
|
||||
## Changes
|
||||
|
||||
$CHANGES
|
||||
|
||||
## Contributors
|
||||
|
||||
$CONTRIBUTORS
|
||||
|
||||
change-title-escapes: '\<*_&"'''
|
||||
autolabeler:
|
||||
- label: 'documentation'
|
||||
files:
|
||||
- '*.md'
|
||||
branch:
|
||||
- '/docs{0,1}\/.+/'
|
||||
- label: 'bug'
|
||||
branch:
|
||||
- '/fix\/.+/'
|
||||
title:
|
||||
- '/fix/i'
|
||||
- label: 'enhancement'
|
||||
branch:
|
||||
- '/feature\/.+/'
|
||||
body:
|
||||
- '/[A-Z]+-[0-9]+/'
|
||||
- label: 'documentation'
|
||||
files:
|
||||
- '**/*.md'
|
||||
- 'docs/**/*'
|
||||
- label: 'security'
|
||||
branch:
|
||||
- '/security\/.+/'
|
||||
replacers:
|
||||
- search: /"/g
|
||||
replace: ''
|
||||
- search: /'/g
|
||||
replace: ''
|
||||
exclude-labels:
|
||||
- 'skip-changelog'
|
||||
|
||||
filter-by-commitish: true
|
4
.github/workflows/close-old-issues.yaml
vendored
4
.github/workflows/close-old-issues.yaml
vendored
@ -22,8 +22,8 @@ jobs:
|
||||
exempt-issue-labels: "Keep Issue Open"
|
||||
# Split it into two weeks, after one week the issue will be marked as stale,
|
||||
# after another week have pasted without any update.. the issue will then be closed.
|
||||
days-before-issue-stale: 7
|
||||
days-before-issue-close: 7
|
||||
days-before-issue-stale: 90
|
||||
days-before-issue-close: 365
|
||||
# NEVER mark PRs as Stale or Close + this workflow should never have write permissions on PRs, EVER!
|
||||
days-before-pr-stale: -1
|
||||
days-before-pr-close: -1
|
||||
|
1
.github/workflows/github-pages.yaml
vendored
1
.github/workflows/github-pages.yaml
vendored
@ -7,6 +7,7 @@ on:
|
||||
- '.github/requirements.txt'
|
||||
- 'docs/**'
|
||||
- 'overrides/**'
|
||||
- '.github/CONTRIBUTING.md'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
15
.github/workflows/pre-release.yaml
vendored
15
.github/workflows/pre-release.yaml
vendored
@ -74,16 +74,27 @@ jobs:
|
||||
name: winutil
|
||||
path: ./winutil.ps1
|
||||
|
||||
- name: Generate Release Notes
|
||||
id: generate_notes
|
||||
uses: release-drafter/release-drafter@v6
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
config-name: release-drafter.yml
|
||||
version: ${{ env.VERSION }} # Pass the version variable
|
||||
|
||||
- name: Create and Upload Release
|
||||
id: create_release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ env.VERSION }}
|
||||
name: Pre-Release ${{ env.VERSION }}
|
||||
body: ""
|
||||
body: |
|
||||
${{ steps.generate_notes.outputs.body }}
|
||||
|
||||

|
||||
append_body: false
|
||||
files: ./winutil.ps1
|
||||
prerelease: true
|
||||
generate_release_notes: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
104
Compile.ps1
104
Compile.ps1
@ -1,12 +1,21 @@
|
||||
param (
|
||||
[switch]$Debug,
|
||||
[switch]$Run,
|
||||
[switch]$SkipPreprocessing
|
||||
[switch]$SkipPreprocessing,
|
||||
[string]$Arguments
|
||||
)
|
||||
|
||||
if ((Get-Item ".\winutil.ps1" -ErrorAction SilentlyContinue).IsReadOnly) {
|
||||
Remove-Item ".\winutil.ps1" -Force
|
||||
}
|
||||
|
||||
$OFS = "`r`n"
|
||||
$scriptname = "winutil.ps1"
|
||||
$workingdir = $PSScriptRoot
|
||||
|
||||
Push-Location
|
||||
Set-Location $workingdir
|
||||
|
||||
# Variable to sync between runspaces
|
||||
$sync = [Hashtable]::Synchronized(@{})
|
||||
$sync.PSScriptRoot = $workingdir
|
||||
@ -41,11 +50,11 @@ if (-NOT $SkipPreprocessing) {
|
||||
|
||||
# Dot source the 'Invoke-Preprocessing' Function from 'tools/Invoke-Preprocessing.ps1' Script
|
||||
$preprocessingFilePath = ".\tools\Invoke-Preprocessing.ps1"
|
||||
. "$(($workingdir -replace ('\\$', '')) + '\' + ($preprocessingFilePath -replace ('\.\\', '')))"
|
||||
. $preprocessingFilePath
|
||||
|
||||
$excludedFiles = @('.\.git\', '.\.gitignore', '.\.gitattributes', '.\.github\CODEOWNERS', '.\LICENSE', "$preprocessingFilePath", '*.png', '*.exe')
|
||||
$msg = "Pre-req: Code Formatting"
|
||||
Invoke-Preprocessing -WorkingDir "$workingdir" -ExcludedFiles $excludedFiles -ProgressStatusMessage $msg
|
||||
Invoke-Preprocessing -WorkingDir "$workingdir" -ExcludedFiles $excludedFiles -ProgressStatusMessage $msg -ThrowExceptionOnEmptyFilesList
|
||||
}
|
||||
|
||||
# Create the script in memory.
|
||||
@ -56,46 +65,22 @@ Update-Progress "Adding: Header" 5
|
||||
$script_content.Add($header)
|
||||
|
||||
Update-Progress "Adding: Version" 10
|
||||
$script_content.Add($(Get-Content "$workingdir\scripts\start.ps1").replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)"))
|
||||
$script_content.Add($(Get-Content "scripts\start.ps1").replace('#{replaceme}',"$(Get-Date -Format yy.MM.dd)"))
|
||||
|
||||
Update-Progress "Adding: Functions" 20
|
||||
Get-ChildItem "$workingdir\functions" -Recurse -File | ForEach-Object {
|
||||
Get-ChildItem "functions" -Recurse -File | ForEach-Object {
|
||||
$script_content.Add($(Get-Content $psitem.FullName))
|
||||
}
|
||||
Update-Progress "Adding: Config *.json" 40
|
||||
Get-ChildItem "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
|
||||
|
||||
Get-ChildItem "config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
|
||||
$json = (Get-Content $psitem.FullName).replace("'","''")
|
||||
|
||||
# Replace every XML Special Character so it'll render correctly in final build
|
||||
# Only do so if json files has content to be displayed (for example the applications, tweaks, features json files)
|
||||
# Make an Array List containing every name at first level of Json File
|
||||
$jsonAsObject = $json | convertfrom-json
|
||||
$firstLevelJsonList = [System.Collections.ArrayList]::new()
|
||||
$jsonAsObject.PSObject.Properties.Name | ForEach-Object {$null = $firstLevelJsonList.Add($_)}
|
||||
# Note:
|
||||
# Avoid using HTML Entity Codes, for example '”' (stands for "Right Double Quotation Mark"),
|
||||
# Use **HTML decimal/hex codes instead**, as using HTML Entity Codes will result in XML parse Error when running the compiled script.
|
||||
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
|
||||
$firstLevelName = $firstLevelJsonList[$i]
|
||||
if ($jsonAsObject.$firstLevelName.content -ne $null) {
|
||||
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—')
|
||||
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
|
||||
}
|
||||
if ($jsonAsObject.$firstLevelName.description -ne $null) {
|
||||
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&','&').replace('“','“').replace('”','”').replace("'",''').replace('<','<').replace('>','>').replace('—','—')
|
||||
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
|
||||
}
|
||||
}
|
||||
$jsonAsObject = $json | convertfrom-json
|
||||
|
||||
# Add 'WPFInstall' as a prefix to every entry-name in 'applications.json' file
|
||||
if ($psitem.Name -eq "applications.json") {
|
||||
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
|
||||
$appEntryName = $firstLevelJsonList[$i]
|
||||
foreach ($appEntryName in $jsonAsObject.PSObject.Properties.Name) {
|
||||
$appEntryContent = $jsonAsObject.$appEntryName
|
||||
# Remove the entire app entry, so we could add it later with a different name
|
||||
$jsonAsObject.PSObject.Properties.Remove($appEntryName)
|
||||
# Add the app entry, but with a different name (WPFInstall + The App Entry Name)
|
||||
$jsonAsObject | Add-Member -MemberType NoteProperty -Name "WPFInstall$appEntryName" -Value $appEntryContent
|
||||
}
|
||||
}
|
||||
@ -108,57 +93,52 @@ Get-ChildItem "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"
|
||||
$script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" ))
|
||||
}
|
||||
|
||||
$xaml = (Get-Content "$workingdir\xaml\inputXML.xaml").replace("'","''")
|
||||
|
||||
# Dot-source the Get-TabXaml function
|
||||
. "$workingdir\functions\private\Get-TabXaml.ps1"
|
||||
|
||||
Update-Progress "Building: Xaml " 75
|
||||
$appXamlContent = Get-TabXaml "applications" 5
|
||||
$tweaksXamlContent = Get-TabXaml "tweaks"
|
||||
$featuresXamlContent = Get-TabXaml "feature"
|
||||
|
||||
# Read the entire XAML file as a single string, preserving line breaks
|
||||
$xaml = Get-Content "$workingdir\xaml\inputXML.xaml" -Raw
|
||||
|
||||
Update-Progress "Adding: Xaml " 90
|
||||
# Replace the placeholder in $inputXML with the content of inputApp.xaml
|
||||
$xaml = $xaml -replace "{{InstallPanel_applications}}", $appXamlContent
|
||||
$xaml = $xaml -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent
|
||||
$xaml = $xaml -replace "{{InstallPanel_features}}", $featuresXamlContent
|
||||
|
||||
$script_content.Add($(Write-output "`$inputXML = '$xaml'"))
|
||||
# Add the XAML content to $script_content using a here-string
|
||||
$script_content.Add(@"
|
||||
`$inputXML = @'
|
||||
$xaml
|
||||
'@
|
||||
"@)
|
||||
|
||||
$script_content.Add($(Get-Content "$workingdir\scripts\main.ps1"))
|
||||
$script_content.Add($(Get-Content "scripts\main.ps1"))
|
||||
|
||||
if ($Debug) {
|
||||
Update-Progress "Writing debug files" 95
|
||||
$appXamlContent | Out-File -FilePath "$workingdir\xaml\inputApp.xaml" -Encoding ascii
|
||||
$tweaksXamlContent | Out-File -FilePath "$workingdir\xaml\inputTweaks.xaml" -Encoding ascii
|
||||
$featuresXamlContent | Out-File -FilePath "$workingdir\xaml\inputFeatures.xaml" -Encoding ascii
|
||||
$appXamlContent | Out-File -FilePath "xaml\inputApp.xaml" -Encoding ascii
|
||||
$tweaksXamlContent | Out-File -FilePath "xaml\inputTweaks.xaml" -Encoding ascii
|
||||
$featuresXamlContent | Out-File -FilePath "xaml\inputFeatures.xaml" -Encoding ascii
|
||||
} else {
|
||||
Update-Progress "Removing temporary files" 99
|
||||
Remove-Item "$workingdir\xaml\inputApp.xaml" -ErrorAction SilentlyContinue
|
||||
Remove-Item "$workingdir\xaml\inputTweaks.xaml" -ErrorAction SilentlyContinue
|
||||
Remove-Item "$workingdir\xaml\inputFeatures.xaml" -ErrorAction SilentlyContinue
|
||||
Remove-Item "xaml\inputApp.xaml" -ErrorAction SilentlyContinue
|
||||
Remove-Item "xaml\inputTweaks.xaml" -ErrorAction SilentlyContinue
|
||||
Remove-Item "xaml\inputFeatures.xaml" -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
Set-Content -Path "$workingdir\$scriptname" -Value ($script_content -join "`r`n") -Encoding ascii
|
||||
Set-Content -Path "$scriptname" -Value ($script_content -join "`r`n") -Encoding ascii
|
||||
Write-Progress -Activity "Compiling" -Completed
|
||||
|
||||
Update-Progress -Activity "Validating" -StatusMessage "Checking winutil.ps1 Syntax" -Percent 0
|
||||
try {
|
||||
$null = Get-Command -Syntax .\winutil.ps1
|
||||
}
|
||||
catch {
|
||||
} catch {
|
||||
Write-Warning "Syntax Validation for 'winutil.ps1' has failed"
|
||||
Write-Host "$($Error[0])" -ForegroundColor Red
|
||||
}
|
||||
Write-Progress -Activity "Validating" -Completed
|
||||
|
||||
if ($run) {
|
||||
try {
|
||||
Start-Process -FilePath "pwsh" -ArgumentList "$workingdir\$scriptname"
|
||||
} catch {
|
||||
Start-Process -FilePath "powershell" -ArgumentList "$workingdir\$scriptname"
|
||||
}
|
||||
$script = "& '$workingdir\$scriptname' $Arguments"
|
||||
|
||||
$powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" }
|
||||
$processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { $powershellcmd }
|
||||
|
||||
Start-Process $processCmd -ArgumentList "$powershellcmd -NoProfile -Command $script"
|
||||
|
||||
break
|
||||
}
|
||||
Pop-Location
|
||||
|
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 Chris Titus
|
||||
Copyright (c) 2022 CT Tech Group LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
@ -87,14 +87,6 @@
|
||||
"link": "https://anydesk.com/",
|
||||
"winget": "AnyDeskSoftwareGmbH.AnyDesk"
|
||||
},
|
||||
"ATLauncher": {
|
||||
"category": "Games",
|
||||
"choco": "na",
|
||||
"content": "ATLauncher",
|
||||
"description": "ATLauncher is a Launcher for Minecraft which integrates multiple different ModPacks to allow you to download and install ModPacks easily and quickly.",
|
||||
"link": "https://github.com/ATLauncher/ATLauncher",
|
||||
"winget": "ATLauncher.ATLauncher"
|
||||
},
|
||||
"audacity": {
|
||||
"category": "Multimedia Tools",
|
||||
"choco": "audacity",
|
||||
@ -511,14 +503,6 @@
|
||||
"link": "https://www.epicgames.com/store/en-US/",
|
||||
"winget": "EpicGames.EpicGamesLauncher"
|
||||
},
|
||||
"errorlookup": {
|
||||
"category": "Utilities",
|
||||
"choco": "na",
|
||||
"content": "Windows Error Code Lookup",
|
||||
"description": "ErrorLookup is a tool for looking up Windows error codes and their descriptions.",
|
||||
"link": "https://github.com/HenryPP/ErrorLookup",
|
||||
"winget": "Henry++.ErrorLookup"
|
||||
},
|
||||
"esearch": {
|
||||
"category": "Utilities",
|
||||
"choco": "everything",
|
||||
@ -813,7 +797,7 @@
|
||||
"content": "Google Drive",
|
||||
"description": "File syncing across devices all tied to your google account",
|
||||
"link": "https://www.google.com/drive/",
|
||||
"winget": "Google.Drive"
|
||||
"winget": "Google.GoogleDrive"
|
||||
},
|
||||
"gpuz": {
|
||||
"category": "Utilities",
|
||||
|
@ -293,7 +293,7 @@
|
||||
<Extensions xmlns="https://schneegans.de/windows/unattend-generator/">
|
||||
<ExtractScript>
|
||||
param(
|
||||
[xml] $Document
|
||||
[xml]$Document
|
||||
);
|
||||
|
||||
$scriptsDir = 'C:\Windows\Setup\Scripts\';
|
||||
|
@ -282,6 +282,14 @@
|
||||
"ButtonWidth": "300",
|
||||
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/sound"
|
||||
},
|
||||
"WPFPanelprinter": {
|
||||
"Content": "Printer Panel",
|
||||
"category": "Legacy Windows Panels",
|
||||
"panel": "2",
|
||||
"Type": "Button",
|
||||
"ButtonWidth": "300",
|
||||
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/printer"
|
||||
},
|
||||
"WPFPanelsystem": {
|
||||
"Content": "System Properties",
|
||||
"category": "Legacy Windows Panels",
|
||||
@ -297,5 +305,13 @@
|
||||
"Type": "Button",
|
||||
"ButtonWidth": "300",
|
||||
"link": "https://christitustech.github.io/winutil/dev/features/Legacy-Windows-Panels/user"
|
||||
},
|
||||
"WPFWinUtilPSProfile": {
|
||||
"Content": "Install CTT PowerShell Profile",
|
||||
"category": "Powershell Profile",
|
||||
"panel": "2",
|
||||
"Order": "a083_",
|
||||
"Type": "Button",
|
||||
"ButtonWidth": "300"
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
"WPFTweaksDeleteTempFiles",
|
||||
"WPFTweaksEndTaskOnTaskbar",
|
||||
"WPFTweaksRestorePoint",
|
||||
"WPFTweaksTeredo",
|
||||
"WPFTweaksIPv46",
|
||||
"WPFTweaksPowershell7Tele"
|
||||
],
|
||||
"Minimal": [
|
||||
|
@ -1,220 +1,170 @@
|
||||
{
|
||||
"Classic": {
|
||||
"CustomDialogFontSize": "12",
|
||||
"CustomDialogFontSizeHeader": "14",
|
||||
"CustomDialogIconSize": "25",
|
||||
"CustomDialogWidth": "400",
|
||||
"CustomDialogHeight": "200",
|
||||
"_default": {
|
||||
"CustomDialogFontSize": "12",
|
||||
"CustomDialogFontSizeHeader": "14",
|
||||
"CustomDialogIconSize": "25",
|
||||
"CustomDialogWidth": "400",
|
||||
"CustomDialogHeight": "200",
|
||||
|
||||
"FontSize": "12",
|
||||
"FontFamily": "Arial",
|
||||
"FontSizeHeading": "14",
|
||||
"HeaderFontFamily": "Consolas, Monaco",
|
||||
"FontSize": "12",
|
||||
"FontFamily": "Arial",
|
||||
"FontSizeHeading": "16",
|
||||
"HeaderFontFamily": "Consolas, Monaco",
|
||||
|
||||
"CheckBoxBulletDecoratorFontSize": "14",
|
||||
"CheckBoxMargin": "15,0,0,2",
|
||||
"CheckBoxBulletDecoratorSize": "14",
|
||||
"CheckBoxMargin": "15,0,0,2",
|
||||
|
||||
"TabButtonFontSize": "14",
|
||||
"TabButtonWidth": "100",
|
||||
"TabButtonHeight": "25",
|
||||
"TabRowHeightInPixels": "50",
|
||||
"IconFontSize": "14",
|
||||
"IconButtonSize": "35",
|
||||
"WinUtilIconSize": "Auto",
|
||||
"SettingsIconFontSize": "18",
|
||||
"TabContentMargin": "5",
|
||||
"TabButtonFontSize": "14",
|
||||
"TabButtonWidth": "100",
|
||||
"TabButtonHeight": "25",
|
||||
"TabRowHeightInPixels": "50",
|
||||
"IconFontSize": "14",
|
||||
"IconButtonSize": "35",
|
||||
"WinUtilIconSize": "Auto",
|
||||
"SettingsIconFontSize": "18",
|
||||
"CloseIconFontSize": "18",
|
||||
|
||||
"MicroWinLogoSize": "10",
|
||||
"MicroWinLogoSize": "10",
|
||||
"MicrowinCheckBoxMargin": "-10,5,0,0",
|
||||
|
||||
"ProgressBarForegroundColor": "#FFAC1C",
|
||||
"ProgressBarBackgroundColor": "Transparent",
|
||||
"ProgressBarTextColor": "#000000",
|
||||
"ProgressBarForegroundColor": "#2e77ff",
|
||||
"ProgressBarBackgroundColor": "Transparent",
|
||||
"ProgressBarTextColor": "#232629",
|
||||
|
||||
"ComboBoxBackgroundColor": "#FFFFFF",
|
||||
"LabelboxForegroundColor": "#000000",
|
||||
"MainForegroundColor": "#000000",
|
||||
"MainBackgroundColor": "#FFFFFF",
|
||||
"LabelBackgroundColor": "#FAFAFA",
|
||||
"LinkForegroundColor": "#000000",
|
||||
"LinkHoverForegroundColor": "#000000",
|
||||
"GroupBorderBackgroundColor": "#000000",
|
||||
"ComboBoxForegroundColor": "#000000",
|
||||
"ComboBoxBackgroundColor": "#F7F7F7",
|
||||
"LabelboxForegroundColor": "#232629",
|
||||
"MainForegroundColor": "#232629",
|
||||
"MainBackgroundColor": "#F7F7F7",
|
||||
"LabelBackgroundColor": "#F7F7F7",
|
||||
"LinkForegroundColor": "#232629",
|
||||
"LinkHoverForegroundColor": "#232629",
|
||||
"GroupBorderBackgroundColor": "#232629",
|
||||
"ComboBoxForegroundColor": "#232629",
|
||||
|
||||
"ButtonFontSize": "12",
|
||||
"ButtonFontFamily": "Arial",
|
||||
"ButtonWidth": "200",
|
||||
"ButtonHeight": "25",
|
||||
"ConfigTabButtonFontSize": "16",
|
||||
"ButtonFontSize": "12",
|
||||
"ButtonFontFamily": "Arial",
|
||||
"ButtonWidth": "200",
|
||||
"ButtonHeight": "25",
|
||||
"ConfigTabButtonFontSize": "16",
|
||||
|
||||
"SearchBarWidth": "200",
|
||||
"SearchBarHeight": "25",
|
||||
"SearchBarTextBoxFontSize": "16",
|
||||
"SearchBarClearButtonFontSize": "14",
|
||||
"SearchBarWidth": "200",
|
||||
"SearchBarHeight": "25",
|
||||
"SearchBarTextBoxFontSize": "12",
|
||||
"SearchBarClearButtonFontSize": "14",
|
||||
|
||||
"ButtonInstallBackgroundColor": "#FFFFFF",
|
||||
"ButtonTweaksBackgroundColor": "#FFFFFF",
|
||||
"ButtonConfigBackgroundColor": "#FFFFFF",
|
||||
"ButtonUpdatesBackgroundColor": "#FFFFFF",
|
||||
"ButtonInstallForegroundColor": "#000000",
|
||||
"ButtonTweaksForegroundColor": "#000000",
|
||||
"ButtonConfigForegroundColor": "#000000",
|
||||
"ButtonUpdatesForegroundColor": "#000000",
|
||||
"ButtonBackgroundColor": "#F5F5F5",
|
||||
"ButtonBackgroundPressedColor": "#1A1A1A",
|
||||
"CheckboxMouseOverColor": "#999999",
|
||||
"ButtonBackgroundMouseoverColor": "#C2C2C2",
|
||||
"ButtonBackgroundSelectedColor": "#F0F0F0",
|
||||
"ButtonForegroundColor": "#000000",
|
||||
"ToggleButtonOnColor": "#2e77ff",
|
||||
"ButtonInstallBackgroundColor": "#F7F7F7",
|
||||
"ButtonTweaksBackgroundColor": "#F7F7F7",
|
||||
"ButtonConfigBackgroundColor": "#F7F7F7",
|
||||
"ButtonUpdatesBackgroundColor": "#F7F7F7",
|
||||
"ButtonInstallForegroundColor": "#232629",
|
||||
"ButtonTweaksForegroundColor": "#232629",
|
||||
"ButtonConfigForegroundColor": "#232629",
|
||||
"ButtonUpdatesForegroundColor": "#232629",
|
||||
"ButtonBackgroundColor": "#F5F5F5",
|
||||
"ButtonBackgroundPressedColor": "#1A1A1A",
|
||||
"CheckboxMouseOverColor": "#999999",
|
||||
"ButtonBackgroundMouseoverColor": "#C2C2C2",
|
||||
"ButtonBackgroundSelectedColor": "#F0F0F0",
|
||||
"ButtonForegroundColor": "#232629",
|
||||
"ToggleButtonOnColor": "#2e77ff",
|
||||
|
||||
"ButtonBorderThickness": "1",
|
||||
"ButtonMargin": "1",
|
||||
"ButtonCornerRadius": "2",
|
||||
"BorderColor": "#000000",
|
||||
"BorderOpacity": "0.2",
|
||||
"ShadowPulse": "Forever"
|
||||
},
|
||||
"Matrix": {
|
||||
"CustomDialogFontSize": "12",
|
||||
"CustomDialogFontSizeHeader": "14",
|
||||
"CustomDialogIconSize": "25",
|
||||
"CustomDialogWidth": "400",
|
||||
"CustomDialogHeight": "200",
|
||||
"ButtonBorderThickness": "1",
|
||||
"ButtonMargin": "1",
|
||||
"ButtonCornerRadius": "2",
|
||||
"BorderColor": "#232629",
|
||||
"BorderOpacity": "0.2",
|
||||
"ShadowPulse": "Forever"
|
||||
},
|
||||
"Classic": {
|
||||
"ComboBoxBackgroundColor": "#F7F7F7",
|
||||
"LabelboxForegroundColor": "#232629",
|
||||
"MainForegroundColor": "#232629",
|
||||
"MainBackgroundColor": "#F7F7F7",
|
||||
"LabelBackgroundColor": "#F7F7F7",
|
||||
"LinkForegroundColor": "#232629",
|
||||
"LinkHoverForegroundColor": "#232629",
|
||||
"GroupBorderBackgroundColor": "#232629",
|
||||
"ComboBoxForegroundColor": "#232629",
|
||||
|
||||
"FontSize": "12",
|
||||
"FontFamily": "Arial",
|
||||
"FontSizeHeading": "14",
|
||||
"HeaderFontFamily": "Consolas, Monaco",
|
||||
"ButtonInstallBackgroundColor": "#F7F7F7",
|
||||
"ButtonTweaksBackgroundColor": "#F7F7F7",
|
||||
"ButtonConfigBackgroundColor": "#F7F7F7",
|
||||
"ButtonUpdatesBackgroundColor": "#F7F7F7",
|
||||
"ButtonInstallForegroundColor": "#232629",
|
||||
"ButtonTweaksForegroundColor": "#232629",
|
||||
"ButtonConfigForegroundColor": "#232629",
|
||||
"ButtonUpdatesForegroundColor": "#232629",
|
||||
"ButtonBackgroundColor": "#F5F5F5",
|
||||
"ButtonBackgroundPressedColor": "#1A1A1A",
|
||||
"CheckboxMouseOverColor": "#999999",
|
||||
"ButtonBackgroundMouseoverColor": "#C2C2C2",
|
||||
"ButtonBackgroundSelectedColor": "#F0F0F0",
|
||||
"ButtonForegroundColor": "#232629",
|
||||
"ToggleButtonOnColor": "#2e77ff"
|
||||
},
|
||||
"Matrix": {
|
||||
"ComboBoxBackgroundColor": "#232629",
|
||||
"LabelboxForegroundColor": "#81a1c1",
|
||||
"MainForegroundColor": "#F7F7F7",
|
||||
"MainBackgroundColor": "#232629",
|
||||
"LabelBackgroundColor": "#232629",
|
||||
"LinkForegroundColor": "#add8e6",
|
||||
"LinkHoverForegroundColor": "#F7F7F7",
|
||||
"ComboBoxForegroundColor": "#81a1c1",
|
||||
|
||||
"CheckBoxBulletDecoratorFontSize": "14",
|
||||
"CheckBoxMargin": "15,0,0,2",
|
||||
"ProgressBarForegroundColor": "#222222",
|
||||
"ProgressBarBackgroundColor": "Transparent",
|
||||
"ProgressBarTextColor": "#cccccc",
|
||||
|
||||
"TabButtonFontSize": "14",
|
||||
"TabButtonWidth": "100",
|
||||
"TabButtonHeight": "25",
|
||||
"TabRowHeightInPixels": "50",
|
||||
"IconFontSize": "14",
|
||||
"IconButtonSize": "35",
|
||||
"WinUtilIconSize": "Auto",
|
||||
"SettingsIconFontSize": "18",
|
||||
"ButtonInstallBackgroundColor": "#222222",
|
||||
"ButtonTweaksBackgroundColor": "#333333",
|
||||
"ButtonConfigBackgroundColor": "#444444",
|
||||
"ButtonUpdatesBackgroundColor": "#555555",
|
||||
"ButtonInstallForegroundColor": "#F7F7F7",
|
||||
"ButtonTweaksForegroundColor": "#F7F7F7",
|
||||
"ButtonConfigForegroundColor": "#F7F7F7",
|
||||
"ButtonUpdatesForegroundColor": "#F7F7F7",
|
||||
"ButtonBackgroundColor": "#1E3747",
|
||||
"ButtonBackgroundPressedColor": "#F7F7F7",
|
||||
"ButtonBackgroundMouseoverColor": "#3B4252",
|
||||
"ButtonBackgroundSelectedColor": "#5E81AC",
|
||||
"ButtonForegroundColor": "#F7F7F7",
|
||||
"ToggleButtonOnColor": "#2e77ff",
|
||||
|
||||
"MicroWinLogoSize": "10",
|
||||
"BorderColor": "#0060CC",
|
||||
"BorderOpacity": "0.2",
|
||||
"ShadowPulse": "0:0:3"
|
||||
},
|
||||
"Dark": {
|
||||
"ComboBoxBackgroundColor": "#232629",
|
||||
"LabelboxForegroundColor": "#81a1c1",
|
||||
"MainForegroundColor": "#F7F7F7",
|
||||
"MainBackgroundColor": "#232629",
|
||||
"LabelBackgroundColor": "#232629",
|
||||
"LinkForegroundColor": "#add8e6",
|
||||
"LinkHoverForegroundColor": "#F7F7F7",
|
||||
"ComboBoxForegroundColor": "#81a1c1",
|
||||
|
||||
"ProgressBarForegroundColor": "#222222",
|
||||
"ProgressBarBackgroundColor": "Transparent",
|
||||
"ProgressBarTextColor": "#cccccc",
|
||||
"ProgressBarForegroundColor": "#222222",
|
||||
"ProgressBarBackgroundColor": "Transparent",
|
||||
"ProgressBarTextColor": "#cccccc",
|
||||
|
||||
"ComboBoxBackgroundColor": "#000000",
|
||||
"LabelboxForegroundColor": "#FFEE58",
|
||||
"MainForegroundColor": "#9CCC65",
|
||||
"MainBackgroundColor": "#000000",
|
||||
"LabelBackgroundColor": "#000000",
|
||||
"LinkForegroundColor": "#add8e6",
|
||||
"LinkHoverForegroundColor": "#FFFFFF",
|
||||
"ComboBoxForegroundColor": "#FFEE58",
|
||||
"ButtonInstallBackgroundColor": "#222222",
|
||||
"ButtonTweaksBackgroundColor": "#333333",
|
||||
"ButtonConfigBackgroundColor": "#444444",
|
||||
"ButtonUpdatesBackgroundColor": "#555555",
|
||||
"ButtonInstallForegroundColor": "#F7F7F7",
|
||||
"ButtonTweaksForegroundColor": "#F7F7F7",
|
||||
"ButtonConfigForegroundColor": "#F7F7F7",
|
||||
"ButtonUpdatesForegroundColor": "#F7F7F7",
|
||||
"ButtonBackgroundColor": "#1E3747",
|
||||
"ButtonBackgroundPressedColor": "#00CFFF",
|
||||
"ButtonBackgroundMouseoverColor": "#5E81AC",
|
||||
"ButtonBackgroundSelectedColor": "#5E81AC",
|
||||
"ButtonForegroundColor": "#F7F7F7",
|
||||
"ToggleButtonOnColor": "#2e77ff",
|
||||
|
||||
"ButtonFontSize": "12",
|
||||
"ButtonFontFamily": "Arial",
|
||||
"ButtonWidth": "200",
|
||||
"ButtonHeight": "25",
|
||||
"ConfigTabButtonFontSize": "16",
|
||||
|
||||
"SearchBarWidth": "200",
|
||||
"SearchBarHeight": "25",
|
||||
"SearchBarTextBoxFontSize": "16",
|
||||
"SearchBarClearButtonFontSize": "14",
|
||||
|
||||
"ButtonInstallBackgroundColor": "#222222",
|
||||
"ButtonTweaksBackgroundColor": "#333333",
|
||||
"ButtonConfigBackgroundColor": "#444444",
|
||||
"ButtonUpdatesBackgroundColor": "#555555",
|
||||
"ButtonInstallForegroundColor": "#FFFFFF",
|
||||
"ButtonTweaksForegroundColor": "#FFFFFF",
|
||||
"ButtonConfigForegroundColor": "#FFFFFF",
|
||||
"ButtonUpdatesForegroundColor": "#FFFFFF",
|
||||
"ButtonBackgroundColor": "#000019",
|
||||
"ButtonBackgroundPressedColor": "#FFFFFF",
|
||||
"ButtonBackgroundMouseoverColor": "#A55A64",
|
||||
"ButtonBackgroundSelectedColor": "#FF5733",
|
||||
"ButtonForegroundColor": "#9CCC65",
|
||||
"ToggleButtonOnColor": "#2e77ff",
|
||||
|
||||
"ButtonBorderThickness": "1",
|
||||
"ButtonMargin": "1",
|
||||
"ButtonCornerRadius": "2",
|
||||
"BorderColor": "#FFAC1C",
|
||||
"BorderOpacity": "0.8",
|
||||
"ShadowPulse": "0:0:3"
|
||||
},
|
||||
"Dark": {
|
||||
"CustomDialogFontSize": "12",
|
||||
"CustomDialogFontSizeHeader": "14",
|
||||
"CustomDialogIconSize": "25",
|
||||
"CustomDialogWidth": "400",
|
||||
"CustomDialogHeight": "200",
|
||||
|
||||
"FontSize": "12",
|
||||
"FontFamily": "Arial",
|
||||
"FontSizeHeading": "14",
|
||||
"HeaderFontFamily": "Consolas, Monaco",
|
||||
|
||||
"CheckBoxBulletDecoratorFontSize": "14",
|
||||
"CheckBoxMargin": "15,0,0,2",
|
||||
|
||||
"TabButtonFontSize": "14",
|
||||
"TabButtonWidth": "100",
|
||||
"TabButtonHeight": "25",
|
||||
"TabRowHeightInPixels": "50",
|
||||
"IconFontSize": "14",
|
||||
"IconButtonSize": "35",
|
||||
"WinUtilIconSize": "Auto",
|
||||
"SettingsIconFontSize": "18",
|
||||
|
||||
"MicroWinLogoSize": "10",
|
||||
|
||||
"ProgressBarForegroundColor": "#222222",
|
||||
"ProgressBarBackgroundColor": "Transparent",
|
||||
"ProgressBarTextColor": "#FFFFFF",
|
||||
|
||||
"ComboBoxBackgroundColor": "#000000",
|
||||
"LabelboxForegroundColor": "#FFEE58",
|
||||
"MainForegroundColor": "#9CCC65",
|
||||
"MainBackgroundColor": "#000000",
|
||||
"LabelBackgroundColor": "#000000",
|
||||
"LinkForegroundColor": "#add8e6",
|
||||
"LinkHoverForegroundColor": "#FFFFFF",
|
||||
"ComboBoxForegroundColor": "#FFEE58",
|
||||
|
||||
"ButtonFontSize": "12",
|
||||
"ButtonFontFamily": "Arial",
|
||||
"ButtonWidth": "200",
|
||||
"ButtonHeight": "25",
|
||||
"ConfigTabButtonFontSize": "16",
|
||||
|
||||
"SearchBarWidth": "200",
|
||||
"SearchBarHeight": "25",
|
||||
"SearchBarTextBoxFontSize": "16",
|
||||
"SearchBarClearButtonFontSize": "14",
|
||||
|
||||
"ButtonInstallBackgroundColor": "#222222",
|
||||
"ButtonTweaksBackgroundColor": "#333333",
|
||||
"ButtonConfigBackgroundColor": "#444444",
|
||||
"ButtonUpdatesBackgroundColor": "#555555",
|
||||
"ButtonInstallForegroundColor": "#FFFFFF",
|
||||
"ButtonTweaksForegroundColor": "#FFFFFF",
|
||||
"ButtonConfigForegroundColor": "#FFFFFF",
|
||||
"ButtonUpdatesForegroundColor": "#FFFFFF",
|
||||
"ButtonBackgroundColor": "#000019",
|
||||
"ButtonBackgroundPressedColor": "#9CCC65",
|
||||
"ButtonBackgroundMouseoverColor": "#FF5733",
|
||||
"ButtonBackgroundSelectedColor": "#FF5733",
|
||||
"ButtonForegroundColor": "#9CCC65",
|
||||
"ToggleButtonOnColor": "#2e77ff",
|
||||
|
||||
"ButtonBorderThickness": "1",
|
||||
"ButtonMargin": "1",
|
||||
"ButtonCornerRadius": "2",
|
||||
"BorderColor": "#FFAC1C",
|
||||
"BorderOpacity": "0.2",
|
||||
"ShadowPulse": "Forever"
|
||||
}
|
||||
"BorderColor": "#0b1215"
|
||||
}
|
||||
}
|
||||
|
@ -2713,6 +2713,9 @@
|
||||
reg delete \"HKEY_USERS\\Default\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" /v \"OneDriveSetup\" /f
|
||||
reg unload \"hku\\Default\"
|
||||
|
||||
Write-Host \"Removing autostart key\"
|
||||
reg delete \"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\" /v \"OneDrive\" /f
|
||||
|
||||
Write-Host \"Removing startmenu entry\"
|
||||
Remove-Item -Force -ErrorAction SilentlyContinue \"$env:userprofile\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\OneDrive.lnk\"
|
||||
|
||||
@ -3141,12 +3144,29 @@
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/DVR"
|
||||
},
|
||||
"WPFTweaksTeredo": {
|
||||
"Content": "Disable Teredo",
|
||||
"Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency.",
|
||||
"WPFTweaksIPv46": {
|
||||
"Content": "Prefer IPv4 over IPv6",
|
||||
"Description": "To set the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.",
|
||||
"category": "Essential Tweaks",
|
||||
"panel": "1",
|
||||
"Order": "a005_",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
|
||||
"Name": "DisabledComponents",
|
||||
"Value": "32",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/IPv46"
|
||||
},
|
||||
"WPFTweaksTeredo": {
|
||||
"Content": "Disable Teredo",
|
||||
"Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency, but may cause problems with some games",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a023_",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
|
||||
@ -3162,7 +3182,7 @@
|
||||
"UndoScript": [
|
||||
"netsh interface teredo set state default"
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/Teredo"
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo"
|
||||
},
|
||||
"WPFTweaksDisableipsix": {
|
||||
"Content": "Disable IPv6",
|
||||
@ -3382,22 +3402,6 @@
|
||||
"ComboItems": "Default DHCP Google Cloudflare Cloudflare_Malware Cloudflare_Malware_Adult Open_DNS Quad9 AdGuard_Ads_Trackers AdGuard_Ads_Trackers_Malware_Adult",
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/changedns"
|
||||
},
|
||||
"WPFTweaksbutton": {
|
||||
"Content": "Run Tweaks",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a041_",
|
||||
"Type": "Button",
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/button"
|
||||
},
|
||||
"WPFUndoall": {
|
||||
"Content": "Undo Selected Tweaks",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a042_",
|
||||
"Type": "Button",
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/Undoall"
|
||||
},
|
||||
"WPFAddUltPerf": {
|
||||
"Content": "Add and Activate Ultimate Performance Profile",
|
||||
"category": "Performance Plans",
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 213 KiB |
65
docs/dev/features/Legacy-Windows-Panels/printer.md
Normal file
65
docs/dev/features/Legacy-Windows-Panels/printer.md
Normal file
@ -0,0 +1,65 @@
|
||||
# Printer Settings
|
||||
|
||||
Last Updated: 2024-08-31
|
||||
|
||||
|
||||
!!! info
|
||||
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
||||
|
||||
|
||||
<!-- BEGIN CUSTOM CONTENT -->
|
||||
|
||||
<!-- END CUSTOM CONTENT -->
|
||||
|
||||
<details>
|
||||
<summary>Preview Code</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"Content": "Printer Settings",
|
||||
"category": "Legacy Windows Panels",
|
||||
"panel": "2",
|
||||
"Type": "Button",
|
||||
"ButtonWidth": "300"
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## Function: Invoke-WPFControlPanel
|
||||
|
||||
```powershell
|
||||
function Invoke-WPFControlPanel {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Opens the requested legacy panel
|
||||
|
||||
.PARAMETER Panel
|
||||
The panel to open
|
||||
|
||||
#>
|
||||
param($Panel)
|
||||
|
||||
switch ($Panel) {
|
||||
"WPFPanelcontrol" {cmd /c control}
|
||||
"WPFPanelnetwork" {cmd /c ncpa.cpl}
|
||||
"WPFPanelpower" {cmd /c powercfg.cpl}
|
||||
"WPFPanelregion" {cmd /c intl.cpl}
|
||||
"WPFPanelsound" {cmd /c mmsys.cpl}
|
||||
"WPFPanelprinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
||||
"WPFPanelsystem" {cmd /c sysdm.cpl}
|
||||
"WPFPaneluser" {cmd /c "control userpasswords2"}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
<!-- BEGIN SECOND CUSTOM CONTENT -->
|
||||
|
||||
<!-- END SECOND CUSTOM CONTENT -->
|
||||
|
||||
|
||||
[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/../config/feature.json)
|
||||
|
63
docs/dev/tweaks/Essential-Tweaks/IPv46.md
Normal file
63
docs/dev/tweaks/Essential-Tweaks/IPv46.md
Normal file
@ -0,0 +1,63 @@
|
||||
# Prefer IPv4 over IPv6
|
||||
|
||||
Last Updated: 2024-08-27
|
||||
|
||||
|
||||
!!! info
|
||||
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
||||
## Description
|
||||
|
||||
To set the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.
|
||||
|
||||
<!-- BEGIN CUSTOM CONTENT -->
|
||||
|
||||
<!-- END CUSTOM CONTENT -->
|
||||
|
||||
<details>
|
||||
<summary>Preview Code</summary>
|
||||
|
||||
```json
|
||||
{
|
||||
"Content": "Prefer IPv4 over IPv6",
|
||||
"Description": "To set the IPv4 preference can have latency and security benefits on private networks where IPv6 is not configured.",
|
||||
"category": "Essential Tweaks",
|
||||
"panel": "1",
|
||||
"Order": "a005_",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
|
||||
"Name": "DisabledComponents",
|
||||
"Value": "32",
|
||||
"OriginalValue": "0",
|
||||
"Type": "DWord"
|
||||
}
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/IPv46"
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## 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).
|
||||
|
||||
### Registry Key: DisabledComponents
|
||||
|
||||
**Type:** DWord
|
||||
|
||||
**Original Value:** 0
|
||||
|
||||
**New Value:** 32
|
||||
|
||||
|
||||
|
||||
<!-- BEGIN SECOND CUSTOM CONTENT -->
|
||||
|
||||
<!-- END SECOND CUSTOM CONTENT -->
|
||||
|
||||
|
||||
[View the JSON file](https://github.com/ChrisTitusTech/winutil/tree/main/config/tweaks.json)
|
||||
|
@ -69,7 +69,7 @@ function Invoke-WPFTweakPS7{
|
||||
Write-Host "Powershell 7 is already installed."
|
||||
} else {
|
||||
Write-Host "Installing Powershell 7..."
|
||||
Invoke-WinUtilWingetProgram -Action Install -Programs @("Microsoft.PowerShell")
|
||||
Install-WinUtilProgramWinget -Action Install -Programs @("Microsoft.PowerShell")
|
||||
}
|
||||
$targetTerminalName = "PowerShell"
|
||||
}
|
||||
@ -105,10 +105,10 @@ function Invoke-WPFTweakPS7{
|
||||
}
|
||||
|
||||
```
|
||||
## Function: Invoke-WinUtilWingetProgram
|
||||
## Function: Install-WinUtilProgramWinget
|
||||
|
||||
```powershell
|
||||
Function Invoke-WinUtilWingetProgram {
|
||||
Function Install-WinUtilProgramWinget {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Runs the designated action on the provided programs using Winget
|
||||
|
@ -1,13 +1,13 @@
|
||||
# Disable Teredo
|
||||
|
||||
Last Updated: 2024-08-07
|
||||
Last Updated: 2024-08-27
|
||||
|
||||
|
||||
!!! info
|
||||
The Development Documentation is auto generated for every compilation of WinUtil, meaning a part of it will always stay up-to-date. **Developers do have the ability to add custom content, which won't be updated automatically.**
|
||||
## Description
|
||||
|
||||
Teredo network tunneling is a ipv6 feature that can cause additional latency.
|
||||
Teredo network tunneling is a ipv6 feature that can cause additional latency, but may cause problems with some games
|
||||
|
||||
<!-- BEGIN CUSTOM CONTENT -->
|
||||
|
||||
@ -19,10 +19,10 @@ Teredo network tunneling is a ipv6 feature that can cause additional latency.
|
||||
```json
|
||||
{
|
||||
"Content": "Disable Teredo",
|
||||
"Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency.",
|
||||
"category": "Essential Tweaks",
|
||||
"Description": "Teredo network tunneling is a ipv6 feature that can cause additional latency, but may cause problems with some games",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a005_",
|
||||
"Order": "a023_",
|
||||
"registry": [
|
||||
{
|
||||
"Path": "HKLM:\\SYSTEM\\CurrentControlSet\\Services\\Tcpip6\\Parameters",
|
||||
@ -38,7 +38,7 @@ Teredo network tunneling is a ipv6 feature that can cause additional latency.
|
||||
"UndoScript": [
|
||||
"netsh interface teredo set state default"
|
||||
],
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Essential-Tweaks/Teredo"
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo"
|
||||
}
|
||||
```
|
||||
|
172
docs/devdocs.md
172
docs/devdocs.md
@ -3,106 +3,106 @@
|
||||
|
||||
## Tweaks
|
||||
|
||||
### z--Advanced-Tweaks---CAUTION
|
||||
|
||||
- [Adobe Debloat](dev/tweaks/z--Advanced-Tweaks---CAUTION/DebloatAdobe.md)
|
||||
- [Adobe Network Block](dev/tweaks/z--Advanced-Tweaks---CAUTION/BlockAdobeNet.md)
|
||||
- [Disable Background Apps](dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableBGapps.md)
|
||||
- [Disable Fullscreen Optimizations](dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableFSO.md)
|
||||
- [Disable Intel MM (vPro LMS)](dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableLMS1.md)
|
||||
- [Disable IPv6](dev/tweaks/z--Advanced-Tweaks---CAUTION/Disableipsix.md)
|
||||
- [Disable Microsoft Copilot](dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveCopilot.md)
|
||||
- [Disable Notification Tray/Calendar](dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableNotifications.md)
|
||||
- [DNS](dev/tweaks/z--Advanced-Tweaks---CAUTION/changedns.md)
|
||||
- [Remove ALL MS Store Apps - NOT RECOMMENDED](dev/tweaks/z--Advanced-Tweaks---CAUTION/DeBloat.md)
|
||||
- [Remove Home and Gallery from explorer](dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveHomeGallery.md)
|
||||
- [Remove Microsoft Edge](dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveEdge.md)
|
||||
- [Remove OneDrive](dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveOnedrive.md)
|
||||
- [Run OO Shutup 10](dev/tweaks/z--Advanced-Tweaks---CAUTION/OOSUbutton.md)
|
||||
- [Run Tweaks](dev/tweaks/z--Advanced-Tweaks---CAUTION/button.md)
|
||||
- [Set Classic Right-Click Menu ](dev/tweaks/z--Advanced-Tweaks---CAUTION/RightClickMenu.md)
|
||||
- [Set Display for Performance](dev/tweaks/z--Advanced-Tweaks---CAUTION/Display.md)
|
||||
- [Set Time to UTC (Dual Boot)](dev/tweaks/z--Advanced-Tweaks---CAUTION/UTC.md)
|
||||
- [Undo Selected Tweaks](dev/tweaks/z--Advanced-Tweaks---CAUTION/Undoall.md)
|
||||
### Essential-Tweaks
|
||||
|
||||
- [Change Windows Terminal default: PowerShell 5 -> PowerShell 7](dev/tweaks/Essential-Tweaks/Powershell7.md)
|
||||
- [Create Restore Point](dev/tweaks/Essential-Tweaks/RestorePoint.md)
|
||||
- [Debloat Edge](dev/tweaks/Essential-Tweaks/EdgeDebloat.md)
|
||||
- [Delete Temporary Files](dev/tweaks/Essential-Tweaks/DeleteTempFiles.md)
|
||||
- [Disable Activity History](dev/tweaks/Essential-Tweaks/AH.md)
|
||||
- [Disable ConsumerFeatures](dev/tweaks/Essential-Tweaks/ConsumerFeatures.md)
|
||||
- [Disable GameDVR](dev/tweaks/Essential-Tweaks/DVR.md)
|
||||
- [Disable Hibernation](dev/tweaks/Essential-Tweaks/Hiber.md)
|
||||
- [Disable Homegroup](dev/tweaks/Essential-Tweaks/Home.md)
|
||||
- [Disable Location Tracking](dev/tweaks/Essential-Tweaks/Loc.md)
|
||||
- [Disable Powershell 7 Telemetry](dev/tweaks/Essential-Tweaks/Powershell7Tele.md)
|
||||
- [Disable Storage Sense](dev/tweaks/Essential-Tweaks/Storage.md)
|
||||
- [Disable Telemetry](dev/tweaks/Essential-Tweaks/Tele.md)
|
||||
- [Disable Teredo](dev/tweaks/Essential-Tweaks/Teredo.md)
|
||||
- [Disable Wifi-Sense](dev/tweaks/Essential-Tweaks/Wifi.md)
|
||||
- [Enable End Task With Right Click](dev/tweaks/Essential-Tweaks/EndTaskOnTaskbar.md)
|
||||
- [Run Disk Cleanup](dev/tweaks/Essential-Tweaks/DiskCleanup.md)
|
||||
- [Set Hibernation as default (good for laptops)](dev/tweaks/Essential-Tweaks/LaptopHibernation.md)
|
||||
- [Set Services to Manual](dev/tweaks/Essential-Tweaks/Services.md)
|
||||
- [Change Windows Terminal default: PowerShell 5 -> PowerShell 7](../docs/dev/tweaks/Essential-Tweaks/Powershell7.md)
|
||||
- [Create Restore Point](../docs/dev/tweaks/Essential-Tweaks/RestorePoint.md)
|
||||
- [Debloat Edge](../docs/dev/tweaks/Essential-Tweaks/EdgeDebloat.md)
|
||||
- [Delete Temporary Files](../docs/dev/tweaks/Essential-Tweaks/DeleteTempFiles.md)
|
||||
- [Disable Activity History](../docs/dev/tweaks/Essential-Tweaks/AH.md)
|
||||
- [Disable ConsumerFeatures](../docs/dev/tweaks/Essential-Tweaks/ConsumerFeatures.md)
|
||||
- [Disable GameDVR](../docs/dev/tweaks/Essential-Tweaks/DVR.md)
|
||||
- [Disable Hibernation](../docs/dev/tweaks/Essential-Tweaks/Hiber.md)
|
||||
- [Disable Homegroup](../docs/dev/tweaks/Essential-Tweaks/Home.md)
|
||||
- [Disable Location Tracking](../docs/dev/tweaks/Essential-Tweaks/Loc.md)
|
||||
- [Disable Powershell 7 Telemetry](../docs/dev/tweaks/Essential-Tweaks/Powershell7Tele.md)
|
||||
- [Disable Storage Sense](../docs/dev/tweaks/Essential-Tweaks/Storage.md)
|
||||
- [Disable Telemetry](../docs/dev/tweaks/Essential-Tweaks/Tele.md)
|
||||
- [Disable Wifi-Sense](../docs/dev/tweaks/Essential-Tweaks/Wifi.md)
|
||||
- [Enable End Task With Right Click](../docs/dev/tweaks/Essential-Tweaks/EndTaskOnTaskbar.md)
|
||||
- [Prefer IPv4 over IPv6](../docs/dev/tweaks/Essential-Tweaks/IPv46.md)
|
||||
- [Run Disk Cleanup](../docs/dev/tweaks/Essential-Tweaks/DiskCleanup.md)
|
||||
- [Set Hibernation as default (good for laptops)](../docs/dev/tweaks/Essential-Tweaks/LaptopHibernation.md)
|
||||
- [Set Services to Manual](../docs/dev/tweaks/Essential-Tweaks/Services.md)
|
||||
### Shortcuts
|
||||
|
||||
- [Create WinUtil Shortcut](dev/tweaks/Shortcuts/Shortcut.md)
|
||||
- [Create WinUtil Shortcut](../docs/dev/tweaks/Shortcuts/Shortcut.md)
|
||||
### z--Advanced-Tweaks---CAUTION
|
||||
|
||||
- [Adobe Debloat](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DebloatAdobe.md)
|
||||
- [Adobe Network Block](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/BlockAdobeNet.md)
|
||||
- [Disable Background Apps](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableBGapps.md)
|
||||
- [Disable Fullscreen Optimizations](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableFSO.md)
|
||||
- [Disable Intel MM (vPro LMS)](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableLMS1.md)
|
||||
- [Disable IPv6](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/Disableipsix.md)
|
||||
- [Disable Microsoft Copilot](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveCopilot.md)
|
||||
- [Disable Notification Tray/Calendar](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DisableNotifications.md)
|
||||
- [Disable Teredo](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/Teredo.md)
|
||||
- [DNS](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/changedns.md)
|
||||
- [Remove ALL MS Store Apps - NOT RECOMMENDED](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/DeBloat.md)
|
||||
- [Remove Home and Gallery from explorer](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveHomeGallery.md)
|
||||
- [Remove Microsoft Edge](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveEdge.md)
|
||||
- [Remove OneDrive](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/RemoveOnedrive.md)
|
||||
- [Run OO Shutup 10](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/OOSUbutton.md)
|
||||
- [Set Classic Right-Click Menu ](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/RightClickMenu.md)
|
||||
- [Set Display for Performance](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/Display.md)
|
||||
- [Set Time to UTC (Dual Boot)](../docs/dev/tweaks/z--Advanced-Tweaks---CAUTION/UTC.md)
|
||||
### Customize-Preferences
|
||||
|
||||
- [Bing Search in Start Menu](dev/tweaks/Customize-Preferences/BingSearch.md)
|
||||
- [Center Taskbar Items](dev/tweaks/Customize-Preferences/TaskbarAlignment.md)
|
||||
- [Dark Theme for Windows](dev/tweaks/Customize-Preferences/DarkMode.md)
|
||||
- [Detailed BSoD](dev/tweaks/Customize-Preferences/DetailedBSoD.md)
|
||||
- [Mouse Acceleration](dev/tweaks/Customize-Preferences/MouseAcceleration.md)
|
||||
- [NumLock on Startup](dev/tweaks/Customize-Preferences/NumLock.md)
|
||||
- [Search Button in Taskbar](dev/tweaks/Customize-Preferences/TaskbarSearch.md)
|
||||
- [Show File Extensions](dev/tweaks/Customize-Preferences/ShowExt.md)
|
||||
- [Show Hidden Files](dev/tweaks/Customize-Preferences/HiddenFiles.md)
|
||||
- [Snap Assist Flyout](dev/tweaks/Customize-Preferences/SnapFlyout.md)
|
||||
- [Snap Assist Suggestion](dev/tweaks/Customize-Preferences/SnapSuggestion.md)
|
||||
- [Snap Window](dev/tweaks/Customize-Preferences/SnapWindow.md)
|
||||
- [Sticky Keys](dev/tweaks/Customize-Preferences/StickyKeys.md)
|
||||
- [Task View Button in Taskbar](dev/tweaks/Customize-Preferences/TaskView.md)
|
||||
- [Verbose Messages During Logon](dev/tweaks/Customize-Preferences/VerboseLogon.md)
|
||||
- [Widgets Button in Taskbar](dev/tweaks/Customize-Preferences/TaskbarWidgets.md)
|
||||
- [Bing Search in Start Menu](../docs/dev/tweaks/Customize-Preferences/BingSearch.md)
|
||||
- [Center Taskbar Items](../docs/dev/tweaks/Customize-Preferences/TaskbarAlignment.md)
|
||||
- [Dark Theme for Windows](../docs/dev/tweaks/Customize-Preferences/DarkMode.md)
|
||||
- [Detailed BSoD](../docs/dev/tweaks/Customize-Preferences/DetailedBSoD.md)
|
||||
- [Mouse Acceleration](../docs/dev/tweaks/Customize-Preferences/MouseAcceleration.md)
|
||||
- [NumLock on Startup](../docs/dev/tweaks/Customize-Preferences/NumLock.md)
|
||||
- [Search Button in Taskbar](../docs/dev/tweaks/Customize-Preferences/TaskbarSearch.md)
|
||||
- [Show File Extensions](../docs/dev/tweaks/Customize-Preferences/ShowExt.md)
|
||||
- [Show Hidden Files](../docs/dev/tweaks/Customize-Preferences/HiddenFiles.md)
|
||||
- [Snap Assist Flyout](../docs/dev/tweaks/Customize-Preferences/SnapFlyout.md)
|
||||
- [Snap Assist Suggestion](../docs/dev/tweaks/Customize-Preferences/SnapSuggestion.md)
|
||||
- [Snap Window](../docs/dev/tweaks/Customize-Preferences/SnapWindow.md)
|
||||
- [Sticky Keys](../docs/dev/tweaks/Customize-Preferences/StickyKeys.md)
|
||||
- [Task View Button in Taskbar](../docs/dev/tweaks/Customize-Preferences/TaskView.md)
|
||||
- [Verbose Messages During Logon](../docs/dev/tweaks/Customize-Preferences/VerboseLogon.md)
|
||||
- [Widgets Button in Taskbar](../docs/dev/tweaks/Customize-Preferences/TaskbarWidgets.md)
|
||||
### Performance-Plans
|
||||
|
||||
- [Add and Activate Ultimate Performance Profile](dev/tweaks/Performance-Plans/AddUltPerf.md)
|
||||
- [Remove Ultimate Performance Profile](dev/tweaks/Performance-Plans/RemoveUltPerf.md)
|
||||
- [Add and Activate Ultimate Performance Profile](../docs/dev/tweaks/Performance-Plans/AddUltPerf.md)
|
||||
- [Remove Ultimate Performance Profile](../docs/dev/tweaks/Performance-Plans/RemoveUltPerf.md)
|
||||
|
||||
## Features
|
||||
|
||||
### Legacy-Windows-Panels
|
||||
|
||||
- [Control Panel](dev/features/Legacy-Windows-Panels/control.md)
|
||||
- [Network Connections](dev/features/Legacy-Windows-Panels/network.md)
|
||||
- [Power Panel](dev/features/Legacy-Windows-Panels/power.md)
|
||||
- [Region](dev/features/Legacy-Windows-Panels/region.md)
|
||||
- [Sound Settings](dev/features/Legacy-Windows-Panels/sound.md)
|
||||
- [System Properties](dev/features/Legacy-Windows-Panels/system.md)
|
||||
- [User Accounts](dev/features/Legacy-Windows-Panels/user.md)
|
||||
### Fixes
|
||||
|
||||
- [Remove Adobe Creative Cloud](dev/features/Fixes/RunAdobeCCCleanerTool.md)
|
||||
- [Reset Network](dev/features/Fixes/Network.md)
|
||||
- [Reset Windows Update](dev/features/Fixes/Update.md)
|
||||
- [Set Up Autologin](dev/features/Fixes/Autologin.md)
|
||||
- [System Corruption Scan](dev/features/Fixes/DISM.md)
|
||||
- [WinGet Reinstall](dev/features/Fixes/Winget.md)
|
||||
- [Remove Adobe Creative Cloud](../docs/dev/features/Fixes/RunAdobeCCCleanerTool.md)
|
||||
- [Reset Network](../docs/dev/features/Fixes/Network.md)
|
||||
- [Reset Windows Update](../docs/dev/features/Fixes/Update.md)
|
||||
- [Set Up Autologin](../docs/dev/features/Fixes/Autologin.md)
|
||||
- [System Corruption Scan](../docs/dev/features/Fixes/DISM.md)
|
||||
- [WinGet Reinstall](../docs/dev/features/Fixes/Winget.md)
|
||||
### Legacy-Windows-Panels
|
||||
|
||||
- [Control Panel](../docs/dev/features/Legacy-Windows-Panels/control.md)
|
||||
- [Network Connections](../docs/dev/features/Legacy-Windows-Panels/network.md)
|
||||
- [Power Panel](../docs/dev/features/Legacy-Windows-Panels/power.md)
|
||||
- [Printer Settings](../docs/dev/features/Legacy-Windows-Panels/printer.md)
|
||||
- [Region](../docs/dev/features/Legacy-Windows-Panels/region.md)
|
||||
- [Sound Settings](../docs/dev/features/Legacy-Windows-Panels/sound.md)
|
||||
- [System Properties](../docs/dev/features/Legacy-Windows-Panels/system.md)
|
||||
- [User Accounts](../docs/dev/features/Legacy-Windows-Panels/user.md)
|
||||
### Features
|
||||
|
||||
- [All .Net Framework (2,3,4)](dev/features/Features/dotnet.md)
|
||||
- [Disable Legacy F8 Boot Recovery](dev/features/Features/DisableLegacyRecovery.md)
|
||||
- [Disable Search Box Web Suggestions in Registry(explorer restart)](dev/features/Features/DisableSearchSuggestions.md)
|
||||
- [Enable Daily Registry Backup Task 12.30am](dev/features/Features/RegBackup.md)
|
||||
- [Enable Legacy F8 Boot Recovery](dev/features/Features/EnableLegacyRecovery.md)
|
||||
- [Enable Search Box Web Suggestions in Registry(explorer restart)](dev/features/Features/EnableSearchSuggestions.md)
|
||||
- [HyperV Virtualization](dev/features/Features/hyperv.md)
|
||||
- [Install Features](dev/features/Features/Install.md)
|
||||
- [Legacy Media (WMP, DirectPlay)](dev/features/Features/legacymedia.md)
|
||||
- [NFS - Network File System](dev/features/Features/nfs.md)
|
||||
- [Windows Sandbox](dev/features/Features/Sandbox.md)
|
||||
- [Windows Subsystem for Linux](dev/features/Features/wsl.md)
|
||||
- [All .Net Framework (2,3,4)](../docs/dev/features/Features/dotnet.md)
|
||||
- [Disable Legacy F8 Boot Recovery](../docs/dev/features/Features/DisableLegacyRecovery.md)
|
||||
- [Disable Search Box Web Suggestions in Registry(explorer restart)](../docs/dev/features/Features/DisableSearchSuggestions.md)
|
||||
- [Enable Daily Registry Backup Task 12.30am](../docs/dev/features/Features/RegBackup.md)
|
||||
- [Enable Legacy F8 Boot Recovery](../docs/dev/features/Features/EnableLegacyRecovery.md)
|
||||
- [Enable Search Box Web Suggestions in Registry(explorer restart)](../docs/dev/features/Features/EnableSearchSuggestions.md)
|
||||
- [HyperV Virtualization](../docs/dev/features/Features/hyperv.md)
|
||||
- [Install Features](../docs/dev/features/Features/Install.md)
|
||||
- [Legacy Media (WMP, DirectPlay)](../docs/dev/features/Features/legacymedia.md)
|
||||
- [NFS - Network File System](../docs/dev/features/Features/nfs.md)
|
||||
- [Windows Sandbox](../docs/dev/features/Features/Sandbox.md)
|
||||
- [Windows Subsystem for Linux](../docs/dev/features/Features/wsl.md)
|
||||
|
||||
|
||||
|
@ -29,6 +29,11 @@
|
||||
* Click the `Clear Selection` button.
|
||||
* This will unselect all checked programs.
|
||||
|
||||
=== "prefer Chocolatey"
|
||||
* Check the `prefer Chocolatey` checkbox
|
||||
* By default Winutil will use winget to install/upgrade/remove packages and fallback to Chocolatey. This option reverses the preference.
|
||||
* This preference will be used for all Buttons on the Install page and persist across Winutil restarts
|
||||
|
||||

|
||||

|
||||
!!! tip
|
||||
|
@ -1,221 +0,0 @@
|
||||
function Get-TabXaml {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Generates XAML for a tab in the WinUtil GUI
|
||||
This function is used to generate the XAML for the applications tab in the WinUtil GUI
|
||||
It takes the tabname and the number of columns to display the applications in as input and returns the XAML for the tab as output
|
||||
|
||||
.PARAMETER tabname
|
||||
The name of the tab to generate XAML for
|
||||
Note: the 'tabname' parameter must equal one of the json files found in $sync.configs variable
|
||||
Otherwise, it'll throw an exception
|
||||
|
||||
.PARAMETER columncount
|
||||
The number of columns to display the applications in, default is 0
|
||||
|
||||
.OUTPUTS
|
||||
The XAML for the tab
|
||||
|
||||
.EXAMPLE
|
||||
Get-TabXaml "applications" 3
|
||||
#>
|
||||
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory, position=0)]
|
||||
[string]$tabname,
|
||||
|
||||
[Parameter(position=1)]
|
||||
[ValidateRange(0,10)] # 10 panels as max number is more then enough
|
||||
[int]$columncount = 0
|
||||
)
|
||||
|
||||
# Validate tabname
|
||||
if ($sync.configs.$tabname -eq $null) {
|
||||
throw "Invalid parameter passed, can't find '$tabname' in '`$sync.configs' variable, please double check any calls to 'Get-TabXaml' function."
|
||||
}
|
||||
|
||||
$organizedData = @{}
|
||||
# Iterate through JSON data and organize by panel and category
|
||||
foreach ($appName in $sync.configs.$tabname.PSObject.Properties.Name) {
|
||||
$appInfo = $sync.configs.$tabname.$appName
|
||||
|
||||
# Create an object for the application
|
||||
$appObject = [PSCustomObject]@{
|
||||
Name = $appName
|
||||
Category = $appInfo.Category
|
||||
Content = $appInfo.Content
|
||||
Choco = $appInfo.choco
|
||||
Winget = $appInfo.winget
|
||||
Panel = if ($columncount -gt 0 ) { "0" } else {$appInfo.panel}
|
||||
Link = $appInfo.link
|
||||
Description = $appInfo.description
|
||||
# Type is (Checkbox,Toggle,Button,Combobox ) (Default is Checkbox)
|
||||
Type = $appInfo.type
|
||||
ComboItems = $appInfo.ComboItems
|
||||
# Checked is the property to set startup checked status of checkbox (Default is false)
|
||||
Checked = $appInfo.Checked
|
||||
ButtonWidth = $appInfo.ButtonWidth
|
||||
}
|
||||
|
||||
if (-not $organizedData.ContainsKey($appObject.panel)) {
|
||||
$organizedData[$appObject.panel] = @{}
|
||||
}
|
||||
|
||||
if (-not $organizedData[$appObject.panel].ContainsKey($appObject.Category)) {
|
||||
$organizedData[$appObject.panel][$appObject.Category] = @{}
|
||||
}
|
||||
|
||||
# Store application data in a sub-array under the category
|
||||
# Add Order property to keep the original order of tweaks and features
|
||||
$organizedData[$appObject.panel][$appInfo.Category]["$($appInfo.order)$appName"] = $appObject
|
||||
}
|
||||
|
||||
# Same tab amount in last line of 'inputXML.xaml' file
|
||||
# TODO: Get the base repeat (amount) of tabs from last line (or even lines)
|
||||
# so it can dynamicly react to whatever is before this generated XML string.
|
||||
# .. may be solve this even before calling this function, and pass the result as a parameter?
|
||||
$tab_repeat = 7
|
||||
$spaces_per_tab = 4 # The convenction used across the code base
|
||||
$tab_as_spaces = $(" " * $spaces_per_tab)
|
||||
$precal_indent = $($tab_as_spaces * $tab_repeat)
|
||||
$precal_indent_p1 = $($tab_as_spaces * ($tab_repeat + 1))
|
||||
$precal_indent_p2 = $($tab_as_spaces * ($tab_repeat + 2))
|
||||
$precal_indent_m1 = $($tab_as_spaces * ($tab_repeat - 1))
|
||||
$precal_indent_m2 = $($tab_as_spaces * ($tab_repeat - 2))
|
||||
|
||||
# Calculate the needed number of panels
|
||||
$panelcount = 0
|
||||
$paneltotal = $organizedData.Keys.Count
|
||||
if ($columncount -gt 0) {
|
||||
$appcount = $sync.configs.$tabname.PSObject.Properties.Name.count + $organizedData["0"].Keys.count
|
||||
$maxcount = [Math]::Round( $appcount / $columncount + 0.5)
|
||||
$paneltotal = $columncount
|
||||
}
|
||||
# add ColumnDefinitions to evenly draw colums
|
||||
$blockXml = "<Grid.ColumnDefinitions>"
|
||||
$blockXml += $("`r`n" + " " * ($spaces_per_tab * $tab_repeat) +
|
||||
"<ColumnDefinition Width=""*""/>") * $paneltotal
|
||||
$blockXml += $("`r`n" + " " * ($spaces_per_tab * ($tab_repeat - 1))) +
|
||||
"</Grid.ColumnDefinitions>" + "`r`n"
|
||||
|
||||
# Iterate through 'organizedData' by panel, category, and application
|
||||
$count = 0
|
||||
foreach ($panel in ($organizedData.Keys | Sort-Object)) {
|
||||
$blockXml += $precal_indent_m1 + "<Border Grid.Row=""1"" Grid.Column=""$panelcount"">" + "`r`n"
|
||||
$blockXml += $precal_indent + "<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">" + "`r`n"
|
||||
$panelcount++
|
||||
foreach ($category in ($organizedData[$panel].Keys | Sort-Object)) {
|
||||
$count++
|
||||
if ($columncount -gt 0) {
|
||||
$panelcount2 = [Int](($count)/$maxcount-0.5)
|
||||
if ($panelcount -eq $panelcount2 ) {
|
||||
$blockXml += $precal_indent_p2 + "</StackPanel>" + "`r`n"
|
||||
$blockXml += $precal_indent_p1 + "</Border>" + "`r`n"
|
||||
$blockXml += $precal_indent_p1 + "<Border Grid.Row=""1"" Grid.Column=""$panelcount"">" + "`r`n"
|
||||
$blockXml += $precal_indent_p2 + "<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">" + "`r`n"
|
||||
$panelcount++
|
||||
}
|
||||
}
|
||||
|
||||
# Dot-source the Get-WPFObjectName function
|
||||
. "$($sync.PSScriptRoot)\functions\private\Get-WPFObjectName.ps1"
|
||||
|
||||
$categorycontent = $($category -replace '^.__', '')
|
||||
$categoryname = Get-WPFObjectName -type "Label" -name $categorycontent
|
||||
$blockXml += $("`r`n" + " " * ($spaces_per_tab * $tab_repeat)) +
|
||||
"<Label Name=""$categoryname"" Content=""$categorycontent""" + " " +
|
||||
"FontSize=""{FontSizeHeading}"" FontFamily=""{HeaderFontFamily}""/>" + "`r`n" + "`r`n"
|
||||
$sortedApps = $organizedData[$panel][$category].Keys | Sort-Object
|
||||
foreach ($appName in $sortedApps) {
|
||||
$count++
|
||||
|
||||
if ($columncount -gt 0) {
|
||||
$panelcount2 = [Int](($count)/$maxcount-0.5)
|
||||
# Verify the indentation actually works...
|
||||
if ($panelcount -eq $panelcount2 ) {
|
||||
$blockXml += $precal_indent_m1 +
|
||||
"</StackPanel>" + "`r`n"
|
||||
$blockXml += $precal_indent_m2 +
|
||||
"</Border>" + "`r`n"
|
||||
$blockXml += $precal_indent_m2 +
|
||||
"<Border Grid.Row=""1"" Grid.Column=""$panelcount"">" + "`r`n"
|
||||
$blockXml += $precal_indent_m1 +
|
||||
"<StackPanel Background=""{MainBackgroundColor}"" SnapsToDevicePixels=""True"">" + "`r`n"
|
||||
$panelcount++
|
||||
}
|
||||
}
|
||||
|
||||
$appInfo = $organizedData[$panel][$category][$appName]
|
||||
switch ($appInfo.Type) {
|
||||
"Toggle" {
|
||||
$blockXml += $precal_indent_m1 +
|
||||
"<DockPanel LastChildFill=""True"">" + "`r`n"
|
||||
$blockXml += $precal_indent +
|
||||
"<CheckBox Name=""$($appInfo.Name)"" Style=""{StaticResource ColorfulToggleSwitchStyle}"" Margin=""4,0""" + " " +
|
||||
"HorizontalAlignment=""Right"" FontSize=""{FontSize}""/>" + "`r`n"
|
||||
$blockXml += $precal_indent +
|
||||
"<Label Content=""$($appInfo.Content)"" ToolTip=""$($appInfo.Description)""" + " " +
|
||||
"HorizontalAlignment=""Left"" FontSize=""{FontSize}""/>" + "`r`n"
|
||||
$blockXml += $precal_indent_m1 +
|
||||
"</DockPanel>" + "`r`n"
|
||||
}
|
||||
|
||||
"Combobox" {
|
||||
$blockXml += $precal_indent_m1 +
|
||||
"<StackPanel Orientation=""Horizontal"" Margin=""0,5,0,0"">" + "`r`n"
|
||||
$blockXml += $precal_indent + "<Label Content=""$($appInfo.Content)"" HorizontalAlignment=""Left""" + " " +
|
||||
"VerticalAlignment=""Center"" FontSize=""{FontSize}""/>" + "`r`n"
|
||||
$blockXml += $precal_indent +
|
||||
"<ComboBox Name=""$($appInfo.Name)"" Height=""32"" Width=""186"" HorizontalAlignment=""Left""" + " " +
|
||||
"VerticalAlignment=""Center"" Margin=""5,5"" FontSize=""{FontSize}"">" + "`r`n"
|
||||
|
||||
$addfirst="IsSelected=""True"""
|
||||
foreach ($comboitem in ($appInfo.ComboItems -split " ")) {
|
||||
$blockXml += $precal_indent_p1 +
|
||||
"<ComboBoxItem $addfirst Content=""$comboitem"" FontSize=""{FontSize}""/>" + "`r`n"
|
||||
$addfirst=""
|
||||
}
|
||||
|
||||
$blockXml += $precal_indent_p1 + "</ComboBox>" + "`r`n"
|
||||
$blockXml += $precal_indent + "</StackPanel>" + "`r`n"
|
||||
}
|
||||
|
||||
"Button" {
|
||||
if ($appInfo.ButtonWidth -ne $null) {
|
||||
$ButtonWidthStr = "Width=""$($appInfo.ButtonWidth)"""
|
||||
}
|
||||
$blockXml += $precal_indent +
|
||||
"<Button Name=""$($appInfo.Name)"" Content=""$($appInfo.Content)""" + " " +
|
||||
"HorizontalAlignment=""Left"" Margin=""5"" Padding=""20,5"" $($ButtonWidthStr)/>" + "`r`n"
|
||||
}
|
||||
|
||||
# else it is a checkbox
|
||||
default {
|
||||
$checkedStatus = If ($appInfo.Checked -eq $null) {""} else {" IsChecked=""$($appInfo.Checked)"""}
|
||||
if ($appInfo.Link -eq $null) {
|
||||
$blockXml += $precal_indent +
|
||||
"<CheckBox Name=""$($appInfo.Name)"" Content=""$($appInfo.Content)""$($checkedStatus) Margin=""5,0""" + " " +
|
||||
"ToolTip=""$($appInfo.Description)""/>" + "`r`n"
|
||||
} else {
|
||||
$blockXml += $precal_indent +
|
||||
"<StackPanel Orientation=""Horizontal"">" + "`r`n"
|
||||
$blockXml += $precal_indent_p1 +
|
||||
"<CheckBox Name=""$($appInfo.Name)"" Content=""$($appInfo.Content)""$($checkedStatus)" + " " +
|
||||
"ToolTip=""$($appInfo.Description)"" Margin=""0,0,2,0""/>" + "`r`n"
|
||||
$blockXml += $precal_indent_p1 +
|
||||
"<TextBlock Name=""$($appInfo.Name)Link"" Style=""{StaticResource HoverTextBlockStyle}"" Text=""(?)""" + " " +
|
||||
"ToolTip=""$($appInfo.Link)""/>" + "`r`n"
|
||||
$blockXml += $precal_indent +
|
||||
"</StackPanel>" + "`r`n"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$blockXml += $precal_indent_p1 + "</StackPanel>" + "`r`n"
|
||||
$blockXml += $precal_indent + "</Border>" + "`r`n"
|
||||
}
|
||||
return ($blockXml)
|
||||
}
|
@ -15,8 +15,8 @@ function Install-WinUtilChoco {
|
||||
}
|
||||
|
||||
Write-Host "Seems Chocolatey is not installed, installing now."
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop
|
||||
powershell choco feature enable -n allowGlobalConfirmation
|
||||
Start-Process -FilePath "powershell" -ArgumentList "Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop" -Wait -NoNewWindow
|
||||
Start-Process -FilePath "powershell" -ArgumentList "choco feature enable -n allowGlobalConfirmation" -Wait -NoNewWindow
|
||||
|
||||
} catch {
|
||||
Write-Host "===========================================" -Foregroundcolor Red
|
||||
|
@ -1,102 +1,258 @@
|
||||
function Install-WinUtilProgramChoco {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Manages the provided programs using Chocolatey
|
||||
Manages the installation or uninstallation of a list of Chocolatey packages.
|
||||
|
||||
.PARAMETER ProgramsToInstall
|
||||
A list of programs to manage
|
||||
.PARAMETER Programs
|
||||
A string array containing the programs to be installed or uninstalled.
|
||||
|
||||
.PARAMETER manage
|
||||
The action to perform on the programs, can be either 'Installing' or 'Uninstalling'
|
||||
.PARAMETER Action
|
||||
Specifies the action to perform: "Install" or "Uninstall". The default value is "Install".
|
||||
|
||||
.NOTES
|
||||
The triple quotes are required any time you need a " in a normal script block.
|
||||
.DESCRIPTION
|
||||
This function processes a list of programs to be managed using Chocolatey. Depending on the specified action, it either installs or uninstalls each program in the list, updating the taskbar progress accordingly. After all operations are completed, temporary output files are cleaned up.
|
||||
|
||||
.EXAMPLE
|
||||
Install-WinUtilProgramChoco -Programs @("7zip","chrome") -Action "Uninstall"
|
||||
#>
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory, Position=0)]
|
||||
[PsCustomObject]$ProgramsToInstall,
|
||||
[Parameter(Mandatory, Position = 0)]
|
||||
[string[]]$Programs,
|
||||
|
||||
[Parameter(Position=1)]
|
||||
[String]$manage = "Installing"
|
||||
[Parameter(Position = 1)]
|
||||
[String]$Action = "Install"
|
||||
)
|
||||
|
||||
$x = 0
|
||||
$count = $ProgramsToInstall.Count
|
||||
function Initialize-OutputFile {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Initializes an output file by removing any existing file and creating a new, empty file at the specified path.
|
||||
|
||||
# This check isn't really necessary, as there's a couple of checks before this Private Function gets called, but just to make sure ;)
|
||||
if($count -le 0) {
|
||||
throw "Private Function 'Install-WinUtilProgramChoco' expected Parameter 'ProgramsToInstall' to be of size 1 or greater, instead got $count,`nPlease double check your code and re-compile WinUtil."
|
||||
.PARAMETER filePath
|
||||
The full path to the file to be initialized.
|
||||
|
||||
.DESCRIPTION
|
||||
This function ensures that the specified file is reset by removing any existing file at the provided path and then creating a new, empty file. It is useful when preparing a log or output file for subsequent operations.
|
||||
|
||||
.EXAMPLE
|
||||
Initialize-OutputFile -filePath "C:\temp\output.txt"
|
||||
#>
|
||||
|
||||
param ($filePath)
|
||||
Remove-Item -Path $filePath -Force -ErrorAction SilentlyContinue
|
||||
New-Item -ItemType File -Path $filePath | Out-Null
|
||||
}
|
||||
|
||||
Write-Progress -Activity "$manage Applications" -Status "Starting" -PercentComplete 0
|
||||
Write-Host "==========================================="
|
||||
Write-Host "-- Configuring Chocolatey pacakages ---"
|
||||
Write-Host "==========================================="
|
||||
Foreach ($Program in $ProgramsToInstall) {
|
||||
Write-Progress -Activity "$manage Applications" -Status "$manage $($Program.choco) $($x + 1) of $count" -PercentComplete $($x/$count*100)
|
||||
if($manage -eq "Installing") {
|
||||
write-host "Starting install of $($Program.choco) with Chocolatey."
|
||||
try {
|
||||
$tryUpgrade = $false
|
||||
$installOutputFilePath = "$env:TEMP\Install-WinUtilProgramChoco.install-command.output.txt"
|
||||
New-Item -ItemType File -Path $installOutputFilePath
|
||||
$chocoInstallStatus = $(Start-Process -FilePath "choco" -ArgumentList "install $($Program.choco) -y" -Wait -PassThru -RedirectStandardOutput $installOutputFilePath).ExitCode
|
||||
if(($chocoInstallStatus -eq 0) -AND (Test-Path -Path $installOutputFilePath)) {
|
||||
$keywordsFound = Get-Content -Path $installOutputFilePath | Where-Object {$_ -match "reinstall" -OR $_ -match "already installed"}
|
||||
if ($keywordsFound) {
|
||||
$tryUpgrade = $true
|
||||
function Run-ChocoCommand {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Executes a Chocolatey command with the specified arguments and returns the exit code.
|
||||
|
||||
.PARAMETER arguments
|
||||
The arguments to be passed to the Chocolatey command.
|
||||
|
||||
.DESCRIPTION
|
||||
This function runs a specified Chocolatey command by passing the provided arguments to the `choco` executable. It waits for the process to complete and then returns the exit code, allowing the caller to determine success or failure based on the exit code.
|
||||
|
||||
.RETURNS
|
||||
[int]
|
||||
The exit code of the Chocolatey command.
|
||||
|
||||
.EXAMPLE
|
||||
$exitCode = Run-ChocoCommand -arguments "install 7zip -y"
|
||||
#>
|
||||
|
||||
param ($arguments)
|
||||
return (Start-Process -FilePath "choco" -ArgumentList $arguments -Wait -PassThru).ExitCode
|
||||
}
|
||||
|
||||
function Check-UpgradeNeeded {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks if an upgrade is needed for a Chocolatey package based on the content of a log file.
|
||||
|
||||
.PARAMETER filePath
|
||||
The path to the log file that contains the output of a Chocolatey install command.
|
||||
|
||||
.DESCRIPTION
|
||||
This function reads the specified log file and checks for keywords that indicate whether an upgrade is needed. It returns a boolean value indicating whether the terms "reinstall" or "already installed" are present, which suggests that the package might need an upgrade.
|
||||
|
||||
.RETURNS
|
||||
[bool]
|
||||
True if the log file indicates that an upgrade is needed; otherwise, false.
|
||||
|
||||
.EXAMPLE
|
||||
$isUpgradeNeeded = Check-UpgradeNeeded -filePath "C:\temp\install-output.txt"
|
||||
#>
|
||||
|
||||
param ($filePath)
|
||||
return Get-Content -Path $filePath | Select-String -Pattern "reinstall|already installed" -Quiet
|
||||
}
|
||||
|
||||
function Update-TaskbarProgress {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Updates the taskbar progress based on the current installation progress.
|
||||
|
||||
.PARAMETER currentIndex
|
||||
The current index of the program being installed or uninstalled.
|
||||
|
||||
.PARAMETER totalPrograms
|
||||
The total number of programs to be installed or uninstalled.
|
||||
|
||||
.DESCRIPTION
|
||||
This function calculates the progress of the installation or uninstallation process and updates the taskbar accordingly. The taskbar is set to "Normal" if all programs have been processed, otherwise, it is set to "Error" as a placeholder.
|
||||
|
||||
.EXAMPLE
|
||||
Update-TaskbarProgress -currentIndex 3 -totalPrograms 10
|
||||
#>
|
||||
|
||||
param (
|
||||
[int]$currentIndex,
|
||||
[int]$totalPrograms
|
||||
)
|
||||
$progressState = if ($currentIndex -eq $totalPrograms) { "Normal" } else { "Error" }
|
||||
$sync.form.Dispatcher.Invoke([action] { Set-WinUtilTaskbaritem -state $progressState -value ($currentIndex / $totalPrograms) })
|
||||
}
|
||||
|
||||
function Install-ChocoPackage {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Installs a Chocolatey package and optionally upgrades it if needed.
|
||||
|
||||
.PARAMETER Program
|
||||
A string containing the name of the Chocolatey package to be installed.
|
||||
|
||||
.PARAMETER currentIndex
|
||||
The current index of the program in the list of programs to be managed.
|
||||
|
||||
.PARAMETER totalPrograms
|
||||
The total number of programs to be installed.
|
||||
|
||||
.DESCRIPTION
|
||||
This function installs a Chocolatey package by running the `choco install` command. If the installation output indicates that an upgrade might be needed, the function will attempt to upgrade the package. The taskbar progress is updated after each package is processed.
|
||||
|
||||
.EXAMPLE
|
||||
Install-ChocoPackage -Program $Program -currentIndex 0 -totalPrograms 5
|
||||
#>
|
||||
|
||||
param (
|
||||
[string]$Program,
|
||||
[int]$currentIndex,
|
||||
[int]$totalPrograms
|
||||
)
|
||||
|
||||
$installOutputFile = "$env:TEMP\Install-WinUtilProgramChoco.install-command.output.txt"
|
||||
Initialize-OutputFile $installOutputFile
|
||||
|
||||
Write-Host "Starting installation of $Program with Chocolatey."
|
||||
|
||||
try {
|
||||
$installStatusCode = Run-ChocoCommand "install $Program -y --log-file $installOutputFile"
|
||||
if ($installStatusCode -eq 0) {
|
||||
|
||||
if (Check-UpgradeNeeded $installOutputFile) {
|
||||
$upgradeStatusCode = Run-ChocoCommand "upgrade $Program -y"
|
||||
Write-Host "$Program was" $(if ($upgradeStatusCode -eq 0) { "upgraded successfully." } else { "not upgraded." })
|
||||
}
|
||||
else {
|
||||
Write-Host "$Program installed successfully."
|
||||
}
|
||||
}
|
||||
# TODO: Implement the Upgrade part using 'choco upgrade' command, this will make choco consistent with WinGet, as WinGet tries to Upgrade when you use the install command.
|
||||
if ($tryUpgrade) {
|
||||
throw "Automatic Upgrade for Choco isn't implemented yet, a feature to make it consistent with WinGet, the install command using choco simply failed because $($Program.choco) is already installed."
|
||||
}
|
||||
if(($chocoInstallStatus -eq 0) -AND ($tryUpgrade -eq $false)) {
|
||||
Write-Host "$($Program.choco) installed successfully using Chocolatey."
|
||||
$X++
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value ($x/$count) })
|
||||
continue
|
||||
} else {
|
||||
Write-Host "Failed to install $($Program.choco) using Chocolatey, Chocolatey output:`n`n$(Get-Content -Path $installOutputFilePath)."
|
||||
$X++
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) })
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Failed to install $($Program.choco) due to an error: $_"
|
||||
$X++
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) })
|
||||
else {
|
||||
Write-Host "Failed to install $Program."
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host "Failed to install $Program due to an error: $_"
|
||||
}
|
||||
finally {
|
||||
Update-TaskbarProgress $currentIndex $totalPrograms
|
||||
}
|
||||
}
|
||||
|
||||
if($manage -eq "Uninstalling") {
|
||||
write-host "Starting uninstall of $($Program.choco) with Chocolatey."
|
||||
function Uninstall-ChocoPackage {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Uninstalls a Chocolatey package and any related metapackages.
|
||||
|
||||
.PARAMETER Program
|
||||
A string containing the name of the Chocolatey package to be uninstalled.
|
||||
|
||||
.PARAMETER currentIndex
|
||||
The current index of the program in the list of programs to be managed.
|
||||
|
||||
.PARAMETER totalPrograms
|
||||
The total number of programs to be uninstalled.
|
||||
|
||||
.DESCRIPTION
|
||||
This function uninstalls a Chocolatey package and any related metapackages (e.g., .install or .portable variants). It updates the taskbar progress after processing each package.
|
||||
|
||||
.EXAMPLE
|
||||
Uninstall-ChocoPackage -Program $Program -currentIndex 0 -totalPrograms 5
|
||||
#>
|
||||
|
||||
param (
|
||||
[string]$Program,
|
||||
[int]$currentIndex,
|
||||
[int]$totalPrograms
|
||||
)
|
||||
|
||||
$uninstallOutputFile = "$env:TEMP\Install-WinUtilProgramChoco.uninstall-command.output.txt"
|
||||
Initialize-OutputFile $uninstallOutputFile
|
||||
|
||||
Write-Host "Searching for metapackages of $Program (.install or .portable)"
|
||||
$chocoPackages = ((choco list | Select-String -Pattern "$Program(\.install|\.portable)?").Matches.Value) -join " "
|
||||
if ($chocoPackages) {
|
||||
Write-Host "Starting uninstallation of $chocoPackages with Chocolatey."
|
||||
try {
|
||||
$uninstallOutputFilePath = "$env:TEMP\Install-WinUtilProgramChoco.uninstall-command.output.txt"
|
||||
New-Item -ItemType File -Path $uninstallOutputFilePath
|
||||
$chocoUninstallStatus = $(Start-Process -FilePath "choco" -ArgumentList "uninstall $($Program.choco) -y" -Wait -PassThru).ExitCode
|
||||
if($chocoUninstallStatus -eq 0) {
|
||||
Write-Host "$($Program.choco) uninstalled successfully using Chocolatey."
|
||||
$x++
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value ($x/$count) })
|
||||
continue
|
||||
} else {
|
||||
Write-Host "Failed to uninstall $($Program.choco) using Chocolatey, Chocolatey output:`n`n$(Get-Content -Path $uninstallOutputFilePath)."
|
||||
$x++
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) })
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Failed to uninstall $($Program.choco) due to an error: $_"
|
||||
$x++
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Error" -value ($x/$count) })
|
||||
$uninstallStatusCode = Run-ChocoCommand "uninstall $chocoPackages -y"
|
||||
Write-Host "$Program" $(if ($uninstallStatusCode -eq 0) { "uninstalled successfully." } else { "failed to uninstall." })
|
||||
}
|
||||
catch {
|
||||
Write-Host "Failed to uninstall $Program due to an error: $_"
|
||||
}
|
||||
finally {
|
||||
Update-TaskbarProgress $currentIndex $totalPrograms
|
||||
}
|
||||
}
|
||||
else {
|
||||
Write-Host "$Program is not installed."
|
||||
}
|
||||
}
|
||||
|
||||
$totalPrograms = $Programs.Count
|
||||
if ($totalPrograms -le 0) {
|
||||
throw "Parameter 'Programs' must have at least one item."
|
||||
}
|
||||
Write-Progress -Activity "$manage Applications" -Status "Finished" -Completed
|
||||
|
||||
# Cleanup leftovers files
|
||||
if(Test-Path -Path $installOutputFilePath) { Remove-Item -Path $installOutputFilePath }
|
||||
if(Test-Path -Path $uninstallOutputFilePath) { Remove-Item -Path $uninstallOutputFilePath }
|
||||
Write-Host "==========================================="
|
||||
Write-Host "-- Configuring Chocolatey packages ---"
|
||||
Write-Host "==========================================="
|
||||
|
||||
return;
|
||||
for ($currentIndex = 0; $currentIndex -lt $totalPrograms; $currentIndex++) {
|
||||
$Program = $Programs[$currentIndex]
|
||||
Set-WinUtilProgressBar -label "$Action $($Program)" -percent ($currentIndex / $totalPrograms * 100)
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -value ($currentIndex / $totalPrograms)})
|
||||
|
||||
switch ($Action) {
|
||||
"Install" {
|
||||
Install-ChocoPackage -Program $Program -currentIndex $currentIndex -totalPrograms $totalPrograms
|
||||
}
|
||||
"Uninstall" {
|
||||
Uninstall-ChocoPackage -Program $Program -currentIndex $currentIndex -totalPrograms $totalPrograms
|
||||
}
|
||||
default {
|
||||
throw "Invalid action parameter value: '$Action'."
|
||||
}
|
||||
}
|
||||
}
|
||||
Set-WinUtilProgressBar -label "$($Action)ation done" -percent 100
|
||||
# Cleanup Output Files
|
||||
$outputFiles = @("$env:TEMP\Install-WinUtilProgramChoco.install-command.output.txt", "$env:TEMP\Install-WinUtilProgramChoco.uninstall-command.output.txt")
|
||||
foreach ($filePath in $outputFiles) {
|
||||
Remove-Item -Path $filePath -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
Function Invoke-WinUtilWingetProgram {
|
||||
Function Install-WinUtilProgramWinget {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Runs the designated action on the provided programs using Winget
|
@ -13,6 +13,16 @@ Function Invoke-WinUtilCurrentSystem {
|
||||
param(
|
||||
$CheckBox
|
||||
)
|
||||
if ($CheckBox -eq "choco") {
|
||||
$apps = (choco list | Select-String -Pattern "^\S+").Matches.Value
|
||||
$filter = Get-WinUtilVariables -Type Checkbox | Where-Object {$psitem -like "WPFInstall*"}
|
||||
$sync.GetEnumerator() | Where-Object {$psitem.Key -in $filter} | ForEach-Object {
|
||||
$dependencies = @($sync.configs.applications.$($psitem.Key).choco -split ";")
|
||||
if ($dependencies -in $apps) {
|
||||
Write-Output $psitem.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($checkbox -eq "winget") {
|
||||
|
||||
|
@ -7,7 +7,9 @@ function Invoke-WinUtilGPU {
|
||||
"*NVIDIA GeForce*Laptop*",
|
||||
"*NVIDIA GeForce*GT*",
|
||||
"*AMD Radeon(TM)*",
|
||||
"*Intel(R) HD Graphics*",
|
||||
"*UHD*"
|
||||
|
||||
)
|
||||
|
||||
foreach ($gpu in $gpuInfo) {
|
||||
|
@ -37,28 +37,30 @@ function Remove-Features() {
|
||||
Remove-Features
|
||||
#>
|
||||
try {
|
||||
$featlist = (Get-WindowsOptionalFeature -Path $scratchDir).FeatureName
|
||||
$featlist = (Get-WindowsOptionalFeature -Path $scratchDir)
|
||||
|
||||
$featlist = $featlist | Where-Object {
|
||||
$_ -NotLike "*Defender*" -AND
|
||||
$_ -NotLike "*Printing*" -AND
|
||||
$_ -NotLike "*TelnetClient*" -AND
|
||||
$_ -NotLike "*PowerShell*" -AND
|
||||
$_ -NotLike "*NetFx*" -AND
|
||||
$_ -NotLike "*Media*" -AND
|
||||
$_ -NotLike "*NFS*"
|
||||
$_.FeatureName -NotLike "*Defender*" -AND
|
||||
$_.FeatureName -NotLike "*Printing*" -AND
|
||||
$_.FeatureName -NotLike "*TelnetClient*" -AND
|
||||
$_.FeatureName -NotLike "*PowerShell*" -AND
|
||||
$_.FeatureName -NotLike "*NetFx*" -AND
|
||||
$_.FeatureName -NotLike "*Media*" -AND
|
||||
$_.FeatureName -NotLike "*NFS*" -AND
|
||||
$_.State -ne "Disabled"
|
||||
}
|
||||
|
||||
foreach($feature in $featlist) {
|
||||
$status = "Removing feature $feature"
|
||||
$status = "Removing feature $($feature.FeatureName)"
|
||||
Write-Progress -Activity "Removing features" -Status $status -PercentComplete ($counter++/$featlist.Count*100)
|
||||
Write-Debug "Removing feature $feature"
|
||||
Disable-WindowsOptionalFeature -Path "$scratchDir" -FeatureName $feature -Remove -ErrorAction SilentlyContinue -NoRestart
|
||||
Write-Debug "Removing feature $($feature.FeatureName)"
|
||||
Disable-WindowsOptionalFeature -Path "$scratchDir" -FeatureName $($feature.FeatureName) -Remove -ErrorAction SilentlyContinue -NoRestart
|
||||
}
|
||||
Write-Progress -Activity "Removing features" -Status "Ready" -Completed
|
||||
Write-Host "You can re-enable the disabled features at any time, using either Windows Update or the SxS folder in <installation media>\Sources."
|
||||
} catch {
|
||||
Write-Host "Unable to get information about the features. MicroWin processing will continue, but features will not be processed"
|
||||
Write-Host "Error information: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,6 +108,8 @@ function Remove-Packages {
|
||||
$_ -NotLike "*Wifi*"
|
||||
}
|
||||
|
||||
$failedCount = 0
|
||||
|
||||
foreach ($pkg in $pkglist) {
|
||||
try {
|
||||
$status = "Removing $pkg"
|
||||
@ -114,12 +118,18 @@ function Remove-Packages {
|
||||
} catch {
|
||||
# This can happen if the package that is being removed is a permanent one, like FodMetadata
|
||||
Write-Host "Could not remove OS package $($pkg)"
|
||||
$failedCount += 1
|
||||
continue
|
||||
}
|
||||
}
|
||||
Write-Progress -Activity "Removing Apps" -Status "Ready" -Completed
|
||||
if ($failedCount -gt 0)
|
||||
{
|
||||
Write-Host "Some packages could not be removed. Do not worry: your image will still work fine. This can happen if the package is permanent or has been superseded by a newer one."
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Unable to get information about the packages. MicroWin processing will continue, but packages will not be processed"
|
||||
Write-Host "Error information: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,6 +185,7 @@ function Remove-ProvisionedPackages() {
|
||||
{
|
||||
# This can happen if getting AppX packages fails
|
||||
Write-Host "Unable to get information about the AppX packages. MicroWin processing will continue, but AppX packages will not be processed"
|
||||
Write-Host "Error information: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
@ -249,7 +260,7 @@ function New-Unattend {
|
||||
|
||||
param (
|
||||
[Parameter(Mandatory, Position = 0)] [string]$userName,
|
||||
[Parameter(Position = 1)] [string] $userPassword
|
||||
[Parameter(Position = 1)] [string]$userPassword
|
||||
)
|
||||
|
||||
$unattend = @'
|
||||
|
@ -14,7 +14,7 @@ function Invoke-WinUtilSnapFlyout {
|
||||
Write-Host "Disabling Snap Assist Flyout On startup"
|
||||
$value = 0
|
||||
}
|
||||
# taskkill.exe /F /IM "explorer.exe"
|
||||
|
||||
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
|
||||
taskkill.exe /F /IM "explorer.exe"
|
||||
Set-ItemProperty -Path $Path -Name EnableSnapAssistFlyout -Value $value
|
||||
|
50
functions/private/Invoke-WinUtilpsProfile.ps1
Normal file
50
functions/private/Invoke-WinUtilpsProfile.ps1
Normal file
@ -0,0 +1,50 @@
|
||||
function Invoke-WinUtilpsProfile {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Installs & applies the CTT Powershell Profile
|
||||
#>
|
||||
Invoke-WPFRunspace -Argumentlist $PROFILE -DebugPreference $DebugPreference -ScriptBlock {
|
||||
param ( $psprofile)
|
||||
function Invoke-PSSetup {
|
||||
$url = "https://raw.githubusercontent.com/ChrisTitusTech/powershell-profile/main/Microsoft.PowerShell_profile.ps1"
|
||||
$oldhash = Get-FileHash $psprofile -ErrorAction SilentlyContinue
|
||||
Invoke-RestMethod $url -OutFile "$env:temp/Microsoft.PowerShell_profile.ps1"
|
||||
$newhash = Get-FileHash "$env:temp/Microsoft.PowerShell_profile.ps1"
|
||||
if ($newhash.Hash -ne $oldhash.Hash) {
|
||||
write-host "===> Installing Profile.. <===" -ForegroundColor Yellow
|
||||
# Starting new hidden shell process bc setup does not work in a runspace
|
||||
Start-Process -FilePath "pwsh" -ArgumentList "-ExecutionPolicy Bypass -NoProfile -Command `"Invoke-Expression (Invoke-WebRequest `'https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1`')`"" -WindowStyle Hidden -Wait
|
||||
Write-Host "Profile has been installed. Please restart your shell to reflect changes!" -ForegroundColor Magenta
|
||||
write-host "===> Finished <===" -ForegroundColor Yellow
|
||||
} else {
|
||||
Write-Host "Profile is up to date" -ForegroundColor Green
|
||||
}
|
||||
}
|
||||
|
||||
if (Get-Command "pwsh" -ErrorAction SilentlyContinue) {
|
||||
if ($PSVersionTable.PSVersion.Major -ge 7) {
|
||||
Invoke-PSSetup
|
||||
}
|
||||
else {
|
||||
write-host "Profile requires Powershell 7, which is currently installed but not used!" -ForegroundColor Red
|
||||
# Load the necessary assembly for Windows Forms
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
# Display the Yes/No message box
|
||||
$question = [System.Windows.Forms.MessageBox]::Show("Profile requires Powershell 7, which is currently installed but not used! Do you want to install Profile for Powershell 7?", "Question",
|
||||
[System.Windows.Forms.MessageBoxButtons]::YesNo,
|
||||
[System.Windows.Forms.MessageBoxIcon]::Question)
|
||||
|
||||
# Check the result
|
||||
if ($question -eq [System.Windows.Forms.DialogResult]::Yes) {
|
||||
Invoke-PSSetup
|
||||
}
|
||||
else {
|
||||
Write-Host "Not proceeding with the profile setup!"
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
write-host "Profile requires Powershell 7, which is not installed!" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
}
|
83
functions/private/Set-WinUtilUITheme.ps1
Normal file
83
functions/private/Set-WinUtilUITheme.ps1
Normal file
@ -0,0 +1,83 @@
|
||||
function Set-WinUtilUITheme {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Sets the theme of the XAML file
|
||||
|
||||
.PARAMETER inputXML
|
||||
A string representing the XAML object to modify
|
||||
|
||||
.PARAMETER customThemeName
|
||||
The name of the custom theme to set the XAML to. Defaults to 'matrix'
|
||||
|
||||
.PARAMETER defaultThemeName
|
||||
The name of the default theme to use when setting the XAML. Defaults to '_default'
|
||||
|
||||
.EXAMPLE
|
||||
$returnVal = Set-WinUtilUITheme -inputXAML $inputXAML
|
||||
if ($returnVal[0] -eq "") {
|
||||
Write-Host "Failed to process inputXML"
|
||||
} else {
|
||||
$inputXML = $returnVal[0]
|
||||
}
|
||||
# to know which theme this function has used, access the second item in returned value.
|
||||
Write-Host "Theme used in processing: $($returnVal[1])"
|
||||
#>
|
||||
|
||||
param (
|
||||
[Parameter(Mandatory, position=0)]
|
||||
[string]$inputXML,
|
||||
|
||||
[Parameter(position=1)]
|
||||
[string]$customThemeName = 'matrix',
|
||||
|
||||
[Parameter(position=2)]
|
||||
[string]$defaultThemeName = '_default'
|
||||
)
|
||||
|
||||
try {
|
||||
# Note:
|
||||
# Reason behind not caching the '$sync.configs.themes` object into a variable,
|
||||
# because this code can modify the themes object.. meaning it's better to access it
|
||||
# using the more verbose way, rather than introduce possible bugs into the code, just for the sake of readability.
|
||||
#
|
||||
if (-NOT $sync.configs.themes) {
|
||||
throw [GenericException]::new("[Set-WinUtilTheme] Did not find 'config.themes' inside `$sync variable.")
|
||||
}
|
||||
|
||||
if (-NOT $sync.configs.themes.$defaultThemeName) {
|
||||
throw [GenericException]::new("[Set-WinUtilTheme] Did not find '$defaultThemeName' theme in the themes config file.")
|
||||
}
|
||||
|
||||
$themeToUse = $customThemeName
|
||||
if ($sync.configs.themes.$themeToUse) {
|
||||
# Loop through every default theme option, and modify the custom theme in $sync variable,
|
||||
# so that it has full options available for other functions to use.
|
||||
foreach ($option in $sync.configs.themes.$defaultThemeName.PSObject.Properties) {
|
||||
$optionName = $option.Name
|
||||
$optionValue = $option.Value
|
||||
if (-NOT $sync.configs.themes.$themeToUse.$optionName) {
|
||||
$sync.configs.themes.$themeToUse | Add-Member -MemberType NoteProperty -Name $optionName -Value $optionValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Debug "[Set-WinUtilTheme] Theme '$customThemeName' was not found, using '$defaultThemeName' instead."
|
||||
$themeToUse = $defaultThemeName
|
||||
}
|
||||
|
||||
foreach ($property in $sync.configs.themes.$themeToUse.PSObject.Properties) {
|
||||
$key = $property.Name
|
||||
$value = $property.Value
|
||||
# Add curly braces around the key
|
||||
$formattedKey = "{$key}"
|
||||
# Replace the key with the value in the input XML
|
||||
$inputXML = $inputXML.Replace($formattedKey, $value)
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host "[Set-WinUtilTheme] Unable to apply theme" -ForegroundColor Red
|
||||
Write-Host "$($psitem.Exception.Message)" -ForegroundColor Red
|
||||
$inputXML = "" # Make inputXML equal an empty string, indicating something went wrong to the function caller.
|
||||
}
|
||||
|
||||
return @($inputXML, $themeToUse);
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
function Set-WinUtilUITheme {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Sets the theme of the XAML file
|
||||
|
||||
.PARAMETER inputXML
|
||||
A string representing the XAML object to modify
|
||||
|
||||
.PARAMETER themeName
|
||||
The name of the theme to set the XAML to. Defaults to 'matrix'
|
||||
|
||||
.EXAMPLE
|
||||
Set-WinUtilUITheme -inputXAML $inputXAML
|
||||
#>
|
||||
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory, position=0)]
|
||||
[string]$inputXML,
|
||||
[Parameter(position=1)]
|
||||
[string]$themeName = 'matrix'
|
||||
)
|
||||
|
||||
try {
|
||||
# Convert the JSON to a PowerShell object
|
||||
$themes = $sync.configs.themes
|
||||
# Select the specified theme
|
||||
$selectedTheme = $themes.$themeName
|
||||
|
||||
if ($selectedTheme) {
|
||||
# Loop through all key-value pairs in the selected theme
|
||||
foreach ($property in $selectedTheme.PSObject.Properties) {
|
||||
$key = $property.Name
|
||||
$value = $property.Value
|
||||
# Add curly braces around the key
|
||||
$formattedKey = "{$key}"
|
||||
# Replace the key with the value in the input XML
|
||||
$inputXML = $inputXML.Replace($formattedKey, $value)
|
||||
}
|
||||
} else {
|
||||
Write-Host "Theme '$themeName' not found."
|
||||
}
|
||||
|
||||
} catch {
|
||||
Write-Warning "Unable to apply theme"
|
||||
Write-Warning $psitem.Exception.StackTrace
|
||||
}
|
||||
|
||||
return $inputXML;
|
||||
}
|
@ -11,7 +11,7 @@ Function Update-WinUtilProgramWinget {
|
||||
|
||||
$host.ui.RawUI.WindowTitle = """Winget Install"""
|
||||
|
||||
Start-Transcript $ENV:TEMP\winget-update.log -Append
|
||||
Start-Transcript "$logdir\winget-update_$dateTime.log" -Append
|
||||
winget upgrade --all --accept-source-agreements --accept-package-agreements --scope=machine --silent
|
||||
|
||||
}
|
||||
|
@ -21,13 +21,13 @@ function Invoke-WPFButton {
|
||||
Switch -Wildcard ($Button) {
|
||||
|
||||
"WPFTab?BT" {Invoke-WPFTab $Button}
|
||||
"WPFinstall" {Invoke-WPFInstall}
|
||||
"WPFuninstall" {Invoke-WPFUnInstall}
|
||||
"WPFInstall" {Invoke-WPFInstall}
|
||||
"WPFUninstall" {Invoke-WPFUnInstall}
|
||||
"WPFInstallUpgrade" {Invoke-WPFInstallUpgrade}
|
||||
"WPFstandard" {Invoke-WPFPresets "Standard"}
|
||||
"WPFminimal" {Invoke-WPFPresets "Minimal"}
|
||||
"WPFclear" {Invoke-WPFPresets -preset $null -imported $true}
|
||||
"WPFclearWinget" {Invoke-WPFPresets -preset $null -imported $true -CheckBox "WPFInstall"}
|
||||
"WPFStandard" {Invoke-WPFPresets "Standard" -checkboxfilterpattern "WPFTweak*"}
|
||||
"WPFMinimal" {Invoke-WPFPresets "Minimal" -checkboxfilterpattern "WPFTweak*"}
|
||||
"WPFClearTweaksSelection" {Invoke-WPFPresets -imported $true -checkboxfilterpattern "WPFTweak*"}
|
||||
"WPFClearInstallSelection" {Invoke-WPFPresets -imported $true -checkboxfilterpattern "WPFInstall*"}
|
||||
"WPFtweaksbutton" {Invoke-WPFtweaksbutton}
|
||||
"WPFOOSUbutton" {Invoke-WPFOOSU}
|
||||
"WPFAddUltPerf" {Invoke-WPFUltimatePerformance -State "Enable"}
|
||||
@ -41,6 +41,7 @@ function Invoke-WPFButton {
|
||||
"WPFPanelpower" {Invoke-WPFControlPanel -Panel $button}
|
||||
"WPFPanelregion" {Invoke-WPFControlPanel -Panel $button}
|
||||
"WPFPanelsound" {Invoke-WPFControlPanel -Panel $button}
|
||||
"WPFPanelprinter" {Invoke-WPFControlPanel -Panel $button}
|
||||
"WPFPanelsystem" {Invoke-WPFControlPanel -Panel $button}
|
||||
"WPFPaneluser" {Invoke-WPFControlPanel -Panel $button}
|
||||
"WPFUpdatesdefault" {Invoke-WPFUpdatesdefault}
|
||||
@ -57,5 +58,6 @@ function Invoke-WPFButton {
|
||||
"WPFMicrowin" {Invoke-WPFMicrowin}
|
||||
"WPFCloseButton" {Invoke-WPFCloseButton}
|
||||
"MicrowinScratchDirBT" {Invoke-ScratchDialog}
|
||||
"WPFWinUtilPSProfile" {Invoke-WinUtilpsProfile}
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ function Invoke-WPFControlPanel {
|
||||
"WPFPanelpower" {cmd /c powercfg.cpl}
|
||||
"WPFPanelregion" {cmd /c intl.cpl}
|
||||
"WPFPanelsound" {cmd /c mmsys.cpl}
|
||||
"WPFPanelprinter" {Start-Process "shell:::{A8A91A66-3A7D-4424-8D24-04E180695C7A}"}
|
||||
"WPFPanelsystem" {cmd /c sysdm.cpl}
|
||||
"WPFPaneluser" {cmd /c "control userpasswords2"}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
function Invoke-WPFGetInstalled {
|
||||
<#
|
||||
|
||||
TODO: Add the Option to use Chocolatey as Engine
|
||||
.SYNOPSIS
|
||||
Invokes the function that gets the checkboxes to check in a new runspace
|
||||
|
||||
@ -16,12 +16,12 @@ function Invoke-WPFGetInstalled {
|
||||
return
|
||||
}
|
||||
|
||||
if(((Test-WinUtilPackageManager -winget) -eq "not-installed") -and $checkbox -eq "winget") {
|
||||
if(($sync.WPFpreferChocolatey.IsChecked -eq $false) -and ((Test-WinUtilPackageManager -winget) -eq "not-installed") -and $checkbox -eq "winget") {
|
||||
return
|
||||
}
|
||||
|
||||
Invoke-WPFRunspace -ArgumentList $checkbox -DebugPreference $DebugPreference -ScriptBlock {
|
||||
param($checkbox, $DebugPreference)
|
||||
$preferChoco = $sync.WPFpreferChocolatey.IsChecked
|
||||
Invoke-WPFRunspace -ArgumentList $checkbox, $preferChoco -DebugPreference $DebugPreference -ScriptBlock {
|
||||
param($checkbox, $preferChoco, $DebugPreference)
|
||||
|
||||
$sync.ProcessRunning = $true
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" })
|
||||
@ -32,8 +32,12 @@ function Invoke-WPFGetInstalled {
|
||||
if($checkbox -eq "tweaks") {
|
||||
Write-Host "Getting Installed Tweaks..."
|
||||
}
|
||||
|
||||
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox
|
||||
if ($preferChoco -and $checkbox -eq "winget") {
|
||||
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox "choco"
|
||||
}
|
||||
else{
|
||||
$Checkboxes = Invoke-WinUtilCurrentSystem -CheckBox $checkbox
|
||||
}
|
||||
|
||||
$sync.form.Dispatcher.invoke({
|
||||
foreach($checkbox in $Checkboxes) {
|
||||
|
@ -62,33 +62,17 @@ function Invoke-WPFGetIso {
|
||||
}
|
||||
}
|
||||
|
||||
if ($sync["ISOoption2"].IsChecked) {
|
||||
# Open file dialog to let user choose the ISO file
|
||||
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
|
||||
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
|
||||
$openFileDialog.initialDirectory = $initialDirectory
|
||||
$openFileDialog.filter = "ISO files (*.iso)| *.iso"
|
||||
$openFileDialog.ShowDialog() | Out-Null
|
||||
$filePath = $openFileDialog.FileName
|
||||
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
|
||||
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
|
||||
$openFileDialog.initialDirectory = $initialDirectory
|
||||
$openFileDialog.filter = "ISO files (*.iso)| *.iso"
|
||||
$openFileDialog.ShowDialog() | Out-Null
|
||||
$filePath = $openFileDialog.FileName
|
||||
|
||||
if ([string]::IsNullOrEmpty($filePath)) {
|
||||
Write-Host "No ISO is chosen"
|
||||
$sync.BusyMessage.Visibility="Hidden"
|
||||
return
|
||||
}
|
||||
} elseif ($sync["ISOoption1"].IsChecked) {
|
||||
# Auto download newest ISO
|
||||
# Credit: https://github.com/pbatard/Fido
|
||||
$fidopath = "$env:temp\Fido.ps1"
|
||||
$originalLocation = Get-Location
|
||||
|
||||
Invoke-WebRequest "https://github.com/pbatard/Fido/raw/master/Fido.ps1" -OutFile $fidopath
|
||||
|
||||
# TODO: Have to correct the language to actually be a working one
|
||||
Set-Location -Path $env:temp
|
||||
& $fidopath -Win 'Windows 11' -Rel $sync["ISORelease"].SelectedItem -Arch "x64"
|
||||
Set-Location $originalLocation
|
||||
$filePath = Get-ChildItem -Path "$env:temp" -Filter "Win11*.iso" | Sort-Object LastWriteTime -Descending | Select-Object -First 1
|
||||
if ([string]::IsNullOrEmpty($filePath)) {
|
||||
Write-Host "No ISO is chosen"
|
||||
$sync.BusyMessage.Visibility="Hidden"
|
||||
return
|
||||
}
|
||||
|
||||
Write-Host "File path $($filePath)"
|
||||
@ -130,7 +114,7 @@ function Invoke-WPFGetIso {
|
||||
# @ChrisTitusTech please copy this wiki and change the link below to your copy of the wiki
|
||||
Write-Error "Failed to mount the image. Error: $($_.Exception.Message)"
|
||||
Write-Error "This is NOT winutil's problem, your ISO might be corrupt, or there is a problem on the system"
|
||||
Write-Error "Please refer to this wiki for more details https://github.com/ChrisTitusTech/winutil/blob/main/wiki/Error-in-Winutil-MicroWin-during-ISO-mounting%2Cmd"
|
||||
Write-Host "Please refer to this wiki for more details: https://christitustech.github.io/winutil/KnownIssues/#troubleshoot-errors-during-microwin-usage" -ForegroundColor Red
|
||||
Set-WinUtilTaskbaritem -state "Error" -value 1 -overlay "warning"
|
||||
return
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ function Invoke-WPFImpex {
|
||||
if ($type -eq "export") {
|
||||
$jsonFile = Get-WinUtilCheckBoxes -unCheck $false
|
||||
$jsonFile | ConvertTo-Json | Out-File $FileBrowser.FileName -Force
|
||||
$runscript = "iex ""& { `$(irm christitus.com/win) } -Config '$($FileBrowser.FileName)'"""
|
||||
$runscript | Set-Clipboard
|
||||
}
|
||||
if ($type -eq "import") {
|
||||
$jsonFile = Get-Content $Config | ConvertFrom-Json
|
||||
@ -55,6 +57,7 @@ function Invoke-WPFImpex {
|
||||
}
|
||||
}
|
||||
|
||||
$flattenedJson = [string]$flattenedJson
|
||||
Invoke-WPFPresets -preset $flattenedJson -imported $true
|
||||
}
|
||||
}
|
||||
|
@ -19,10 +19,9 @@ function Invoke-WPFInstall {
|
||||
[System.Windows.MessageBox]::Show($WarningMsg, $AppTitle, [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
|
||||
param($PackagesToInstall, $DebugPreference)
|
||||
$ChocoPreference = $($sync.WPFpreferChocolatey.IsChecked)
|
||||
Invoke-WPFRunspace -ArgumentList $PackagesToInstall,$ChocoPreference -DebugPreference $DebugPreference -ScriptBlock {
|
||||
param($PackagesToInstall, $ChocoPreference, $DebugPreference)
|
||||
if ($PackagesToInstall.count -eq 1) {
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
||||
} else {
|
||||
@ -30,17 +29,29 @@ function Invoke-WPFInstall {
|
||||
}
|
||||
$packagesWinget, $packagesChoco = {
|
||||
$packagesWinget = [System.Collections.ArrayList]::new()
|
||||
$packagesChoco = [System.Collections.Generic.List`1[System.Object]]::new()
|
||||
foreach ($package in $PackagesToInstall) {
|
||||
$packagesChoco = [System.Collections.ArrayList]::new()
|
||||
|
||||
foreach ($package in $PackagesToInstall) {
|
||||
if ($ChocoPreference) {
|
||||
if ($package.choco -eq "na") {
|
||||
$packagesWinget.add($package.winget)
|
||||
Write-Host "Queueing $($package.winget) for Winget install"
|
||||
} else {
|
||||
$null = $packagesChoco.add($package.choco)
|
||||
Write-Host "Queueing $($package.choco) for Chocolatey install"
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($package.winget -eq "na") {
|
||||
$packagesChoco.add($package)
|
||||
$packagesChoco.add($package.choco)
|
||||
Write-Host "Queueing $($package.choco) for Chocolatey install"
|
||||
} else {
|
||||
$null = $packagesWinget.add($($package.winget))
|
||||
Write-Host "Queueing $($package.winget) for Winget install"
|
||||
}
|
||||
}
|
||||
return $packagesWinget, $packagesChoco
|
||||
}
|
||||
return $packagesWinget, $packagesChoco
|
||||
}.Invoke($PackagesToInstall)
|
||||
|
||||
try {
|
||||
@ -48,12 +59,12 @@ function Invoke-WPFInstall {
|
||||
$errorPackages = @()
|
||||
if($packagesWinget.Count -gt 0) {
|
||||
Install-WinUtilWinget
|
||||
$errorPackages += Invoke-WinUtilWingetProgram -Action Install -Programs $packagesWinget
|
||||
$errorPackages| ForEach-Object {if($_.choco -ne "na") {$packagesChoco += $_}}
|
||||
Install-WinUtilProgramWinget -Action Install -Programs $packagesWinget
|
||||
|
||||
}
|
||||
if($packagesChoco.Count -gt 0) {
|
||||
Install-WinUtilChoco
|
||||
Install-WinUtilProgramChoco -ProgramsToInstall $packagesChoco
|
||||
Install-WinUtilProgramChoco -Action Install -Programs $packagesChoco
|
||||
}
|
||||
Write-Host "==========================================="
|
||||
Write-Host "-- Installs have finished ---"
|
||||
|
@ -2,25 +2,35 @@ function Invoke-WPFInstallUpgrade {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Invokes the function that upgrades all installed programs using winget
|
||||
Invokes the function that upgrades all installed programs
|
||||
|
||||
#>
|
||||
if((Test-WinUtilPackageManager -winget) -eq "not-installed") {
|
||||
return
|
||||
if ($sync.WPFpreferChocolatey.IsChecked) {
|
||||
Install-WinUtilChoco
|
||||
$chocoUpgradeStatus = (Start-Process "choco" -ArgumentList "upgrade all -y" -Wait -PassThru -NoNewWindow).ExitCode
|
||||
if ($chocoUpgradeStatus -eq 0) {
|
||||
Write-Host "Upgrade Successful"
|
||||
}
|
||||
else{
|
||||
Write-Host "Error Occured. Return Code: $chocoUpgradeStatus"
|
||||
}
|
||||
}
|
||||
else{
|
||||
if((Test-WinUtilPackageManager -winget) -eq "not-installed") {
|
||||
return
|
||||
}
|
||||
|
||||
if(Get-WinUtilInstallerProcess -Process $global:WinGetInstall) {
|
||||
$msg = "[Invoke-WPFInstallUpgrade] Install process is currently running. Please check for a powershell window labeled 'Winget Install'"
|
||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||
return
|
||||
if(Get-WinUtilInstallerProcess -Process $global:WinGetInstall) {
|
||||
$msg = "[Invoke-WPFInstallUpgrade] Install process is currently running. Please check for a powershell window labeled 'Winget Install'"
|
||||
[System.Windows.MessageBox]::Show($msg, "Winutil", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||
return
|
||||
}
|
||||
|
||||
Update-WinUtilProgramWinget
|
||||
|
||||
Write-Host "==========================================="
|
||||
Write-Host "-- Updates started ---"
|
||||
Write-Host "-- You can close this window if desired ---"
|
||||
Write-Host "==========================================="
|
||||
}
|
||||
|
||||
# Set-WinUtilTaskbaritem -state "Indeterminate"
|
||||
|
||||
Update-WinUtilProgramWinget
|
||||
|
||||
Write-Host "==========================================="
|
||||
Write-Host "-- Updates started ---"
|
||||
Write-Host "-- You can close this window if desired ---"
|
||||
Write-Host "==========================================="
|
||||
}
|
||||
|
@ -263,10 +263,7 @@ public class PowerManagement {
|
||||
# reg delete "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\$_" /f | Out-Null
|
||||
|
||||
# When in Offline Image
|
||||
if (Test-Path "HKLM:\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\$_")
|
||||
{
|
||||
reg delete "HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\$_" /f | Out-Null
|
||||
}
|
||||
reg delete "HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\$_" /f | Out-Null
|
||||
}
|
||||
|
||||
reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v "SearchboxTaskbarMode" /t REG_DWORD /d 0 /f
|
||||
|
@ -10,29 +10,36 @@ function Invoke-WPFPresets {
|
||||
.PARAMETER imported
|
||||
If the preset is imported from a file, defaults to false
|
||||
|
||||
.PARAMETER checkbox
|
||||
The checkbox to set the options to, defaults to 'WPFTweaks'
|
||||
.PARAMETER checkboxfilterpattern
|
||||
The Pattern to use when filtering through CheckBoxes, defaults to "**"
|
||||
|
||||
#>
|
||||
|
||||
param(
|
||||
$preset,
|
||||
[bool]$imported = $false
|
||||
param (
|
||||
[Parameter(position=0)]
|
||||
[string]$preset = "",
|
||||
|
||||
[Parameter(position=1)]
|
||||
[bool]$imported = $false,
|
||||
|
||||
[Parameter(position=2)]
|
||||
[string]$checkboxfilterpattern = "**"
|
||||
)
|
||||
|
||||
if($imported -eq $true) {
|
||||
if ($imported -eq $true) {
|
||||
$CheckBoxesToCheck = $preset
|
||||
} else {
|
||||
$CheckBoxesToCheck = $sync.configs.preset.$preset
|
||||
}
|
||||
|
||||
$CheckBoxes = $sync.GetEnumerator() | Where-Object { $_.Value -is [System.Windows.Controls.CheckBox] -and $_.Name -notlike "WPFToggle*" }
|
||||
Write-Debug "Getting checkboxes to set $($CheckBoxes.Count)"
|
||||
$CheckBoxes = ($sync.GetEnumerator()).where{ $_.Value -is [System.Windows.Controls.CheckBox] -and $_.Name -notlike "WPFToggle*" -and $_.Name -like "$checkboxfilterpattern"}
|
||||
Write-Debug "Getting checkboxes to set, number of checkboxes: $($CheckBoxes.Count)"
|
||||
|
||||
$CheckBoxesToCheck | ForEach-Object {
|
||||
if ($_ -ne $null) {
|
||||
Write-Debug $_
|
||||
}
|
||||
if ($CheckBoxesToCheck -ne "") {
|
||||
$debugMsg = "CheckBoxes to Check are: "
|
||||
$CheckBoxesToCheck | ForEach-Object { $debugMsg += "$_, " }
|
||||
$debugMsg = $debugMsg -replace (',\s*$', '')
|
||||
Write-Debug "$debugMsg"
|
||||
}
|
||||
|
||||
foreach ($CheckBox in $CheckBoxes) {
|
||||
|
@ -30,7 +30,9 @@ function Invoke-WPFRunspace {
|
||||
|
||||
# Add Scriptblock and Arguments to runspace
|
||||
$script:powershell.AddScript($ScriptBlock)
|
||||
$script:powershell.AddArgument($ArgumentList)
|
||||
foreach ($Argument in $ArgumentList) {
|
||||
$script:powershell.AddArgument($Argument)
|
||||
}
|
||||
$script:powershell.AddArgument($DebugPreference) # Pass DebugPreference to the script block
|
||||
$script:powershell.RunspacePool = $sync.runspace
|
||||
|
||||
|
@ -15,23 +15,25 @@ function Invoke-WPFToggle {
|
||||
# Use this to get the name of the button
|
||||
#[System.Windows.MessageBox]::Show("$Button","Chris Titus Tech's Windows Utility","OK","Info")
|
||||
|
||||
$ToggleStatus = (Get-WinUtilToggleStatus $Button)
|
||||
|
||||
Switch -Wildcard ($Button) {
|
||||
|
||||
"WPFToggleDarkMode" {Invoke-WinUtilDarkMode -DarkMoveEnabled $(Get-WinUtilToggleStatus WPFToggleDarkMode)}
|
||||
"WPFToggleBingSearch" {Invoke-WinUtilBingSearch $(Get-WinUtilToggleStatus WPFToggleBingSearch)}
|
||||
"WPFToggleNumLock" {Invoke-WinUtilNumLock $(Get-WinUtilToggleStatus WPFToggleNumLock)}
|
||||
"WPFToggleVerboseLogon" {Invoke-WinUtilVerboseLogon $(Get-WinUtilToggleStatus WPFToggleVerboseLogon)}
|
||||
"WPFToggleShowExt" {Invoke-WinUtilShowExt $(Get-WinUtilToggleStatus WPFToggleShowExt)}
|
||||
"WPFToggleSnapWindow" {Invoke-WinUtilSnapWindow $(Get-WinUtilToggleStatus WPFToggleSnapWindow)}
|
||||
"WPFToggleSnapFlyout" {Invoke-WinUtilSnapFlyout $(Get-WinUtilToggleStatus WPFToggleSnapFlyout)}
|
||||
"WPFToggleSnapSuggestion" {Invoke-WinUtilSnapSuggestion $(Get-WinUtilToggleStatus WPFToggleSnapSuggestion)}
|
||||
"WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $(Get-WinUtilToggleStatus WPFToggleMouseAcceleration)}
|
||||
"WPFToggleStickyKeys" {Invoke-WinUtilStickyKeys $(Get-WinUtilToggleStatus WPFToggleStickyKeys)}
|
||||
"WPFToggleTaskbarWidgets" {Invoke-WinUtilTaskbarWidgets $(Get-WinUtilToggleStatus WPFToggleTaskbarWidgets)}
|
||||
"WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $(Get-WinUtilToggleStatus WPFToggleTaskbarSearch)}
|
||||
"WPFToggleTaskView" {Invoke-WinUtilTaskView $(Get-WinUtilToggleStatus WPFToggleTaskView)}
|
||||
"WPFToggleHiddenFiles" {Invoke-WinUtilHiddenFiles $(Get-WinUtilToggleStatus WPFToggleHiddenFiles)}
|
||||
"WPFToggleTaskbarAlignment" {Invoke-WinUtilTaskbarAlignment $(Get-WinUtilToggleStatus WPFToggleTaskbarAlignment)}
|
||||
"WPFToggleDetailedBSoD" {Invoke-WinUtilDetailedBSoD $(Get-WinUtilToggleStatus WPFToggleDetailedBSoD)}
|
||||
"WPFToggleDarkMode" {Invoke-WinUtilDarkMode $ToggleStatus}
|
||||
"WPFToggleBingSearch" {Invoke-WinUtilBingSearch $ToggleStatus}
|
||||
"WPFToggleNumLock" {Invoke-WinUtilNumLock $ToggleStatus}
|
||||
"WPFToggleVerboseLogon" {Invoke-WinUtilVerboseLogon $ToggleStatus}
|
||||
"WPFToggleShowExt" {Invoke-WinUtilShowExt $ToggleStatus}
|
||||
"WPFToggleSnapWindow" {Invoke-WinUtilSnapWindow $ToggleStatus}
|
||||
"WPFToggleSnapFlyout" {Invoke-WinUtilSnapFlyout $ToggleStatus}
|
||||
"WPFToggleSnapSuggestion" {Invoke-WinUtilSnapSuggestion $ToggleStatus}
|
||||
"WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $ToggleStatus}
|
||||
"WPFToggleStickyKeys" {Invoke-WinUtilStickyKeys $ToggleStatus}
|
||||
"WPFToggleTaskbarWidgets" {Invoke-WinUtilTaskbarWidgets $ToggleStatus}
|
||||
"WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $ToggleStatus}
|
||||
"WPFToggleTaskView" {Invoke-WinUtilTaskView $ToggleStatus}
|
||||
"WPFToggleHiddenFiles" {Invoke-WinUtilHiddenFiles $ToggleStatus}
|
||||
"WPFToggleTaskbarAlignment" {Invoke-WinUtilTaskbarAlignment $ToggleStatus}
|
||||
"WPFToggleDetailedBSoD" {Invoke-WinUtilDetailedBSoD $ToggleStatus}
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ function Invoke-WPFTweakPS7{
|
||||
Write-Host "Powershell 7 is already installed."
|
||||
} else {
|
||||
Write-Host "Installing Powershell 7..."
|
||||
Invoke-WinUtilWingetProgram -Action Install -Programs @("Microsoft.PowerShell")
|
||||
Install-WinUtilProgramWinget -Action Install -Programs @("Microsoft.PowerShell")
|
||||
}
|
||||
$targetTerminalName = "PowerShell"
|
||||
}
|
||||
|
319
functions/public/Invoke-WPFUIElements.ps1
Normal file
319
functions/public/Invoke-WPFUIElements.ps1
Normal file
@ -0,0 +1,319 @@
|
||||
function Invoke-WPFUIElements {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Adds UI elements to a specified Grid in the WinUtil GUI based on a JSON configuration.
|
||||
.PARAMETER configVariable
|
||||
The variable/link containing the JSON configuration.
|
||||
.PARAMETER targetGridName
|
||||
The name of the grid to which the UI elements should be added.
|
||||
.PARAMETER columncount
|
||||
The number of columns to be used in the Grid. If not provided, a default value is used based on the panel.
|
||||
.EXAMPLE
|
||||
Invoke-WPFUIElements -configVariable $sync.configs.applications -targetGridName "install" -columncount 5
|
||||
.NOTES
|
||||
Future me/contributer: If possible please wrap this into a runspace to make it load all panels at the same time.
|
||||
#>
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory, position=0)]
|
||||
[PSCustomObject]$configVariable,
|
||||
|
||||
[Parameter(Mandatory, position=1)]
|
||||
[string]$targetGridName,
|
||||
|
||||
[Parameter(Mandatory, position=2)]
|
||||
[int]$columncount
|
||||
)
|
||||
|
||||
$window = $sync["Form"]
|
||||
|
||||
$theme = $sync.configs.themes.$ctttheme
|
||||
$borderstyle = $window.FindResource("BorderStyle")
|
||||
$HoverTextBlockStyle = $window.FindResource("HoverTextBlockStyle")
|
||||
$ColorfulToggleSwitchStyle = $window.FindResource("ColorfulToggleSwitchStyle")
|
||||
|
||||
if (!$borderstyle -or !$HoverTextBlockStyle -or !$ColorfulToggleSwitchStyle) {
|
||||
throw "Failed to retrieve Styles using 'FindResource' from main window element."
|
||||
}
|
||||
|
||||
$targetGrid = $window.FindName($targetGridName)
|
||||
|
||||
if (!$targetGrid) {
|
||||
throw "Failed to retrieve Target Grid by name, provided name: $targetGrid"
|
||||
}
|
||||
|
||||
# Clear existing ColumnDefinitions and Children
|
||||
$targetGrid.ColumnDefinitions.Clear() | Out-Null
|
||||
$targetGrid.Children.Clear() | Out-Null
|
||||
|
||||
# Add ColumnDefinitions to the target Grid
|
||||
for ($i = 0; $i -lt $columncount; $i++) {
|
||||
$colDef = New-Object Windows.Controls.ColumnDefinition
|
||||
$colDef.Width = New-Object Windows.GridLength(1, [Windows.GridUnitType]::Star)
|
||||
$targetGrid.ColumnDefinitions.Add($colDef) | Out-Null
|
||||
}
|
||||
|
||||
# Convert PSCustomObject to Hashtable
|
||||
$configHashtable = @{}
|
||||
$configVariable.PSObject.Properties.Name | ForEach-Object {
|
||||
$configHashtable[$_] = $configVariable.$_
|
||||
}
|
||||
|
||||
$organizedData = @{}
|
||||
# Iterate through JSON data and organize by panel and category
|
||||
foreach ($entry in $configHashtable.Keys) {
|
||||
$entryInfo = $configHashtable[$entry]
|
||||
|
||||
# Create an object for the application
|
||||
$entryObject = [PSCustomObject]@{
|
||||
Name = $entry
|
||||
Order = $entryInfo.order
|
||||
Category = $entryInfo.Category
|
||||
Content = $entryInfo.Content
|
||||
Choco = $entryInfo.choco
|
||||
Winget = $entryInfo.winget
|
||||
Panel = if ($entryInfo.Panel) { $entryInfo.Panel } else { "0" }
|
||||
Link = $entryInfo.link
|
||||
Description = $entryInfo.description
|
||||
Type = $entryInfo.type
|
||||
ComboItems = $entryInfo.ComboItems
|
||||
Checked = $entryInfo.Checked
|
||||
ButtonWidth = $entryInfo.ButtonWidth
|
||||
}
|
||||
|
||||
if (-not $organizedData.ContainsKey($entryObject.Panel)) {
|
||||
$organizedData[$entryObject.Panel] = @{}
|
||||
}
|
||||
|
||||
if (-not $organizedData[$entryObject.Panel].ContainsKey($entryObject.Category)) {
|
||||
$organizedData[$entryObject.Panel][$entryObject.Category] = @()
|
||||
}
|
||||
|
||||
# Store application data in an array under the category
|
||||
$organizedData[$entryObject.Panel][$entryObject.Category] += $entryObject
|
||||
|
||||
# Only apply the logic for distributing entries across columns if the targetGridName is "appspanel"
|
||||
if ($targetGridName -eq "appspanel") {
|
||||
$panelcount = 0
|
||||
$entrycount = $configHashtable.Keys.Count + $organizedData["0"].Keys.Count
|
||||
$maxcount = [Math]::Round($entrycount / $columncount + 0.5)
|
||||
}
|
||||
}
|
||||
|
||||
# Iterate through 'organizedData' by panel, category, and application
|
||||
$count = 0
|
||||
foreach ($panelKey in ($organizedData.Keys | Sort-Object)) {
|
||||
# Create a Border for each column
|
||||
$border = New-Object Windows.Controls.Border
|
||||
$border.VerticalAlignment = "Stretch" # Ensure the border stretches vertically
|
||||
[System.Windows.Controls.Grid]::SetColumn($border, $panelcount)
|
||||
$border.style = $borderstyle
|
||||
$targetGrid.Children.Add($border) | Out-Null
|
||||
|
||||
# Create a StackPanel inside the Border
|
||||
$stackPanel = New-Object Windows.Controls.StackPanel
|
||||
$stackPanel.Background = [Windows.Media.Brushes]::Transparent
|
||||
$stackPanel.SnapsToDevicePixels = $true
|
||||
$stackPanel.VerticalAlignment = "Stretch" # Ensure the stack panel stretches vertically
|
||||
$border.Child = $stackPanel
|
||||
$panelcount++
|
||||
|
||||
foreach ($category in ($organizedData[$panelKey].Keys | Sort-Object)) {
|
||||
$count++
|
||||
if ($targetGridName -eq "appspanel" -and $columncount -gt 0) {
|
||||
$panelcount2 = [Int](($count) / $maxcount - 0.5)
|
||||
if ($panelcount -eq $panelcount2) {
|
||||
# Create a new Border for the new column
|
||||
$border = New-Object Windows.Controls.Border
|
||||
$border.VerticalAlignment = "Stretch" # Ensure the border stretches vertically
|
||||
[System.Windows.Controls.Grid]::SetColumn($border, $panelcount)
|
||||
$border.style = $borderstyle
|
||||
$targetGrid.Children.Add($border) | Out-Null
|
||||
|
||||
# Create a new StackPanel inside the Border
|
||||
$stackPanel = New-Object Windows.Controls.StackPanel
|
||||
$stackPanel.Background = [Windows.Media.Brushes]::Transparent
|
||||
$stackPanel.SnapsToDevicePixels = $true
|
||||
$stackPanel.VerticalAlignment = "Stretch" # Ensure the stack panel stretches vertically
|
||||
$border.Child = $stackPanel
|
||||
$panelcount++
|
||||
}
|
||||
}
|
||||
|
||||
$label = New-Object Windows.Controls.Label
|
||||
$label.Content = $category -replace ".*__", ""
|
||||
$label.FontSize = $theme.FontSizeHeading
|
||||
$label.FontFamily = $theme.HeaderFontFamily
|
||||
$stackPanel.Children.Add($label) | Out-Null
|
||||
|
||||
$sync[$category] = $label
|
||||
|
||||
# Sort entries by Order and then by Name, but only display Name
|
||||
$entries = $organizedData[$panelKey][$category] | Sort-Object Order, Name
|
||||
foreach ($entryInfo in $entries) {
|
||||
$count++
|
||||
if ($targetGridName -eq "appspanel" -and $columncount -gt 0) {
|
||||
$panelcount2 = [Int](($count) / $maxcount - 0.5)
|
||||
if ($panelcount -eq $panelcount2) {
|
||||
# Create a new Border for the new column
|
||||
$border = New-Object Windows.Controls.Border
|
||||
$border.VerticalAlignment = "Stretch" # Ensure the border stretches vertically
|
||||
[System.Windows.Controls.Grid]::SetColumn($border, $panelcount)
|
||||
$border.style = $borderstyle
|
||||
$targetGrid.Children.Add($border) | Out-Null
|
||||
|
||||
# Create a new StackPanel inside the Border
|
||||
$stackPanel = New-Object Windows.Controls.StackPanel
|
||||
$stackPanel.Background = [Windows.Media.Brushes]::Transparent
|
||||
$stackPanel.SnapsToDevicePixels = $true
|
||||
$stackPanel.VerticalAlignment = "Stretch" # Ensure the stack panel stretches vertically
|
||||
$border.Child = $stackPanel
|
||||
$panelcount++
|
||||
}
|
||||
}
|
||||
|
||||
switch ($entryInfo.Type) {
|
||||
"Toggle" {
|
||||
$dockPanel = New-Object Windows.Controls.DockPanel
|
||||
$checkBox = New-Object Windows.Controls.CheckBox
|
||||
$checkBox.Name = $entryInfo.Name
|
||||
$checkBox.HorizontalAlignment = "Right"
|
||||
$dockPanel.Children.Add($checkBox) | Out-Null
|
||||
$checkBox.Style = $ColorfulToggleSwitchStyle
|
||||
|
||||
$label = New-Object Windows.Controls.Label
|
||||
$label.Content = $entryInfo.Content
|
||||
$label.ToolTip = $entryInfo.Description
|
||||
$label.HorizontalAlignment = "Left"
|
||||
$label.FontSize = $theme.FontSize
|
||||
$label.Foreground = $theme.MainForegroundColor
|
||||
$dockPanel.Children.Add($label) | Out-Null
|
||||
$stackPanel.Children.Add($dockPanel) | Out-Null
|
||||
|
||||
$sync[$entryInfo.Name] = $checkBox
|
||||
|
||||
$sync[$entryInfo.Name].IsChecked = Get-WinUtilToggleStatus $sync[$entryInfo.Name].Name
|
||||
|
||||
$sync[$entryInfo.Name].Add_Click({
|
||||
[System.Object]$Sender = $args[0]
|
||||
Invoke-WPFToggle $Sender.name
|
||||
})
|
||||
}
|
||||
|
||||
"ToggleButton" {
|
||||
$toggleButton = New-Object Windows.Controls.ToggleButton
|
||||
$toggleButton.Name = $entryInfo.Name
|
||||
$toggleButton.Name = "WPFTab" + ($stackPanel.Children.Count + 1) + "BT"
|
||||
$toggleButton.HorizontalAlignment = "Left"
|
||||
$toggleButton.Height = $theme.TabButtonHeight
|
||||
$toggleButton.Width = $theme.TabButtonWidth
|
||||
$toggleButton.Background = $theme.ButtonInstallBackgroundColor
|
||||
$toggleButton.Foreground = [Windows.Media.Brushes]::White
|
||||
$toggleButton.FontWeight = [Windows.FontWeights]::Bold
|
||||
|
||||
$textBlock = New-Object Windows.Controls.TextBlock
|
||||
$textBlock.FontSize = $theme.TabButtonFontSize
|
||||
$textBlock.Background = [Windows.Media.Brushes]::Transparent
|
||||
$textBlock.Foreground = $theme.ButtonInstallForegroundColor
|
||||
|
||||
$underline = New-Object Windows.Documents.Underline
|
||||
$underline.Inlines.Add($entryInfo.name -replace "(.).*", "`$1")
|
||||
|
||||
$run = New-Object Windows.Documents.Run
|
||||
$run.Text = $entryInfo.name -replace "^.", ""
|
||||
|
||||
$textBlock.Inlines.Add($underline)
|
||||
$textBlock.Inlines.Add($run)
|
||||
|
||||
$toggleButton.Content = $textBlock
|
||||
|
||||
$stackPanel.Children.Add($toggleButton) | Out-Null
|
||||
|
||||
$sync[$entryInfo.Name] = $toggleButton
|
||||
}
|
||||
|
||||
"Combobox" {
|
||||
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
||||
$horizontalStackPanel.Orientation = "Horizontal"
|
||||
$horizontalStackPanel.Margin = "0,5,0,0"
|
||||
|
||||
$label = New-Object Windows.Controls.Label
|
||||
$label.Content = $entryInfo.Content
|
||||
$label.HorizontalAlignment = "Left"
|
||||
$label.VerticalAlignment = "Center"
|
||||
$label.FontSize = $theme.ButtonFontSize
|
||||
$horizontalStackPanel.Children.Add($label) | Out-Null
|
||||
|
||||
$comboBox = New-Object Windows.Controls.ComboBox
|
||||
$comboBox.Name = $entryInfo.Name
|
||||
$comboBox.Height = $theme.ButtonHeight
|
||||
$comboBox.Width = $theme.ButtonWidth
|
||||
$comboBox.HorizontalAlignment = "Left"
|
||||
$comboBox.VerticalAlignment = "Center"
|
||||
$comboBox.Margin = $theme.ButtonMargin
|
||||
|
||||
foreach ($comboitem in ($entryInfo.ComboItems -split " ")) {
|
||||
$comboBoxItem = New-Object Windows.Controls.ComboBoxItem
|
||||
$comboBoxItem.Content = $comboitem
|
||||
$comboBoxItem.FontSize = $theme.ButtonFontSize
|
||||
$comboBox.Items.Add($comboBoxItem) | Out-Null
|
||||
}
|
||||
|
||||
$horizontalStackPanel.Children.Add($comboBox) | Out-Null
|
||||
$stackPanel.Children.Add($horizontalStackPanel) | Out-Null
|
||||
|
||||
$comboBox.SelectedIndex = 0
|
||||
|
||||
$sync[$entryInfo.Name] = $comboBox
|
||||
}
|
||||
|
||||
"Button" {
|
||||
$button = New-Object Windows.Controls.Button
|
||||
$button.Name = $entryInfo.Name
|
||||
$button.Content = $entryInfo.Content
|
||||
$button.HorizontalAlignment = "Left"
|
||||
$button.Margin = $theme.ButtonMargin
|
||||
$button.FontSize = $theme.ButtonFontSize
|
||||
if ($entryInfo.ButtonWidth) {
|
||||
$button.Width = $entryInfo.ButtonWidth
|
||||
}
|
||||
$stackPanel.Children.Add($button) | Out-Null
|
||||
|
||||
$sync[$entryInfo.Name] = $button
|
||||
}
|
||||
|
||||
default {
|
||||
$horizontalStackPanel = New-Object Windows.Controls.StackPanel
|
||||
$horizontalStackPanel.Orientation = "Horizontal"
|
||||
|
||||
$checkBox = New-Object Windows.Controls.CheckBox
|
||||
$checkBox.Name = $entryInfo.Name
|
||||
$checkBox.Content = $entryInfo.Content
|
||||
$checkBox.FontSize = $theme.FontSize
|
||||
$checkBox.ToolTip = $entryInfo.Description
|
||||
$checkBox.Margin = $theme.CheckBoxMargin
|
||||
if ($entryInfo.Checked) {
|
||||
$checkBox.IsChecked = $entryInfo.Checked
|
||||
}
|
||||
$horizontalStackPanel.Children.Add($checkBox) | Out-Null
|
||||
|
||||
if ($entryInfo.Link) {
|
||||
$textBlock = New-Object Windows.Controls.TextBlock
|
||||
$textBlock.Name = $checkBox.Name + "Link"
|
||||
$textBlock.Text = "(?)"
|
||||
$textBlock.ToolTip = $entryInfo.Link
|
||||
$textBlock.Style = $HoverTextBlockStyle
|
||||
|
||||
$horizontalStackPanel.Children.Add($textBlock) | Out-Null
|
||||
|
||||
$sync[$textBlock.Name] = $textBlock
|
||||
}
|
||||
|
||||
$stackPanel.Children.Add($horizontalStackPanel) | Out-Null
|
||||
$sync[$entryInfo.Name] = $checkBox
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -2,43 +2,65 @@ Function Invoke-WPFUltimatePerformance {
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Creates or removes the Ultimate Performance power scheme
|
||||
Enables or disables the Ultimate Performance power scheme based on its GUID.
|
||||
|
||||
.PARAMETER State
|
||||
Indicates whether to enable or disable the Ultimate Performance power scheme
|
||||
Specifies whether to "Enable" or "Disable" the Ultimate Performance power scheme.
|
||||
|
||||
#>
|
||||
param($State)
|
||||
|
||||
try {
|
||||
# Check if Ultimate Performance plan is installed
|
||||
$ultimatePlan = powercfg -list | Select-String -Pattern "Ultimate Performance"
|
||||
if($state -eq "Enable") {
|
||||
if ($ultimatePlan) {
|
||||
Write-Host "Ultimate Performance plan is already installed."
|
||||
} else {
|
||||
Write-Host "Installing Ultimate Performance plan..."
|
||||
powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61
|
||||
Write-Host "> Ultimate Performance plan installed."
|
||||
# GUID of the Ultimate Performance power plan
|
||||
$ultimateGUID = "e9a42b02-d5df-448d-aa00-03f14749eb61"
|
||||
|
||||
if ($State -eq "Enable") {
|
||||
# Duplicate the Ultimate Performance power plan using its GUID
|
||||
$duplicateOutput = powercfg /duplicatescheme $ultimateGUID
|
||||
|
||||
$guid = $null
|
||||
$nameFromFile = "ChrisTitus - Ultimate Power Plan"
|
||||
$description = "Ultimate Power Plan, added via WinUtils"
|
||||
|
||||
# Extract the new GUID from the duplicateOutput
|
||||
foreach ($line in $duplicateOutput) {
|
||||
if ($line -match "\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b") {
|
||||
$guid = $matches[0] # $matches[0] will contain the first match, which is the GUID
|
||||
Write-Output "GUID: $guid has been extracted and stored in the variable."
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
# Set the Ultimate Performance plan as active
|
||||
$ultimatePlanGUID = (powercfg -list | Select-String -Pattern "Ultimate Performance").Line.Split()[3]
|
||||
powercfg -setactive $ultimatePlanGUID
|
||||
if (-not $guid) {
|
||||
Write-Output "No GUID found in the duplicateOutput. Check the output format."
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Ultimate Performance plan is now active."
|
||||
# Change the name of the power plan and set its description
|
||||
$changeNameOutput = powercfg /changename $guid "$nameFromFile" "$description"
|
||||
Write-Output "The power plan name and description have been changed. Output:"
|
||||
Write-Output $changeNameOutput
|
||||
|
||||
# Set the duplicated Ultimate Performance plan as active
|
||||
$setActiveOutput = powercfg /setactive $guid
|
||||
Write-Output "The power plan has been set as active. Output:"
|
||||
Write-Output $setActiveOutput
|
||||
|
||||
}
|
||||
elseif($state -eq "Disable") {
|
||||
if ($ultimatePlan) {
|
||||
# Extract the GUID of the Ultimate Performance plan
|
||||
$ultimatePlanGUID = $ultimatePlan.Line.Split()[3]
|
||||
Write-Host "> Ultimate Performance plan installed and set as active."
|
||||
|
||||
} elseif ($State -eq "Disable") {
|
||||
# Check if the Ultimate Performance plan is installed by GUID
|
||||
$installedPlan = powercfg -list | Select-String -Pattern $ultimateGUID
|
||||
|
||||
if ($installedPlan) {
|
||||
# Extract the GUID of the installed Ultimate Performance plan
|
||||
$ultimatePlanGUID = $installedPlan.Line.Split()[3]
|
||||
|
||||
# Set a different power plan as active before deleting the Ultimate Performance plan
|
||||
$balancedPlanGUID = (powercfg -list | Select-String -Pattern "Balanced").Line.Split()[3]
|
||||
powercfg -setactive $balancedPlanGUID
|
||||
|
||||
# Delete the Ultimate Performance plan
|
||||
# Delete the Ultimate Performance plan by GUID
|
||||
powercfg -delete $ultimatePlanGUID
|
||||
|
||||
Write-Host "Ultimate Performance plan has been uninstalled."
|
||||
@ -48,6 +70,6 @@ Function Invoke-WPFUltimatePerformance {
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
Write-Warning $psitem.Exception.Message
|
||||
Write-Error "Error occurred: $_"
|
||||
}
|
||||
}
|
||||
|
@ -28,38 +28,51 @@ function Invoke-WPFUnInstall {
|
||||
$confirm = [System.Windows.MessageBox]::Show($Messageboxbody, $MessageboxTitle, $ButtonType, $MessageIcon)
|
||||
|
||||
if($confirm -eq "No") {return}
|
||||
$ChocoPreference = $($sync.WPFpreferChocolatey.IsChecked)
|
||||
|
||||
|
||||
Invoke-WPFRunspace -ArgumentList $PackagesToInstall -DebugPreference $DebugPreference -ScriptBlock {
|
||||
param($PackagesToInstall, $DebugPreference)
|
||||
Invoke-WPFRunspace -ArgumentList $PackagesToInstall, $ChocoPreference -DebugPreference $DebugPreference -ScriptBlock {
|
||||
param($PackagesToInstall, $ChocoPreference, $DebugPreference)
|
||||
if ($PackagesToInstall.count -eq 1) {
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Indeterminate" -value 0.01 -overlay "logo" })
|
||||
} else {
|
||||
$sync.form.Dispatcher.Invoke([action]{ Set-WinUtilTaskbaritem -state "Normal" -value 0.01 -overlay "logo" })
|
||||
}
|
||||
$packagesWinget, $packagesChoco = {
|
||||
$packagesWinget = [System.Collections.Generic.List`1[System.Object]]::new()
|
||||
$packagesChoco = [System.Collections.Generic.List`1[System.Object]]::new()
|
||||
foreach ($package in $PackagesToInstall) {
|
||||
if ($package.winget -eq "na") {
|
||||
$packagesChoco.add($package)
|
||||
Write-Host "Queueing $($package.choco) for Chocolatey Uninstall"
|
||||
$packagesWinget = [System.Collections.ArrayList]::new()
|
||||
$packagesChoco = [System.Collections.ArrayList]::new()
|
||||
|
||||
foreach ($package in $PackagesToInstall) {
|
||||
if ($ChocoPreference) {
|
||||
if ($package.choco -eq "na") {
|
||||
$packagesWinget.add($package.winget)
|
||||
Write-Host "Queueing $($package.winget) for Winget uninstall"
|
||||
} else {
|
||||
$packagesWinget.add($($package.winget))
|
||||
Write-Host "Queueing $($package.winget) for Winget Uninstall"
|
||||
$null = $packagesChoco.add($package.choco)
|
||||
Write-Host "Queueing $($package.choco) for Chocolatey uninstall"
|
||||
}
|
||||
}
|
||||
return $packagesWinget, $packagesChoco
|
||||
else {
|
||||
if ($package.winget -eq "na") {
|
||||
$packagesChoco.add($package.choco)
|
||||
Write-Host "Queueing $($package.choco) for Chocolatey uninstall"
|
||||
} else {
|
||||
$null = $packagesWinget.add($($package.winget))
|
||||
Write-Host "Queueing $($package.winget) for Winget uninstall"
|
||||
}
|
||||
}
|
||||
}
|
||||
return $packagesWinget, $packagesChoco
|
||||
}.Invoke($PackagesToInstall)
|
||||
|
||||
try {
|
||||
$sync.ProcessRunning = $true
|
||||
|
||||
# Install all selected programs in new window
|
||||
if($packagesWinget.Count -gt 0) {
|
||||
Invoke-WinUtilWingetProgram -Action Uninstall -Programs $packagesWinget
|
||||
Install-WinUtilProgramWinget -Action Uninstall -Programs $packagesWinget
|
||||
}
|
||||
if($packagesChoco.Count -gt 0) {
|
||||
Install-WinUtilProgramChoco -ProgramsToInstall $packagesChoco -Manage "Uninstalling"
|
||||
Install-WinUtilProgramChoco -Action Uninstall -Programs $packagesChoco
|
||||
}
|
||||
|
||||
Write-Host "==========================================="
|
||||
|
@ -1,5 +1,12 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block header %}
|
||||
{{ super() }}
|
||||
<div style="color: red; text-align: center; padding: 10px; font-size: 20px;">
|
||||
<strong>Announcement:</strong> We are currently not adding any applications to WinUtil and any apps that will be added through a PR will be declined by the maintainer.
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{# Empty block to override the footer #}
|
||||
{% endblock %}
|
||||
|
@ -37,6 +37,12 @@ Describe "Config Files" -ForEach @(
|
||||
$result = New-Object System.Collections.Generic.List[System.Object]
|
||||
Foreach ($application in $applications) {
|
||||
$compare = $global:importedconfigs.$name.$application | Get-Member -MemberType NoteProperty | Select-Object -ExpandProperty name
|
||||
if (-not $compare) {
|
||||
throw "Comparison object for application '$application' is null."
|
||||
}
|
||||
if (-not $template) {
|
||||
throw "Template object for application '$application' is null."
|
||||
}
|
||||
if ($(Compare-Object $compare $template) -ne $null) {
|
||||
$result.Add($application)
|
||||
}
|
||||
|
115
scripts/main.ps1
115
scripts/main.ps1
@ -32,19 +32,19 @@ $sync.runspace.Open()
|
||||
# Create classes for different exceptions
|
||||
|
||||
class WingetFailedInstall : Exception {
|
||||
[string] $additionalData
|
||||
[string]$additionalData
|
||||
|
||||
WingetFailedInstall($Message) : base($Message) {}
|
||||
}
|
||||
|
||||
class ChocoFailedInstall : Exception {
|
||||
[string] $additionalData
|
||||
[string]$additionalData
|
||||
|
||||
ChocoFailedInstall($Message) : base($Message) {}
|
||||
}
|
||||
|
||||
class GenericException : Exception {
|
||||
[string] $additionalData
|
||||
[string]$additionalData
|
||||
|
||||
GenericException($Message) : base($Message) {}
|
||||
}
|
||||
@ -52,6 +52,7 @@ $sync.runspace.Open()
|
||||
|
||||
$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^<Win.*', '<Window'
|
||||
|
||||
$defaulttheme = '_default'
|
||||
if ((Get-WinUtilToggleStatus WPFToggleDarkMode) -eq $True) {
|
||||
if (Invoke-WinUtilGPU -eq $True) {
|
||||
$ctttheme = 'Matrix'
|
||||
@ -61,44 +62,70 @@ if ((Get-WinUtilToggleStatus WPFToggleDarkMode) -eq $True) {
|
||||
} else {
|
||||
$ctttheme = 'Classic'
|
||||
}
|
||||
$inputXML = Set-WinUtilUITheme -inputXML $inputXML -themeName $ctttheme
|
||||
|
||||
$returnVal = Set-WinUtilUITheme -inputXML $inputXML -customThemeName $ctttheme -defaultThemeName $defaulttheme
|
||||
if ($returnVal[0] -eq "") {
|
||||
Write-Host "Failed to statically apply theming to xaml content using Set-WinUtilTheme, please check previous Error/Warning messages." -ForegroundColor Red
|
||||
Write-Host "Quitting winutil..." -ForegroundColor Red
|
||||
$sync.runspace.Dispose()
|
||||
$sync.runspace.Close()
|
||||
[System.GC]::Collect()
|
||||
exit 1
|
||||
}
|
||||
$inputXML = $returnVal[0]
|
||||
$ctttheme = $returnVal[1]
|
||||
|
||||
[void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework')
|
||||
[xml]$XAML = $inputXML
|
||||
|
||||
# Read the XAML file
|
||||
$readerOperationSuccessful = $false # There's more cases of failure then success.
|
||||
$reader = (New-Object System.Xml.XmlNodeReader $xaml)
|
||||
try {
|
||||
$sync["Form"] = [Windows.Markup.XamlReader]::Load( $reader )
|
||||
$readerOperationSuccessful = $true
|
||||
} catch [System.Management.Automation.MethodInvocationException] {
|
||||
Write-Warning "We ran into a problem with the XAML code. Check the syntax for this control..."
|
||||
Write-Host "We ran into a problem with the XAML code. Check the syntax for this control..." -ForegroundColor Red
|
||||
Write-Host $error[0].Exception.Message -ForegroundColor Red
|
||||
|
||||
If ($error[0].Exception.Message -like "*button*") {
|
||||
write-warning "Ensure your <button in the `$inputXML does NOT have a Click=ButtonClick property. PS can't handle this`n`n`n`n"
|
||||
write-Host "Ensure your <button in the `$inputXML does NOT have a Click=ButtonClick property. PS can't handle this`n`n`n`n" -ForegroundColor Red
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed."
|
||||
Write-Host "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .net is installed." -ForegroundColor Red
|
||||
}
|
||||
|
||||
if (-NOT ($readerOperationSuccessful)) {
|
||||
Write-Host "Failed to parse xaml content using Windows.Markup.XamlReader's Load Method." -ForegroundColor Red
|
||||
Write-Host "Quitting winutil..." -ForegroundColor Red
|
||||
$sync.runspace.Dispose()
|
||||
$sync.runspace.Close()
|
||||
[System.GC]::Collect()
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Load the configuration files
|
||||
#Invoke-WPFUIElements -configVariable $sync.configs.nav -targetGridName "WPFMainGrid"
|
||||
Invoke-WPFUIElements -configVariable $sync.configs.applications -targetGridName "appspanel" -columncount 5
|
||||
Invoke-WPFUIElements -configVariable $sync.configs.tweaks -targetGridName "tweakspanel" -columncount 2
|
||||
Invoke-WPFUIElements -configVariable $sync.configs.feature -targetGridName "featurespanel" -columncount 2
|
||||
|
||||
#===========================================================================
|
||||
# Store Form Objects In PowerShell
|
||||
#===========================================================================
|
||||
|
||||
$xaml.SelectNodes("//*[@Name]") | ForEach-Object {$sync["$("$($psitem.Name)")"] = $sync["Form"].FindName($psitem.Name)}
|
||||
|
||||
#Persist the Chocolatey preference across winutil restarts
|
||||
$ChocoPreferencePath = "$env:LOCALAPPDATA\winutil\preferChocolatey.ini"
|
||||
$sync.WPFpreferChocolatey.Add_Checked({New-Item -Path $ChocoPreferencePath -Force })
|
||||
$sync.WPFpreferChocolatey.Add_Unchecked({Remove-Item $ChocoPreferencePath -Force})
|
||||
if (Test-Path $ChocoPreferencePath) {
|
||||
$sync.WPFpreferChocolatey.IsChecked = $true
|
||||
}
|
||||
|
||||
$sync.keys | ForEach-Object {
|
||||
if($sync.$psitem) {
|
||||
if($($sync["$psitem"].GetType() | Select-Object -ExpandProperty Name) -eq "CheckBox" `
|
||||
-and $sync["$psitem"].Name -like "WPFToggle*") {
|
||||
$sync["$psitem"].IsChecked = Get-WinUtilToggleStatus $sync["$psitem"].Name
|
||||
|
||||
$sync["$psitem"].Add_Click({
|
||||
[System.Object]$Sender = $args[0]
|
||||
Invoke-WPFToggle $Sender.name
|
||||
})
|
||||
}
|
||||
|
||||
if($($sync["$psitem"].GetType() | Select-Object -ExpandProperty Name) -eq "ToggleButton") {
|
||||
$sync["$psitem"].Add_Click({
|
||||
[System.Object]$Sender = $args[0]
|
||||
@ -356,27 +383,6 @@ Add-Type @"
|
||||
|
||||
})
|
||||
|
||||
$locale = (Get-Culture).Name
|
||||
|
||||
$sync["ISORelease"].Items.Add("23H2")
|
||||
$sync["ISORelease"].Items.Add("22H2")
|
||||
$sync["ISORelease"].Items.Add("21H2")
|
||||
$sync["ISORelease"].SelectedItem = "23H2"
|
||||
|
||||
$sync["ISOLanguage"].Items.Add($locale)
|
||||
if ($locale -ne "en-US") {
|
||||
$sync["ISOLanguage"].Items.Add("en-US")
|
||||
}
|
||||
$sync["ISOLanguage"].SelectedItem = $locale
|
||||
|
||||
if ($sync["ISOoption1"].IsChecked) {
|
||||
$sync["ISORelease"].Visibility = [System.Windows.Visibility]::Visible
|
||||
$sync["ISOLanguage"].Visibility = [System.Windows.Visibility]::Visible
|
||||
} else {
|
||||
$sync["ISORelease"].Visibility = [System.Windows.Visibility]::Collapsed
|
||||
$sync["ISOLanguage"].Visibility = [System.Windows.Visibility]::Collapsed
|
||||
}
|
||||
|
||||
# Load Checkboxes and Labels outside of the Filter function only once on startup for performance reasons
|
||||
$filter = Get-WinUtilVariables -Type CheckBox
|
||||
$CheckBoxes = ($sync.GetEnumerator()).where{ $psitem.Key -in $filter }
|
||||
@ -388,7 +394,6 @@ $labels = @{}
|
||||
$allCategories = $checkBoxes.Name | ForEach-Object {$sync.configs.applications.$_} | Select-Object -Unique -ExpandProperty category
|
||||
|
||||
$sync["SearchBar"].Add_TextChanged({
|
||||
|
||||
if ($sync.SearchBar.Text -ne "") {
|
||||
$sync.SearchBarClearButton.Visibility = "Visible"
|
||||
} else {
|
||||
@ -397,39 +402,40 @@ $sync["SearchBar"].Add_TextChanged({
|
||||
|
||||
$activeApplications = @()
|
||||
|
||||
$textToSearch = $sync.SearchBar.Text.ToLower()
|
||||
|
||||
foreach ($CheckBox in $CheckBoxes) {
|
||||
# Check if the checkbox is null or if it doesn't have content
|
||||
if ($CheckBox -eq $null -or $CheckBox.Value -eq $null -or $CheckBox.Value.Content -eq $null) {
|
||||
continue
|
||||
}
|
||||
|
||||
$textToSearch = $sync.SearchBar.Text.ToLower()
|
||||
$checkBoxName = $CheckBox.Key
|
||||
$textBlockName = $checkBoxName + "Link"
|
||||
|
||||
# Retrieve the corresponding text block based on the generated name
|
||||
$textBlock = $sync[$textBlockName]
|
||||
|
||||
if ($CheckBox.Value.Content.ToLower().Contains($textToSearch)) {
|
||||
if ($CheckBox.Value.Content.ToString().ToLower().Contains($textToSearch)) {
|
||||
$CheckBox.Value.Visibility = "Visible"
|
||||
$activeApplications += $sync.configs.applications.$checkboxName
|
||||
# Set the corresponding text block visibility
|
||||
if ($textBlock -ne $null) {
|
||||
# Set the corresponding text block visibility
|
||||
if ($textBlock -ne $null -and $textBlock -is [System.Windows.Controls.TextBlock]) {
|
||||
$textBlock.Visibility = "Visible"
|
||||
}
|
||||
} else {
|
||||
$CheckBox.Value.Visibility = "Collapsed"
|
||||
$CheckBox.Value.Visibility = "Collapsed"
|
||||
# Set the corresponding text block visibility
|
||||
if ($textBlock -ne $null) {
|
||||
if ($textBlock -ne $null -and $textBlock -is [System.Windows.Controls.TextBlock]) {
|
||||
$textBlock.Visibility = "Collapsed"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$activeCategories = $activeApplications | Select-Object -ExpandProperty category -Unique
|
||||
|
||||
foreach ($category in $activeCategories) {
|
||||
$label = $labels[$(Get-WPFObjectName -type "Label" -name $category)]
|
||||
$label.Visibility = "Visible"
|
||||
$sync[$category].Visibility = "Visible"
|
||||
}
|
||||
if ($activeCategories) {
|
||||
$inactiveCategories = Compare-Object -ReferenceObject $allCategories -DifferenceObject $activeCategories -PassThru
|
||||
@ -437,8 +443,14 @@ $sync["SearchBar"].Add_TextChanged({
|
||||
$inactiveCategories = $allCategories
|
||||
}
|
||||
foreach ($category in $inactiveCategories) {
|
||||
$label = $labels[$(Get-WPFObjectName -type "Label" -name $category)]
|
||||
$label.Visibility = "Collapsed"}
|
||||
$sync[$category].Visibility = "Collapsed"
|
||||
}
|
||||
})
|
||||
|
||||
$sync["Form"].Add_Loaded({
|
||||
param($e)
|
||||
$sync["Form"].MaxWidth = [Double]::PositiveInfinity
|
||||
$sync["Form"].MaxHeight = [Double]::PositiveInfinity
|
||||
})
|
||||
|
||||
# Initialize the hashtable
|
||||
@ -446,9 +458,7 @@ $winutildir = @{}
|
||||
|
||||
# Set the path for the winutil directory
|
||||
$winutildir["path"] = "$env:LOCALAPPDATA\winutil\"
|
||||
if (-NOT (Test-Path -Path $winutildir["path"])) {
|
||||
New-Item -Path $winutildir["path"] -ItemType Directory
|
||||
}
|
||||
[System.IO.Directory]::CreateDirectory("$winutildir") | Out-Null
|
||||
|
||||
# Set the path for the logo and checkmark images
|
||||
$winutildir["logo.png"] = $winutildir["path"] + "cttlogo.png"
|
||||
@ -456,7 +466,6 @@ $winutildir["logo.ico"] = $winutildir["path"] + "cttlogo.ico"
|
||||
if (-NOT (Test-Path -Path $winutildir["logo.png"])) {
|
||||
Invoke-WebRequest -Uri "https://christitus.com/images/logo-full.png" -OutFile $winutildir["logo.png"]
|
||||
}
|
||||
|
||||
if (-NOT (Test-Path -Path $winutildir["logo.ico"])) {
|
||||
ConvertTo-Icon -bitmapPath $winutildir["logo.png"] -iconPath $winutildir["logo.ico"]
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
GitHub : https://github.com/ChrisTitusTech
|
||||
Version : #{replaceme}
|
||||
#>
|
||||
|
||||
param (
|
||||
[switch]$Debug,
|
||||
[string]$Config,
|
||||
@ -27,12 +28,6 @@ if ($Run) {
|
||||
$PARAM_RUN = $true
|
||||
}
|
||||
|
||||
if (!(Test-Path -Path $ENV:TEMP)) {
|
||||
New-Item -ItemType Directory -Force -Path $ENV:TEMP
|
||||
}
|
||||
|
||||
Start-Transcript $ENV:TEMP\Winutil.log -Append
|
||||
|
||||
# Load DLLs
|
||||
Add-Type -AssemblyName PresentationFramework
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
@ -44,15 +39,38 @@ $sync.version = "#{replaceme}"
|
||||
$sync.configs = @{}
|
||||
$sync.ProcessRunning = $false
|
||||
|
||||
# If script isn't running as admin, show error message and quit
|
||||
If (([Security.Principal.WindowsIdentity]::GetCurrent()).Owner.Value -ne "S-1-5-32-544") {
|
||||
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
|
||||
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||
Write-Output "Winutil needs to be run as Administrator. Attempting to relaunch."
|
||||
$argList = @()
|
||||
|
||||
$PSBoundParameters.GetEnumerator() | ForEach-Object {
|
||||
$argList += if ($_.Value -is [switch] -and $_.Value) {
|
||||
"-$($_.Key)"
|
||||
} elseif ($_.Value) {
|
||||
"-$($_.Key) `"$($_.Value)`""
|
||||
}
|
||||
}
|
||||
|
||||
$script = if ($MyInvocation.MyCommand.Path) {
|
||||
"& { & '$($MyInvocation.MyCommand.Path)' $argList }"
|
||||
} else {
|
||||
"iex '& { $(irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1) } $argList'"
|
||||
}
|
||||
|
||||
$powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" }
|
||||
$processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { $powershellcmd }
|
||||
|
||||
Start-Process $processCmd -ArgumentList "$powershellcmd -ExecutionPolicy Bypass -NoProfile -Command $script" -Verb RunAs
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
$dateTime = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"
|
||||
|
||||
$logdir = "$env:localappdata\winutil\logs"
|
||||
[System.IO.Directory]::CreateDirectory("$logdir") | Out-Null
|
||||
Start-Transcript -Path "$logdir\winutil_$dateTime.log" -Append -NoClobber | Out-Null
|
||||
|
||||
# Set PowerShell window title
|
||||
$Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Admin)"
|
||||
clear-host
|
||||
|
@ -1,4 +1,4 @@
|
||||
function Invoke-Preprocessing {
|
||||
function Invoke-Preprocessing {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
A function that does Code Formatting using RegEx, useful when trying to force specific coding standard(s) to a project.
|
||||
@ -39,7 +39,7 @@
|
||||
.EXAMPLE
|
||||
Invoke-Preprocessing -ThrowExceptionOnEmptyFilesList -WorkingDir "DRIVE:\Path\To\Folder\" -ExcludedFiles @('file.txt', '.\.git\', '*.png') -ProgressStatusMessage "Doing Preprocessing"
|
||||
|
||||
Same as Example No. 1, but will throw an exception when 'Invoke-Preprocessing' function doesn't find any files in 'WorkingDir' (not including 'ExcludedFiles' list).
|
||||
Same as Example No. 1, but uses '-ThrowExceptionOnEmptyFilesList', which's an optional parameter that'll make 'Invoke-Preprocessing' throw an exception when no files are found in 'WorkingDir' (not including the ExcludedFiles, of course), useful when you want to double check your parameters & you're sure there's files to process in the 'WorkingDir'.
|
||||
|
||||
.EXAMPLE
|
||||
Invoke-Preprocessing -Skip -WorkingDir "DRIVE:\Path\To\Folder\" -ExcludedFiles @('file.txt', '.\.git\', '*.png') -ProgressStatusMessage "Doing Preprocessing"
|
||||
@ -47,7 +47,7 @@
|
||||
Same as Example No. 1, but uses '-SkipExcludedFilesValidation', which'll skip the validation step for 'ExcludedFiles' list. This can be useful when 'ExcludedFiles' list is generated from another function, or from unreliable source (you can't guarantee every item in list is a valid path), but you want to silently continue through the function.
|
||||
#>
|
||||
|
||||
param (
|
||||
param (
|
||||
[Parameter(position=0)]
|
||||
[switch]$SkipExcludedFilesValidation,
|
||||
|
||||
@ -66,28 +66,86 @@
|
||||
|
||||
[Parameter(position=5)]
|
||||
[string]$ProgressActivity = "Preprocessing"
|
||||
)
|
||||
)
|
||||
|
||||
if (-NOT (Test-Path -PathType Container -Path "$WorkingDir")) {
|
||||
throw "[Invoke-Preprocessing] Invalid Paramter Value for 'WorkingDir', passed value: '$WorkingDir'. Either the path is a File or Non-Existing/Invlid, please double check your code."
|
||||
}
|
||||
|
||||
$count = $ExcludedFiles.Count
|
||||
if ((-NOT ($count -eq 0)) -AND (-NOT $SkipExcludedFilesValidation)) {
|
||||
|
||||
# Make sure there's a * at the end of folders in ExcludedFiles list
|
||||
for ($i = 0; $i -lt $count; $i++) {
|
||||
$excludedFile = $ExcludedFiles[$i]
|
||||
$isFolder = ($excludedFile) -match '\\$'
|
||||
if ($isFolder) { $ExcludedFiles[$i] = $excludedFile + '*' }
|
||||
}
|
||||
|
||||
# Validate the ExcludedFiles List before continuing on,
|
||||
# that's if there's a list in the first place, and '-SkipExcludedFilesValidation' was not provided.
|
||||
if (-not $SkipExcludedFilesValidation) {
|
||||
for ($i = 0; $i -lt $count; $i++) {
|
||||
$excludedFile = $ExcludedFiles[$i]
|
||||
$filePath = "$(($WorkingDir -replace ('\\$', '')) + '\' + ($excludedFile -replace ('\.\\', '')))"
|
||||
if (-NOT (Get-ChildItem -Recurse -Path "$filePath" -File)) {
|
||||
$failedFilesList += "'$filePath', "
|
||||
|
||||
# Handle paths with wildcards in a different implementation
|
||||
$matches = ($filePath) -match '^.*?\*'
|
||||
|
||||
if ($matches) {
|
||||
if (-NOT (Get-ChildItem -Recurse -Path "$filePath" -File -Force)) {
|
||||
$failedFilesList += "'$filePath', "
|
||||
}
|
||||
} else {
|
||||
if (-NOT (Test-Path -Path "$filePath")) {
|
||||
$failedFilesList += "'$filePath', "
|
||||
}
|
||||
}
|
||||
}
|
||||
$failedFilesList = $failedFilesList -replace (',\s*$', '')
|
||||
if (-NOT $failedFilesList -eq "") {
|
||||
throw "[Invoke-Preprocessing] One or more File Paths & File Patterns were not found, you can use '-SkipExcludedFilesValidation' switch to skip this check, and the failed files are: $failedFilesList"
|
||||
throw "[Invoke-Preprocessing] One or more File Paths and/or File Patterns were not found, you can use '-SkipExcludedFilesValidation' switch to skip this check, the failed to validate are: $failedFilesList"
|
||||
}
|
||||
}
|
||||
|
||||
$files = Get-ChildItem $WorkingDir -Recurse -Exclude $ExcludedFiles -File
|
||||
# Get Files List
|
||||
[System.Collections.ArrayList]$files = Get-ChildItem $WorkingDir -Recurse -Exclude $ExcludedFiles -File -Force
|
||||
$numOfFiles = $files.Count
|
||||
|
||||
# Only keep the 'FullName' Property for every entry in the list
|
||||
for ($i = 0; $i -lt $numOfFiles; $i++) {
|
||||
$file = $files[$i]
|
||||
$files[$i] = $file.FullName
|
||||
}
|
||||
|
||||
# If a file(s) are found in Exclude List,
|
||||
# Remove the file from files list.
|
||||
for ($j = 0; $j -lt $excludedFiles.Count; $j++) {
|
||||
# Prepare some variables
|
||||
$excluded = $excludedFiles[$j]
|
||||
$pathToFind = ($excluded) -replace ('^\.\\', '')
|
||||
$pathToFind = $WorkingDir + '\' + $pathToFind
|
||||
$index = -1 # reset index on every iteration
|
||||
|
||||
# Handle paths with wildcards in a different implementation
|
||||
$matches = ($pathToFind) -match '^.*?\*'
|
||||
|
||||
if ($matches) {
|
||||
$filesToCheck = Get-ChildItem -Recurse -Path "$pathToFind" -File -Force
|
||||
if ($filesToCheck) {
|
||||
for ($k = 0; $k -lt $filesToCheck.Count; $k++) {
|
||||
$fileToCheck = $filesToCheck[$k]
|
||||
$index = $files.IndexOf("$fileToCheck")
|
||||
if ($index -ge 0) { $files.RemoveAt($index) }
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$index = $files.IndexOf("$pathToFind")
|
||||
if ($index -ge 0) { $files.RemoveAt($index) }
|
||||
}
|
||||
}
|
||||
|
||||
# Make sure 'numOfFiles' is synced with the actual Number of Files found in '$files'
|
||||
# This's done because previous may or may not edit the files list, so we should update it
|
||||
$numOfFiles = $files.Count
|
||||
|
||||
if ($numOfFiles -eq 0) {
|
||||
@ -99,26 +157,11 @@
|
||||
}
|
||||
|
||||
for ($i = 0; $i -lt $numOfFiles; $i++) {
|
||||
$file = $files[$i]
|
||||
|
||||
# If the file is in Exclude List, don't proceed to check/modify said file.
|
||||
$fileIsExcluded = $False
|
||||
for ($j = 0; $j -lt $excludedFiles.Count; $j++) {
|
||||
$excluded = $excludedFiles[$j]
|
||||
$strToCompare = ($excluded) -replace ('^\.\\', '')
|
||||
if ($file.FullName.Contains("$strToCompare")) {
|
||||
$fileIsExcluded = $True
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if ($fileIsExcluded) {
|
||||
continue
|
||||
}
|
||||
$fullFileName = $files[$i]
|
||||
|
||||
# TODO:
|
||||
# make more formatting rules, and document them in WinUtil Official Documentation
|
||||
(Get-Content "$file").TrimEnd() `
|
||||
(Get-Content "$fullFileName").TrimEnd() `
|
||||
-replace ('\t', ' ') `
|
||||
-replace ('\)\s*\{', ') {') `
|
||||
-replace ('(?<keyword>if|for|foreach)\s*(?<condition>\([.*?]\))\s*\{', '${keyword} ${condition} {') `
|
||||
@ -129,8 +172,8 @@
|
||||
-replace ('\}\s*Catch', '} catch') `
|
||||
-replace ('\}\s*Catch\s*(?<exceptions>(\[.*?\]\s*(\,)?\s*)+)\s*\{', '} catch ${exceptions} {') `
|
||||
-replace ('\}\s*Catch\s*(?<exceptions>\[.*?\])\s*\{', '} catch ${exceptions} {') `
|
||||
-replace ('(?<parameter_type>\[.*?\])\s*(?<str_after_type>\$.*?(,|\s*\)))', '${parameter_type}${str_after_type}') `
|
||||
| Set-Content "$file"
|
||||
-replace ('(?<parameter_type>\[[^$0-9]+\])\s*(?<str_after_type>\$.*?)', '${parameter_type}${str_after_type}') `
|
||||
| Set-Content "$fullFileName"
|
||||
|
||||
Write-Progress -Activity $ProgressActivity -Status "$ProgressStatusMessage - Finished $i out of $numOfFiles" -PercentComplete (($i/$numOfFiles)*100)
|
||||
}
|
||||
|
15
windev.ps1
15
windev.ps1
@ -34,7 +34,20 @@ function RedirectToLatestPreRelease {
|
||||
Write-Host "Using latest Full Release"
|
||||
$url = "https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1"
|
||||
}
|
||||
Invoke-RestMethod $url | Invoke-Expression
|
||||
|
||||
$script = Invoke-RestMethod $url
|
||||
# Elevate Shell if necessary
|
||||
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||
Write-Output "Winutil needs to be run as Administrator. Attempting to relaunch."
|
||||
|
||||
$powershellcmd = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" }
|
||||
$processCmd = if (Get-Command wt.exe -ErrorAction SilentlyContinue) { "wt.exe" } else { $powershellcmd }
|
||||
|
||||
Start-Process $processCmd -ArgumentList "$powershellcmd -ExecutionPolicy Bypass -NoProfile -Command $(Invoke-Expression $script)" -Verb RunAs
|
||||
}
|
||||
else{
|
||||
Invoke-Expression $script
|
||||
}
|
||||
}
|
||||
|
||||
# Call the redirect function
|
||||
|
@ -9,7 +9,11 @@
|
||||
WindowStartupLocation="CenterScreen"
|
||||
UseLayoutRounding="True"
|
||||
WindowStyle="None"
|
||||
Title="Chris Titus Tech's Windows Utility" Height="800" Width="1280">
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
MaxWidth="1280"
|
||||
MaxHeight="800"
|
||||
Title="Chris Titus Tech's Windows Utility">
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome CaptionHeight="0" CornerRadius="10"/>
|
||||
</WindowChrome.WindowChrome>
|
||||
@ -213,7 +217,7 @@
|
||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundMouseoverColor}"/>
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect Opacity="1" ShadowDepth="5" Color="Gold" Direction="-100" BlurRadius="45"/>
|
||||
<DropShadowEffect Opacity="1" ShadowDepth="5" Color="{ButtonBackgroundMouseoverColor}" Direction="-100" BlurRadius="15"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Panel.ZIndex" Value="2000"/>
|
||||
@ -224,7 +228,7 @@
|
||||
<Setter TargetName="BackgroundBorder" Property="Background" Value="{ButtonBackgroundSelectedColor}"/>
|
||||
<Setter Property="Effect">
|
||||
<Setter.Value>
|
||||
<DropShadowEffect Opacity="1" ShadowDepth="2" Color="Gold" Direction="-111" BlurRadius="25"/>
|
||||
<DropShadowEffect Opacity="1" ShadowDepth="2" Color="{ButtonBackgroundMouseoverColor}" Direction="-111" BlurRadius="10"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
@ -284,12 +288,12 @@
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Foreground" Value="Red"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="10"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@ -305,17 +309,17 @@
|
||||
<Grid Background="{TemplateBinding Background}" Margin="{CheckBoxMargin}">
|
||||
<BulletDecorator Background="Transparent">
|
||||
<BulletDecorator.Bullet>
|
||||
<Grid Width="{CheckBoxBulletDecoratorFontSize}" Height="{CheckBoxBulletDecoratorFontSize}">
|
||||
<Grid Width="{CheckBoxBulletDecoratorSize}" Height="{CheckBoxBulletDecoratorSize}">
|
||||
<Border x:Name="Border"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Background="{ButtonBackgroundColor}"
|
||||
BorderThickness="1"
|
||||
Width="{Binding Path={CheckBoxBulletDecoratorFontSize}-2}"
|
||||
Height="{Binding Path={CheckBoxBulletDecoratorFontSize}-2}"
|
||||
Width="{Binding Path={CheckBoxBulletDecoratorSize}-2}"
|
||||
Height="{Binding Path={CheckBoxBulletDecoratorSize}-2}"
|
||||
Margin="2"
|
||||
SnapsToDevicePixels="True"/>
|
||||
<Path x:Name="CheckMark"
|
||||
Stroke="{TemplateBinding Foreground}"
|
||||
Stroke="{ToggleButtonOnColor}"
|
||||
StrokeThickness="2"
|
||||
Data="M 0 5 L 5 10 L 12 0"
|
||||
Visibility="Collapsed"/>
|
||||
@ -340,47 +344,6 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="RadioButton">
|
||||
<Setter Property="Foreground" Value="{MainForegroundColor}"/>
|
||||
<Setter Property="Background" Value="{MainBackgroundColor}"/>
|
||||
<Setter Property="FontSize" Value="{FontSize}" />
|
||||
<Setter Property="FontFamily" Value="{FontFamily}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="RadioButton">
|
||||
<StackPanel Orientation="Horizontal" Margin="{CheckBoxMargin}">
|
||||
<Grid Width="14" Height="14">
|
||||
<Ellipse x:Name="OuterCircle"
|
||||
Stroke="{ButtonBackgroundPressedColor}"
|
||||
Fill="{ButtonBackgroundColor}"
|
||||
StrokeThickness="1"
|
||||
Width="14"
|
||||
Height="14"
|
||||
SnapsToDevicePixels="True"/>
|
||||
<Ellipse x:Name="InnerCircle"
|
||||
Fill="{MainForegroundColor}"
|
||||
Width="8"
|
||||
Height="8"
|
||||
Visibility="Collapsed"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<ContentPresenter Margin="4,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
RecognizesAccessKey="True"/>
|
||||
</StackPanel>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="InnerCircle" Property="Visibility" Value="Visible"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="OuterCircle" Property="Stroke" Value="{BorderColor}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="ToggleSwitchStyle" TargetType="CheckBox">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@ -468,7 +431,11 @@
|
||||
Width="34" Height="17">
|
||||
<Ellipse x:Name="Ellipse" Fill="{MainForegroundColor}" Stretch="Uniform"
|
||||
Margin="2,2,2,1"
|
||||
HorizontalAlignment="Left" Width="12">
|
||||
HorizontalAlignment="Left" Width="10.8"
|
||||
RenderTransformOrigin="0.5, 0.5">
|
||||
<Ellipse.RenderTransform>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1" />
|
||||
</Ellipse.RenderTransform>
|
||||
</Ellipse>
|
||||
</Border>
|
||||
</Grid>
|
||||
@ -479,12 +446,35 @@
|
||||
<Setter TargetName="Border" Property="Background" Value="{LinkHoverForegroundColor}"/>
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Panel.ZIndex" Value="1000"/>
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="Ellipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
|
||||
To="1.1" Duration="0:0:0.1" />
|
||||
<DoubleAnimation Storyboard.TargetName="Ellipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
|
||||
To="1.1" Duration="0:0:0.1" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
<Trigger.ExitActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="Ellipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
|
||||
To="1.0" Duration="0:0:0.1" />
|
||||
<DoubleAnimation Storyboard.TargetName="Ellipse"
|
||||
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
|
||||
To="1.0" Duration="0:0:0.1" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.ExitActions>
|
||||
</Trigger>
|
||||
<Trigger Property="ToggleButton.IsChecked" Value="False">
|
||||
<Setter TargetName="Border" Property="Background" Value="{MainBackgroundColor}" />
|
||||
<Setter TargetName="Border" Property="BorderBrush" Value="{MainForegroundColor}" />
|
||||
<Setter TargetName="Ellipse" Property="Fill" Value="{MainForegroundColor}" />
|
||||
|
||||
<Setter TargetName="Border" Property="BorderBrush" Value="#707070" />
|
||||
<Setter TargetName="Ellipse" Property="Fill" Value="#707070" />
|
||||
</Trigger>
|
||||
|
||||
<Trigger Property="ToggleButton.IsChecked" Value="True">
|
||||
@ -543,7 +533,7 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Border">
|
||||
<Style x:Key="BorderStyle" TargetType="Border">
|
||||
<Setter Property="Background" Value="{MainBackgroundColor}"/>
|
||||
<Setter Property="BorderBrush" Value="{BorderColor}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
@ -703,10 +693,10 @@
|
||||
</ToggleButton>
|
||||
<Grid Background="{MainBackgroundColor}" ShowGridLines="False" Width="Auto" Height="Auto" HorizontalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="50px"/>
|
||||
<ColumnDefinition Width="50px"/>
|
||||
<ColumnDefinition Width="*"/> <!-- Main content area -->
|
||||
<ColumnDefinition Width="Auto"/> <!-- Space for options button -->
|
||||
<ColumnDefinition Width="Auto"/> <!-- Space for close button -->
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--
|
||||
@ -718,25 +708,26 @@
|
||||
Consider using a Math Solver, will help in making
|
||||
development of these things much easier
|
||||
-->
|
||||
<!-- Changed the font size from {SearchBarTextBoxFontSize} to 12. This now display the text box correctly in the text box.-->
|
||||
<TextBox
|
||||
Grid.Column="0"
|
||||
Width="{SearchBarWidth}"
|
||||
Height="{SearchBarHeight}"
|
||||
FontSize="12"
|
||||
FontSize="{SearchBarTextBoxFontSize}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
BorderThickness="1"
|
||||
Name="SearchBar"
|
||||
Foreground="{MainForegroundColor}" Background="{MainBackgroundColor}"
|
||||
Padding="3,3,30,0"
|
||||
Margin="5,0,0,0"
|
||||
ToolTip="Press Ctrl-F and type app name to filter application list below. Press Esc to reset the filter">
|
||||
</TextBox>
|
||||
<!--Changed the margin from 16 to 180, which now places the magnifying glass icon on the right side of the text box. Now able to see what is been searched for.-->
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
FontSize="{IconFontSize}"
|
||||
Margin="180,0,0,0"></TextBlock>
|
||||
Margin="180,0,0,0">
|
||||
</TextBlock>
|
||||
<!--
|
||||
TODO:
|
||||
Make this ClearButton Positioning react to
|
||||
@ -744,12 +735,12 @@
|
||||
Consider using a Math Solver, will help in making
|
||||
development of these things much easier
|
||||
-->
|
||||
<!-- changed the {SearchBarClearButtonMargin} value from 193 to 205, which now places the clear button on the outside of the text box. -->
|
||||
<Button Grid.Column="0"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
Name="SearchBarClearButton"
|
||||
Style="{StaticResource SearchBarClearButtonStyle}"
|
||||
Margin="205,0,0,0" Visibility="Collapsed"/>
|
||||
Margin="210,0,0,0" Visibility="Collapsed">
|
||||
</Button>
|
||||
|
||||
<ProgressBar
|
||||
Grid.Column="1"
|
||||
@ -788,7 +779,7 @@
|
||||
FontSize="{SettingsIconFontSize}"
|
||||
Width="{IconButtonSize}" Height="{IconButtonSize}"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||
Margin="0,5,5,0"
|
||||
Margin="5,5,5,0"
|
||||
FontFamily="Segoe MDL2 Assets"
|
||||
Content=""/>
|
||||
<Popup Grid.Column="2" Name="SettingsPopup"
|
||||
@ -797,8 +788,16 @@
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top">
|
||||
<Border Background="{MainBackgroundColor}" BorderBrush="{MainForegroundColor}" BorderThickness="1" CornerRadius="0" Margin="0">
|
||||
<StackPanel Background="{MainBackgroundColor}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<MenuItem FontSize="{ButtonFontSize}" Header="Import" Name="ImportMenuItem" Foreground="{MainForegroundColor}"/>
|
||||
<MenuItem FontSize="{ButtonFontSize}" Header="Export" Name="ExportMenuItem" Foreground="{MainForegroundColor}"/>
|
||||
<MenuItem FontSize="{ButtonFontSize}" Header="Import" Name="ImportMenuItem" Foreground="{MainForegroundColor}">
|
||||
<MenuItem.ToolTip>
|
||||
<ToolTip Content="Import Configuration from exported file."/>
|
||||
</MenuItem.ToolTip>
|
||||
</MenuItem>
|
||||
<MenuItem FontSize="{ButtonFontSize}" Header="Export" Name="ExportMenuItem" Foreground="{MainForegroundColor}">
|
||||
<MenuItem.ToolTip>
|
||||
<ToolTip Content="Export Selected Elements and copy execution command to clipboard."/>
|
||||
</MenuItem.ToolTip>
|
||||
</MenuItem>
|
||||
<Separator/>
|
||||
<MenuItem FontSize="{ButtonFontSize}" Header="About" Name="AboutMenuItem" Foreground="{MainForegroundColor}"/>
|
||||
<MenuItem FontSize="{ButtonFontSize}" Header="Sponsors" Name="SponsorMenuItem" Foreground="{MainForegroundColor}"/>
|
||||
@ -815,7 +814,7 @@
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||
Margin="0,5,5,0"
|
||||
FontFamily="Arial"
|
||||
Foreground="{MainForegroundColor}" FontSize="{IconFontSize}" Name="WPFCloseButton" />
|
||||
Foreground="{MainForegroundColor}" FontSize="{CloseIconFontSize}" Name="WPFCloseButton" />
|
||||
</Grid>
|
||||
|
||||
</DockPanel>
|
||||
@ -828,81 +827,100 @@
|
||||
<RowDefinition Height="45px"/>
|
||||
<RowDefinition Height="0.95*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Background="{MainBackgroundColor}" Orientation="Horizontal" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Column="0" Grid.ColumnSpan="3" Margin="5">
|
||||
<Button Name="WPFinstall" Content=" Install/Upgrade Selected" Margin="2" />
|
||||
<StackPanel Background="{MainBackgroundColor}" Orientation="Horizontal" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Column="0" Grid.ColumnSpan="3" Margin="{TabContentMargin}">
|
||||
<Button Name="WPFInstall" Content=" Install/Upgrade Selected" Margin="2" />
|
||||
<Button Name="WPFInstallUpgrade" Content=" Upgrade All" Margin="2"/>
|
||||
<Button Name="WPFuninstall" Content=" Uninstall Selected" Margin="2"/>
|
||||
<Button Name="WPFUninstall" Content=" Uninstall Selected" Margin="2"/>
|
||||
<Button Name="WPFGetInstalled" Content=" Get Installed" Margin="2"/>
|
||||
<Button Name="WPFclearWinget" Content=" Clear Selection" Margin="2"/>
|
||||
<Button Name="WPFClearInstallSelection" Content=" Clear Selection" Margin="2"/>
|
||||
<CheckBox Name="WPFpreferChocolatey" VerticalAlignment="Center" VerticalContentAlignment="Center">
|
||||
<TextBlock Text="Prefer Chocolatey" ToolTip="Prefers Chocolatey as Download Engine instead of Winget" VerticalAlignment="Center" />
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
|
||||
<ScrollViewer x:Name="scrollViewer" Grid.Row="1" Grid.Column="0" Padding="-1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
|
||||
<ScrollViewer x:Name="scrollViewer" Grid.Row="1" Grid.Column="0" Margin="{TabContentMargin}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
|
||||
BorderBrush="Transparent" BorderThickness="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
{{InstallPanel_applications}}
|
||||
<Grid Name="appspanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
<Rectangle Grid.Row="1" Grid.Column="0" Width="18" Height="18" Fill="{MainBackgroundColor}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Style="{StaticResource ScrollVisibilityRectangle}"/>
|
||||
<Rectangle Grid.Row="1" Grid.Column="0" Width="22" Height="22" Fill="{MainBackgroundColor}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Style="{StaticResource ScrollVisibilityRectangle}"/>
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Tweaks" Visibility="Collapsed" Name="WPFTab2">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<Grid Background="Transparent">
|
||||
<Grid>
|
||||
<!-- Main content area with a ScrollViewer -->
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="45px"/>
|
||||
<RowDefinition Height=".70*"/>
|
||||
<RowDefinition Height=".10*"/>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
{{InstallPanel_tweaks}}
|
||||
<StackPanel Background="{MainBackgroundColor}" Orientation="Horizontal" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5">
|
||||
<Label Content="Recommended Selections:" FontSize="{FontSize}" VerticalAlignment="Center" Margin="2"/>
|
||||
<Button Name="WPFstandard" Content=" Standard " Margin="2"/>
|
||||
<Button Name="WPFminimal" Content=" Minimal " Margin="2"/>
|
||||
<Button Name="WPFclear" Content=" Clear " Margin="2"/>
|
||||
<Button Name="WPFGetInstalledTweaks" Content=" Get Installed " Margin="2"/>
|
||||
</StackPanel>
|
||||
<Border Grid.ColumnSpan="2" Grid.Row="2" Grid.Column="0">
|
||||
<StackPanel Background="{MainBackgroundColor}" Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Padding="10">
|
||||
Note: Hover over items to get a better description. Please be careful as many of these tweaks will heavily modify your system.
|
||||
<LineBreak/>Recommended selections are for normal users and if you are unsure do NOT check anything else!
|
||||
</TextBlock>
|
||||
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="0" Margin="{TabContentMargin}">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="45px"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Background="{MainBackgroundColor}" Orientation="Horizontal" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="5">
|
||||
<Label Content="Recommended Selections:" FontSize="{FontSize}" VerticalAlignment="Center" Margin="2"/>
|
||||
<Button Name="WPFstandard" Content=" Standard " Margin="2"/>
|
||||
<Button Name="WPFminimal" Content=" Minimal " Margin="2"/>
|
||||
<Button Name="WPFClearTweaksSelection" Content=" Clear " Margin="2"/>
|
||||
<Button Name="WPFGetInstalledTweaks" Content=" Get Installed " Margin="2"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Name="tweakspanel" Grid.Row="1">
|
||||
<!-- Your tweakspanel content goes here -->
|
||||
</Grid>
|
||||
|
||||
<Border Grid.ColumnSpan="2" Grid.Row="2" Grid.Column="0" Style="{StaticResource BorderStyle}">
|
||||
<StackPanel Background="{MainBackgroundColor}" Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Padding="10">
|
||||
Note: Hover over items to get a better description. Please be careful as many of these tweaks will heavily modify your system.
|
||||
<LineBreak/>Recommended selections are for normal users and if you are unsure do NOT check anything else!
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
<Border Grid.Row="1" Background="{MainBackgroundColor}" BorderBrush="{BorderColor}" BorderThickness="1" CornerRadius="5" HorizontalAlignment="Stretch" Padding="10">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0">
|
||||
<Button Name="WPFTweaksbutton" Content="Run Tweaks" Margin="5"/>
|
||||
<Button Name="WPFUndoall" Content="Undo Selected Tweaks" Margin="5"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Config" Visibility="Collapsed" Name="WPFTab3">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<Grid Background="Transparent">
|
||||
{{InstallPanel_features}}
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="{TabContentMargin}">
|
||||
<Grid Name="featurespanel" Grid.Row="1" Background="Transparent">
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Updates" Visibility="Collapsed" Name="WPFTab4">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="{TabContentMargin}">
|
||||
<Grid Background="Transparent">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Grid.Row="0" Grid.Column="0">
|
||||
<Border Grid.Row="0" Grid.Column="0" Style="{StaticResource BorderStyle}">
|
||||
<StackPanel Background="{MainBackgroundColor}" SnapsToDevicePixels="True">
|
||||
<Button Name="WPFUpdatesdefault" FontSize="{ConfigTabButtonFontSize}" Height="Auto" Width="Auto" Content="Default (Out of Box) Settings" Margin="20,4,20,10" Padding="10"/>
|
||||
<TextBlock Margin="20,0,20,0" Padding="10" TextWrapping="WrapWithOverflow" MaxWidth="300">This is the default settings that come with Windows. <LineBreak/><LineBreak/> No modifications are made and will remove any custom windows update settings.<LineBreak/><LineBreak/>Note: If you still encounter update errors, reset all updates in the config tab. That will restore ALL Microsoft Update Services from their servers and reinstall them to default settings.</TextBlock>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Grid.Row="0" Grid.Column="1">
|
||||
<Border Grid.Row="0" Grid.Column="1" Style="{StaticResource BorderStyle}">
|
||||
<StackPanel Background="{MainBackgroundColor}" SnapsToDevicePixels="True">
|
||||
<Button Name="WPFUpdatessecurity" FontSize="{ConfigTabButtonFontSize}" Height="Auto" Width="Auto" Content="Security (Recommended) Settings" Margin="20,4,20,10" Padding="10"/>
|
||||
<TextBlock Margin="20,0,20,0" Padding="10" TextWrapping="WrapWithOverflow" MaxWidth="300">This is my recommended setting I use on all computers.<LineBreak/><LineBreak/> It will delay feature updates by 2 years and will install security updates 4 days after release.<LineBreak/><LineBreak/>Feature Updates: Adds features and often bugs to systems when they are released. You want to delay these as long as possible.<LineBreak/><LineBreak/>Security Updates: Typically these are pressing security flaws that need to be patched quickly. You only want to delay these a couple of days just to see if they are safe and don't break other systems. You don't want to go without these for ANY extended periods of time.</TextBlock>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Grid.Row="0" Grid.Column="2">
|
||||
<Border Grid.Row="0" Grid.Column="2" Style="{StaticResource BorderStyle}">
|
||||
<StackPanel Background="{MainBackgroundColor}" SnapsToDevicePixels="True">
|
||||
<Button Name="WPFUpdatesdisable" FontSize="{ConfigTabButtonFontSize}" Height="Auto" Width="Auto" Content="Disable ALL Updates (NOT RECOMMENDED!)" Margin="20,4,20,10" Padding="10,10,10,10"/>
|
||||
<TextBlock Margin="20,0,20,0" Padding="10" TextWrapping="WrapWithOverflow" MaxWidth="300">This completely disables ALL Windows Updates and is NOT RECOMMENDED.<LineBreak/><LineBreak/> However, it can be suitable if you use your system for a select purpose and do not actively browse the internet. <LineBreak/><LineBreak/>Note: Your system will be easier to hack and infect without security updates.</TextBlock>
|
||||
@ -913,7 +931,7 @@
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="MicroWin" Visibility="Collapsed" Name="WPFTab5">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="{TabContentMargin}">
|
||||
<Grid Width="Auto" Height="Auto">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@ -923,16 +941,17 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Grid.Column="0"
|
||||
Style="{StaticResource BorderStyle}"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch">
|
||||
<StackPanel Name="MicrowinMain" Background="{MainBackgroundColor}" SnapsToDevicePixels="True" Grid.Column="0" Grid.Row="0">
|
||||
<StackPanel Background="Transparent" SnapsToDevicePixels="True" Margin="1">
|
||||
<CheckBox x:Name="WPFMicrowinDownloadFromGitHub" Content="Download oscdimg.exe from CTT Github repo" IsChecked="False" Margin="-10,1,1,1" />
|
||||
<CheckBox x:Name="WPFMicrowinDownloadFromGitHub" Content="Download oscdimg.exe from CTT Github repo" IsChecked="False" Margin="{MicrowinCheckBoxMargin}" />
|
||||
<TextBlock Margin="5" Padding="1" TextWrapping="Wrap" Foreground="{ComboBoxForegroundColor}">
|
||||
Choose a Windows ISO file that you've downloaded <LineBreak/>
|
||||
Check the status in the console
|
||||
</TextBlock>
|
||||
<CheckBox x:Name="WPFMicrowinISOScratchDir" Content="Use ISO directory for ScratchDir " IsChecked="False" Margin="-10,1,1,1"
|
||||
<CheckBox x:Name="WPFMicrowinISOScratchDir" Content="Use ISO directory for ScratchDir " IsChecked="False" Margin="{MicrowinCheckBoxMargin}"
|
||||
ToolTip="Use ISO directory for ScratchDir " />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@ -966,14 +985,10 @@
|
||||
TextWrapping="Wrap"
|
||||
Foreground="{LabelboxForegroundColor}"
|
||||
/>
|
||||
<RadioButton x:Name="ISOoption1" Content="Get newest ISO automatically" GroupName="Options" IsChecked="True"/>
|
||||
<ComboBox x:Name="ISORelease"/>
|
||||
<ComboBox x:Name="ISOLanguage"/>
|
||||
<RadioButton x:Name="ISOoption2" Content="Select your own ISO" GroupName="Options"/>
|
||||
<Button Name="WPFGetIso" Margin="2" Padding="15">
|
||||
<Button.Content>
|
||||
<TextBlock Background="Transparent" Foreground="{ButtonForegroundColor}">
|
||||
Get Windows <Underline>I</Underline>SO
|
||||
Select Windows <Underline>I</Underline>SO
|
||||
</TextBlock>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
@ -983,7 +998,7 @@
|
||||
<TextBlock Margin="6" Padding="1" TextWrapping="Wrap">Choose Windows SKU</TextBlock>
|
||||
<ComboBox x:Name = "MicrowinWindowsFlavors" Margin="1" />
|
||||
<Rectangle Fill="{MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||
<CheckBox Name="MicrowinInjectDrivers" Content="Inject drivers (I KNOW WHAT I'M DOING)" Margin="-10,5,0,0" IsChecked="False" ToolTip="Path to unpacked drivers all sys and inf files for devices that need drivers"/>
|
||||
<CheckBox Name="MicrowinInjectDrivers" Content="Inject drivers (I KNOW WHAT I'M DOING)" Margin="{MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="Path to unpacked drivers all sys and inf files for devices that need drivers"/>
|
||||
<TextBox Name="MicrowinDriverLocation" Background="Transparent" BorderThickness="1" BorderBrush="{MainForegroundColor}"
|
||||
Margin="6"
|
||||
Text=""
|
||||
@ -992,9 +1007,9 @@
|
||||
Foreground="{LabelboxForegroundColor}"
|
||||
ToolTip="Path to unpacked drivers all sys and inf files for devices that need drivers"
|
||||
/>
|
||||
<CheckBox Name="MicrowinImportDrivers" Content="Import drivers from current system" Margin="-10,5,0,0" IsChecked="False" ToolTip="Export all third-party drivers from your system and inject them to the MicroWin image"/>
|
||||
<CheckBox Name="MicrowinImportDrivers" Content="Import drivers from current system" Margin="{MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="Export all third-party drivers from your system and inject them to the MicroWin image"/>
|
||||
<Rectangle Fill="{MainForegroundColor}" Height="2" HorizontalAlignment="Stretch" Margin="0,10,0,10"/>
|
||||
<CheckBox Name="WPFMicrowinCopyToUsb" Content="Copy to Ventoy" Margin="-10,5,0,0" IsChecked="False" ToolTip="Copy to USB disk with a label Ventoy"/>
|
||||
<CheckBox Name="WPFMicrowinCopyToUsb" Content="Copy to Ventoy" Margin="{MicrowinCheckBoxMargin}" IsChecked="False" ToolTip="Copy to USB disk with a label Ventoy"/>
|
||||
<Rectangle Fill="{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>
|
||||
@ -1024,6 +1039,7 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border
|
||||
Style="{StaticResource BorderStyle}"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
Grid.Row="0" Grid.Column="1">
|
||||
|
Reference in New Issue
Block a user