diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..30a94605 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,38 @@ +# Pull Request + +## Title +[Provide a succinct and descriptive title for the pull request.] + +## Type of Change +- [ ] New feature +- [ ] Bug fix +- [ ] Documentation update +- [ ] Refactoring +- [ ] Hotfix +- [ ] Security patch +- [ ] 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.] + +## Testing +[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.] + +## Issue related to PR +[What issue is related to this PR (if any)] +- Resolves # +[What discussion is related to this PR (if any)] +- Discussion: # + +## Additional Information +[Any additional information that reviewers should be aware of.] + +## Checklist +- [ ] My code adheres to the coding and style guidelines of the project. +- [ ] I have performed a self-review of my own code. +- [ ] I have commented my code, particularly in hard-to-understand areas. +- [ ] I have made corresponding changes to the documentation. +- [ ] My changes generate no errors/warnings/merge conflicts. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..1e853399 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: ci +on: + push: + branches: + - master + - main +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.x + - uses: actions/cache@v2 + with: + key: ${{ github.ref }} + path: .cache + - run: pip install mkdocs-material + - run: pip install pillow cairosvg + - run: mkdocs gh-deploy --force \ No newline at end of file diff --git a/.github/workflows/close-discussion.yml b/.github/workflows/close-discussion.yml new file mode 100644 index 00000000..c320a275 --- /dev/null +++ b/.github/workflows/close-discussion.yml @@ -0,0 +1,30 @@ +name: Close Discussion on PR Merge + +on: + pull_request: + types: [closed] + +jobs: + closeDiscussion: + runs-on: ubuntu-latest + steps: + - name: Check if PR was merged + if: github.event.pull_request.merged == true + run: echo "PR was merged" + + - name: Extract Discussion Number + if: github.event.pull_request.merged == true + id: extract-discussion + run: | + echo "::set-output name=discussion::$(echo "${{ github.event.pull_request.body }}" | grep -oP '(?<=Discussion: #)\d+')" + shell: bash + + - name: Close the discussion + if: github.event.pull_request.merged == true && steps.extract-discussion.outputs.discussion + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DISCUSSION_ID: ${{ steps.extract-discussion.outputs.discussion }} + run: | + curl -X PATCH -H "Authorization: token $GITHUB_TOKEN" \ + -d '{"state": "closed"}' \ + "https://api.github.com/repos/${{ github.repository }}/discussions/${DISCUSSION_ID}" diff --git a/.github/workflows/close-old-issues.yaml b/.github/workflows/close-old-issues.yaml index a91b3363..ace4bb34 100644 --- a/.github/workflows/close-old-issues.yaml +++ b/.github/workflows/close-old-issues.yaml @@ -14,7 +14,7 @@ jobs: contents: none steps: - name: Close inactive issues - uses: actions/stale@v9.0.0 + uses: actions/stale@v8 with: # A list of labels to reference when looking through issues, # and only when one (or even more) of these labels are found.. @@ -33,7 +33,7 @@ jobs: # Increase this value if the project receives a lot of # PRs (yes.. apparently they're processed no matter what) & Issues. # Default value for it (according to the docs) is 30 - operations-per-run: 100 + operations-per-run: 200 # Make this field equal true if you want to test your configuration if it works correctly or not debug-only: false repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/createchangelog.yml b/.github/workflows/createchangelog.yml new file mode 100644 index 00000000..425d3048 --- /dev/null +++ b/.github/workflows/createchangelog.yml @@ -0,0 +1,17 @@ +name: On release published +on: + release: + types: [published] + +jobs: + changelog: + name: Update changelog + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: main + - uses: rhysd/changelog-from-release/action@v3 + with: + file: /docs/updates.md + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/wiki/Battery.md b/Battery.txt similarity index 100% rename from wiki/Battery.md rename to Battery.txt diff --git a/wiki/Error-in-Winutil-MicroWin-during-ISO-mounting.md b/Error-in-Winutil-MicroWin-during-ISO-mounting.txt similarity index 100% rename from wiki/Error-in-Winutil-MicroWin-during-ISO-mounting.md rename to Error-in-Winutil-MicroWin-during-ISO-mounting.txt diff --git a/README.md b/README.md index 2de945a9..71fd1d31 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ # Chris Titus Tech's Windows Utility [![Version](https://img.shields.io/github/v/release/ChrisTitusTech/winutil?color=7a39fb)](https://github.com/ChrisTitusTech/winutil/releases/latest) +![GitHub Downloads (all assets, latest release)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/latest/total) +[![](https://dcbadge.limes.pink/api/server/https://discord.gg/RUbZUZyByQ)](https://discord.gg/RUbZUZyByQ) This utility is a compilation of Windows tasks I perform on each Windows system I use. It is meant to streamline *installs*, debloat with *tweaks*, troubleshoot with *config*, and fix Windows *updates*. I am extremely picky about any contributions to keep this project clean and efficient. -![screen-install](screen-install.png) +![screen-install](./docs/assets/screen-install.png) -## Usage +## 💡 Usage Winutil must be run in Admin mode because it performs system-wide tweaks. To achieve this, open PowerShell or Windows Terminal as an administrator. Here are a few ways to do it: @@ -22,111 +24,39 @@ Winutil must be run in Admin mode because it performs system-wide tweaks. To ach ### Launch Command -#### Simple way +#### Stable Branch ```ps1 irm "https://christitus.com/win" | iex ``` -Courtesy of the issue: [#144](/../../issues/144) +#### Dev Branch -If this site is not reachable from your country, please try running it directly from GitHub. ```ps1 -irm "https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1" | iex +irm "https://christitus.com/windev" | iex ``` -If you still have Issues, refer to [Known Issues](https://github.com/ChrisTitusTech/winutil/blob/main/KnownIssues.md). +If you have Issues, refer to [Known Issues](https://christitustech.github.io/winutil/KnownIssues/) +## 🎓 Documenation -#### Automation +### [WinUtil Official Documentation](https://christitustech.github.io/winutil/) -Some features are available through automation. This allows you to save your config file pass it to Winutil walk away and come back to a finished system. Here is how you can set it up currently with Winutil >24.01.15 - -1. On the Install Tab, click "Get Installed", this will get all installed apps **supported by Winutil** on the system - ![GetInstalled](/wiki/Get-Installed.png) -2. Click on the Settings cog in the upper right corner and chose Export, chose file file and location, this will export the setting file. - ![SettingsExport](/wiki/Settings-Export.png) -3. Copy this file to a USB or somewhere you can use after Windows installation. -4. Use Microwin tab to create a custom Windows image. -5. Install the Windows image. -6. In the new Windows, Open PowerShell in the admin mode and run command to automatically apply tweaks and install apps from the config file. -``` -iex "& { $(irm christitus.com/win) } -Config [path-to-your-config] -Run" -``` -7. Have a cup of coffee! Come back when it's done. - - - -## Support -- To morally and mentally support the project, make sure to leave a ⭐️! -- EXE Wrapper for $10 @ https://www.cttstore.com/windows-toolbox - -## Tutorial +### YouTube Tutorial [![Watch the video](https://img.youtube.com/vi/6UQZ5oQg8XA/hqdefault.jpg)](https://www.youtube.com/watch?v=6UQZ5oQg8XA) -## Overview - -- Install - - Install Selection: Organize programs by category and facilitate installation by enabling users to select programs and initiate the installation process with a single click. - - - Upgrade All: Upgrade all existing programs to their latest versions, ensuring users have the most up-to-date and feature-rich software. - - - Uninstall Selection: Effortlessly uninstall selected programs, providing users with a streamlined way to remove unwanted software from their system. - - - Get Installed: Retrieve a comprehensive list of installed programs on the system, offering users visibility into the software currently installed on their computer. - - - Import / Export: Enable users to import or export the selection list of programs, allowing them to save their preferred program configurations or share them with others. This feature promotes convenience and flexibility in managing program selections across different systems. - -- Tweaks - - Recommended Selection: Provides pre-defined templates tailored for desktop, laptop, and minimal configurations, allowing users to select recommended settings and optimizations specific to their system type. - - - Essential Tweaks: Offers a collection of essential tweaks aimed at improving system performance, privacy, and resource utilization. These tweaks include creating a system restore point, disabling telemetry, Wi-Fi Sense, setting services to manual, disabling location tracking, and HomeGroup, among others. - - - Advanced Tweaks: Encompasses a range of various advanced power user tweaks to further optimize the system. These tweaks include removing OneDrive and Edge, disabling User Account Control (UAC), notification panel, among others. - - - Toggles: Adds easy to use, one click shortcuts for toggling dark mode, NumLock on startup, file extensions, sticky keys, among others. - - - Additional Tweaks: Introduces various other tweaks such as enabling dark mode, changing DNS settings, adding an Ultimate Performance mode, and creating shortcuts for WinUtil tools. These tweaks provide users with additional customization options to tailor their system to their preferences. - -- Config - - Features: Allows users to easily install various essential components and features to enhance their Windows experience. These features include installing .NET Frameworks, enabling Hyper-V virtualization, enabling legacy media support for Windows Media Player and DirectPlay, enabling NFS (Network File System) for network file sharing, and enabling Windows Subsystem for Linux (WSL) for running Linux applications on Windows. - - - Fixes: Provides a range of helpful fixes to address common issues and improve system stability. This includes setting up autologon for seamless login experiences, resetting Windows updates to resolve update-related problems, performing a system corruption scan to detect and repair corrupted files, and resetting network settings to troubleshoot network connectivity issues. - - - Legacy Windows Panels: Includes access to legacy Windows panels from Windows 7, allowing users to access familiar and powerful tools. These panels include Control Panel for managing system settings, Network Connections for configuring network adapters and connections, Power Panel for adjusting power and sleep settings, Sound Settings for managing audio devices and settings, System Properties for viewing and modifying system information, and User Accounts for managing user profiles and account settings. +### [ChrisTitus.com Article](https://christitus.com/windows-tool/) -- Updates: - - Default (Out of Box) Settings: Provides the default settings that come with Windows for updates. +## 💖 Support +- To morally and mentally support the project, make sure to leave a ⭐️! +- EXE Wrapper for $10 @ https://www.cttstore.com/windows-toolbox - - Security (Recommended) Settings: Offers recommended settings, including a slight delay of feature updates by 2 years and installation of security updates 4 days after release. - - - Disable All Updates (Not Recommended!): Allows users to disable all Windows updates, but it's not recommended due to potential security risks. - - -Video and Written Article walkthrough @ - -## Issues - -If you encounter any challenges or problems with the script, I kindly request that you submit them via the "Issues" tab on the GitHub repository. By filling out the provided template, you can provide specific details about the issue, allowing me to promptly address any bugs or consider feature requests. - -## Contribute Code - -Pull Requests are now handled directly on the MAIN branch. This was done since we can now select specific releases to launch via releases in GitHub. - -If doing a code change and you can submit a PR to main branch, but I am very selective about these. Do not use a code formatter, massive amounts of line changes, and make multiple feature changes. EACH FEATURE CHANGE SHOULD BE IT'S OWN Pull Request! - -When creating pull requests, it is essential to thoroughly document all changes made. This includes documenting any additions made to the tweaks section and ensuring that corresponding undo measures are in place to remove the newly added tweaks if necessary. Failure to adhere to this format may result in denial of the pull request. Additionally, comprehensive documentation is required for all code changes. Any code lacking sufficient documentation may also be denied. - -By following these guidelines, we can maintain a high standard of quality and ensure that the codebase remains organized and well-documented. - -NOTE: When creating a function please include "WPF" or "WinUtil" in the name so that it can be loaded into the runspace. - -## Thanks to all Contributors +## 🏅 Thanks to all Contributors Thanks a lot for spending your time helping Winutil grow. Thanks a lot! Keep rocking 🍻. [![Contributors](https://contrib.rocks/image?repo=ChrisTitusTech/winutil)](https://github.com/ChrisTitusTech/winutil/graphs/contributors) -## GitHub Stats +## 📊 GitHub Stats ![Alt](https://repobeats.axiom.co/api/embed/aad37eec9114c507f109d34ff8d38a59adc9503f.svg "Repobeats analytics image") diff --git a/config/applications.json b/config/applications.json index 16ba3aae..c2926d03 100644 --- a/config/applications.json +++ b/config/applications.json @@ -951,69 +951,37 @@ "link": "https://jami.net/", "winget": "SFLinux.Jami" }, - "java16": { + "java8": { "category": "Development", - "choco": "temurin16jre", - "content": "OpenJDK Java 16", - "description": "OpenJDK Java 16 is the latest version of the open-source Java development kit.", - "link": "https://adoptopenjdk.net/", - "winget": "AdoptOpenJDK.OpenJDK.16" + "choco": "corretto8jdk", + "content": "Amazon Corretto 8 (LTS)", + "description": "Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK).", + "link": "https://aws.amazon.com/corretto", + "winget": "Amazon.Corretto.8.JDK" }, - "java18": { + "java11": { "category": "Development", - "choco": "temurin18jre", - "content": "Oracle Java 18", - "description": "Oracle Java 18 is the latest version of the official Java development kit from Oracle.", - "link": "https://www.oracle.com/java/", - "winget": "EclipseAdoptium.Temurin.18.JRE" + "choco": "corretto11jdk", + "content": "Amazon Corretto 11 (LTS)", + "description": "Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK).", + "link": "https://aws.amazon.com/corretto", + "winget": "Amazon.Corretto.11.JDK" + }, + "java17": { + "category": "Development", + "choco": "corretto17jdk", + "content": "Amazon Corretto 17 (LTS)", + "description": "Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK).", + "link": "https://aws.amazon.com/corretto", + "winget": "Amazon.Corretto.17.JDK" }, "java21": { "category": "Development", - "choco": "na", - "content": "Azul Zulu JDK 21", - "description": "Azul Zulu JDK 21 is a distribution of the OpenJDK with long-term support, performance enhancements, and security updates.", - "link": "https://www.azul.com/downloads/zulu-community/", - "winget": "Azul.Zulu.21.JDK" - }, - "java8": { - "category": "Development", - "choco": "temurin8jre", - "content": "OpenJDK Java 8", - "description": "OpenJDK Java 8 is an open-source implementation of the Java Platform, Standard Edition.", - "link": "https://adoptopenjdk.net/", - "winget": "EclipseAdoptium.Temurin.8.JRE" - }, - "java11runtime": { - "category": "Development", - "choco": "na", - "content": "Eclipse Temurin JRE 11", - "description": "Eclipse Temurin JRE is the open source Java SE build based upon OpenJRE.", - "link": "https://adoptium.net/", - "winget": "EclipseAdoptium.Temurin.11.JRE" - }, - "java17runtime": { - "category": "Development", - "choco": "na", - "content": "Eclipse Temurin JRE 17", - "description": "Eclipse Temurin JRE is the open source Java SE build based upon OpenJRE.", - "link": "https://adoptium.net/", - "winget": "EclipseAdoptium.Temurin.17.JRE" - }, - "java18runtime": { - "category": "Development", - "choco": "na", - "content": "Eclipse Temurin JRE 18", - "description": "Eclipse Temurin JRE is the open source Java SE build based upon OpenJRE.", - "link": "https://adoptium.net/", - "winget": "EclipseAdoptium.Temurin.18.JRE" - }, - "java19runtime": { - "category": "Development", - "choco": "na", - "content": "Eclipse Temurin JRE 19", - "description": "Eclipse Temurin JRE is the open source Java SE build based upon OpenJRE.", - "link": "https://adoptium.net/", - "winget": "EclipseAdoptium.Temurin.19.JRE" + "choco": "corretto21jdk", + "content": "Amazon Corretto 21 (LTS)", + "description": "Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the Open Java Development Kit (OpenJDK).", + "link": "https://aws.amazon.com/corretto", + "winget": "Amazon.Corretto.21.JDK" }, "jdownloader": { "category": "Utilities", @@ -1215,6 +1183,14 @@ "link": "https://meldmerge.org/", "winget": "Meld.Meld" }, + "ModernFlyouts": { + "category": "Multimedia Tools", + "choco": "na", + "content": "Modern Flyouts", + "description": "An open source, modern, Fluent Design-based set of flyouts for Windows.", + "link": "https://github.com/ModernFlyouts-Community/ModernFlyouts/", + "winget": "ModernFlyouts.ModernFlyouts" + }, "monitorian": { "category": "Utilities", "choco": "monitorian", @@ -1943,10 +1919,10 @@ "link": "https://getsharex.com/", "winget": "ShareX.ShareX" }, - "nilesoftShel": { + "nilesoftShell": { "category": "Utilities", "choco": "nilesoft-shell", - "content": "Shell (Expanded Context Menu)", + "content": "Nilesoft Shell", "description": "Shell is an expanded context menu tool that adds extra functionality and customization options to the Windows context menu.", "link": "https://nilesoft.org/", "winget": "Nilesoft.Shell" @@ -2482,7 +2458,7 @@ "wingetui": { "category": "Utilities", "choco": "wingetui", - "content": "WingetUI", + "content": "UnigetUI", "description": "WingetUI is a graphical user interface for Microsoft's Windows Package Manager (winget).", "link": "https://www.marticliment.com/wingetui/", "winget": "SomePythonThings.WingetUIStore" @@ -2872,7 +2848,7 @@ "winget": "NDI.NDITools" }, "kicad": { - "category": "Pro Tools", + "category": "Multimedia Tools", "choco": "na", "content": "Kicad", "description":"Kicad is an open-source EDA tool. It's a good starting point for those who want to do electrical design and is even used by professionals in the industry.", @@ -2902,5 +2878,13 @@ "description":"GUI Tool To Removes Ads From Various Places Around Windows 11", "link": "https://github.com/xM4ddy/OFGB", "winget": "xM4ddy.OFGB" + }, + "Shotcut": { + "category": "Multimedia Tools", + "choco": "na", + "content": "Shotcut", + "description": "Shotcut is a free, open source, cross-platform video editor.", + "link": "https://shotcut.org/", + "winget": "Meltytech.Shotcut" } } diff --git a/config/dns.json b/config/dns.json index f661ef0a..8f5ca14c 100644 --- a/config/dns.json +++ b/config/dns.json @@ -1,30 +1,50 @@ { "Google":{ "Primary": "8.8.8.8", - "Secondary": "8.8.4.4" + "Secondary": "8.8.4.4", + "Primary6": "2001:4860:4860::8888", + "Secondary6": "2001:4860:4860::8844" }, "Cloudflare":{ "Primary": "1.1.1.1", - "Secondary": "1.0.0.1" + "Secondary": "1.0.0.1", + "Primary6": "2606:4700:4700::1111", + "Secondary6": "2606:4700:4700::1001" }, "Cloudflare_Malware":{ "Primary": "1.1.1.2", - "Secondary": "1.0.0.2" + "Secondary": "1.0.0.2", + "Primary6": "2606:4700:4700::1112", + "Secondary6": "2606:4700:4700::1002" }, "Cloudflare_Malware_Adult":{ "Primary": "1.1.1.3", - "Secondary": "1.0.0.3" - }, - "Level3":{ - "Primary": "4.2.2.2", - "Secondary": "4.2.2.1" + "Secondary": "1.0.0.3", + "Primary6": "2606:4700:4700::1113", + "Secondary6": "2606:4700:4700::1003" }, "Open_DNS":{ "Primary": "208.67.222.222", - "Secondary": "208.67.220.220" + "Secondary": "208.67.220.220", + "Primary6": "2620:119:35::35", + "Secondary6": "2620:119:53::53" }, "Quad9":{ "Primary": "9.9.9.9", - "Secondary": "149.112.112.112" + "Secondary": "149.112.112.112", + "Primary6": "2620:fe::fe", + "Secondary6": "2620:fe::9" + }, + "AdGuard_Ads_Trackers":{ + "Primary": "94.140.14.14", + "Secondary": "94.140.15.15", + "Primary6": "2a10:50c0::ad1:ff", + "Secondary6": "2a10:50c0::ad2:ff" + }, + "AdGuard_Ads_Trackers_Malware_Adult":{ + "Primary": "94.140.14.15", + "Secondary": "94.140.15.16", + "Primary6": "2a10:50c0::bad1:ff", + "Secondary6": "2a10:50c0::bad2:ff" } } \ No newline at end of file diff --git a/config/feature.json b/config/feature.json index d2f5a161..bd66859a 100644 --- a/config/feature.json +++ b/config/feature.json @@ -184,90 +184,104 @@ "category": "Features", "panel": "1", "Order": "a060_", - "Type": "150" + "Type": "Button", + "ButtonWidth": "300" }, "WPFPanelAutologin": { "Content": "Set Up Autologin", "category": "Fixes", "Order": "a040_", "panel": "1", - "Type": "300" + "Type": "Button", + "ButtonWidth": "300" }, "WPFFixesUpdate": { "Content": "Reset Windows Update", "category": "Fixes", "panel": "1", "Order": "a041_", - "Type": "300" + "Type": "Button", + "ButtonWidth": "300" }, "WPFFixesNetwork": { "Content": "Reset Network", "category": "Fixes", "Order": "a042_", "panel": "1", - "Type": "300" + "Type": "Button", + "ButtonWidth": "300" }, "WPFPanelDISM": { "Content": "System Corruption Scan", "category": "Fixes", "panel": "1", "Order": "a043_", - "Type": "300" + "Type": "Button", + "ButtonWidth": "300" }, "WPFFixesWinget": { "Content": "WinGet Reinstall", "category": "Fixes", "panel": "1", "Order": "a044_", - "Type": "300" + "Type": "Button", + "ButtonWidth": "300" }, "WPFRunAdobeCCCleanerTool": { "Content": "Remove Adobe Creative Cloud", "category": "Fixes", "panel": "1", "Order": "a045_", - "Type": "300" + "Type": "Button", + "ButtonWidth": "300" }, "WPFPanelnetwork": { "Content": "Network Connections", "category": "Legacy Windows Panels", "panel": "2", - "Type": "200" + "Type": "Button", + "ButtonWidth": "300" }, "WPFPanelcontrol": { "Content": "Control Panel", "category": "Legacy Windows Panels", "panel": "2", - "Type": "200" + "Type": "Button", + "ButtonWidth": "300" }, "WPFPanelpower": { "Content": "Power Panel", "category": "Legacy Windows Panels", "panel": "2", - "Type": "200" + "Type": "Button", + "ButtonWidth": "300" }, "WPFPanelregion": { "Content": "Region", "category": "Legacy Windows Panels", "panel": "2", - "Type": "200" + "Type": "Button", + "ButtonWidth": "300" }, "WPFPanelsound": { "Content": "Sound Settings", "category": "Legacy Windows Panels", "panel": "2", - "Type": "200" + "Type": "Button", + "ButtonWidth": "300" }, "WPFPanelsystem": { "Content": "System Properties", "category": "Legacy Windows Panels", "panel": "2", - "Type": "200" + "Type": "Button", + "ButtonWidth": "300" }, "WPFPaneluser": { "Content": "User Accounts", "category": "Legacy Windows Panels", "panel": "2", - "Type": "200" + "Type": "Button", + "ButtonWidth": "300" } } diff --git a/config/helperscript.ps1 b/config/helperscript.ps1 deleted file mode 100644 index 1b1b6d7a..00000000 --- a/config/helperscript.ps1 +++ /dev/null @@ -1,399 +0,0 @@ -# This file is meant to assist in building out the json files inside this folder. - -#=========================================================================== -# applications.json -#=========================================================================== - -<# - Applications.json - ----------------- - This file holds all the install commands to install the applications. - This file has the ability to expect multiple frameworks per checkbox. - You can also add multiple install commands by separating them with ; - - The structure of the json is as follows - -{ - "Name of Button": { - "winget": "Winget command" - "choco": "Chocolatey command" - }, -} - -Example: - -{ - "WPFInstalladobe": { - "winget": "Adobe.Acrobat.Reader.64-bit" - "choco": "adobereader" - }, - "WPFInstalladvancedip": { - "winget": "Famatech.AdvancedIPScanner" - "choco": "advanced-ip-scanner" - } -} - -#> - -# Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request. -#------Do not delete WPF------ - -$NameofButton = "WPF" + "" -$WingetCommand = "" -$ChocoCommand = "" - -$ButtonToAdd = New-Object psobject -$jsonfile = Get-Content ./config/applications.json | ConvertFrom-Json - -# Remove if already exists -if($jsonfile.$NameofButton){ - $jsonfile.psobject.Properties.remove($NameofButton) -} - -Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "Winget" -Value $WingetCommand -Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "choco" -Value $ChocoCommand -Add-Member -InputObject $jsonfile.install -MemberType NoteProperty -Name $NameofButton -Value $ButtonToAdd - -$jsonfile | ConvertTo-Json | Out-File ./config/applications.json - -#=========================================================================== -# feature.json -#=========================================================================== - -<# - feature.json - ----------------- - This file holds all the windows commands to install specific features (IE Hyper-v) - - The structure of the json is as follows - -{ - "Name of Button": [ - "Array of", - "commands" - ] -} - -Example: -{ - "Featurewsl": [ - "VirtualMachinePlatform", - "Microsoft-Windows-Subsystem-Linux" - ], - "Featurenfs": [ - "ServicesForNFS-ClientOnly", - "ClientForNFS-Infrastructure", - "NFS-Administration" - ] -} -#> - -# Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request. - -$NameofButton = "" -$commands = @( - -) - -$jsonfile = Get-Content ./config/feature.json | ConvertFrom-Json - -# Remove if already exists -if($jsonfile.$NameofButton){ - $jsonfile.psobject.Properties.remove($NameofButton) -} - -Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofButton -Value $commands - -$jsonfile | ConvertTo-Json | Out-File ./config/feature.json - -#=========================================================================== -# preset.json -#=========================================================================== - -<# - preset.json - ----------------- - This file holds all check boxes you wish to check when clicking a preset button in the tweaks section. - - The structure of the json is as follows - -{ - "Name of Button": [ - "Array of", - "checkboxes to check" - ] -} - -Example: -{ - "laptop": [ - "EssTweaksAH", - "EssTweaksDVR", - "EssTweaksHome", - "EssTweaksLoc", - "EssTweaksOO", - "EssTweaksRP", - "EssTweaksServices", - "EssTweaksStorage", - "EssTweaksTele", - "EssTweaksWifi", - "MiscTweaksLapPower", - "MiscTweaksLapNum" - ], - "minimal": [ - "EssTweaksHome", - "EssTweaksOO", - "EssTweaksRP", - "EssTweaksServices", - "EssTweaksTele" - ] -} -#> - -# Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request. - -$NameofButton = "WPF" + "" -$commands = @( - -) - -$jsonfile = Get-Content ./config/preset.json | ConvertFrom-Json - -# Remove if already exists -if($jsonfile.$NameofButton){ - $jsonfile.psobject.Properties.remove($NameofButton) -} - -Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofButton -Value $commands - -$jsonfile | ConvertTo-Json | Out-File ./config/preset.json - -#=========================================================================== -# tweaks.json -#=========================================================================== - -<# - tweaks.json - ----------------- - This file holds all the tweaks needed to make modifications to windows. This file is the most complicated so modify with care. - - The structure of the json is as follows - -{ - "Name of button": { - "registry" : [ - { - "Path": "Path in registry", - "Name": "Name of Registry key", - "Type": "Item type", - "Value": "Value to modify", - "OriginalValue": "value to reset" - } - ], - "service" : [ - { - "Name": "Name of service", - "StartupType": "Startup type to set", - "OriginalType": "Startup type to reset" - } - ], - "ScheduledTask" : [ - { - "Name": "Path to scheduled task", - "State": "State to set", - "OriginalState": "State to reset" - } - ], - "appx": [ - List of appx, - files to uninstall - ], - "InvokeScript": [ - "Script to make modifications not possible with the above types - Special care needs to be taken here as converting from json to a scriptblock - can cause weird issues. Please look at the example below to get an idea of how things should work" - ], - "UndoScript": [ - "Same as above however is meant to undo what you did above" - ] - } -} - -Example: - -{ - EssTweaksAH": { - "registry" : [ - { - "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System", - "Name": "EnableActivityFeed", - "Type": "DWord", - "Value": "0", - "OriginalValue": "1" - }, - { - "Path": "HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System", - "Name": "PublishUserActivities", - "Type": "DWord", - "Value": "0", - "OriginalValue": "1" - } - ] - }, - "EssTweaksHome": { - "service" : [ - { - "Name": "HomeGroupListener", - "StartupType": "Manual", - "OriginalType": "Automatic" - }, - { - "Name": "HomeGroupProvider", - "StartupType": "Manual", - "OriginalType": "Automatic" - } - ] - }, - "EssTweaksTele": { - "ScheduledTask" : [ - { - "Name": "Microsoft\\Windows\\Application Experience\\Microsoft Compatibility Appraiser", - "State": "Disabled", - "OriginalState": "Enabled" - }, - { - "Name": "Microsoft\\Windows\\Application Experience\\ProgramDataUpdater", - "State": "Disabled", - "OriginalState": "Enabled" - } - ] - }, - "EssTweaksDeBloat": { - "appx": [ - "Microsoft.Microsoft3DViewer", - "Microsoft.AppConnector" - ] - }, - "EssTweaksOO": { - "InvokeScript": [ - "Import-Module BitsTransfer - Start-BitsTransfer -Source \"https://raw.githubusercontent.com/ChrisTitusTech/win10script/master/ooshutup10.cfg\" -Destination C:\\Windows\\Temp\\ooshutup10.cfg - Start-BitsTransfer -Source \"https://dl5.oo-software.com/files/ooshutup10/OOSU10.exe\" -Destination C:\\Windows\\Temp\\OOSU10.exe - C:\\Windows\\Temp\\OOSU10.exe C:\\Windows\\Temp\\ooshutup10.cfg /quiet" - ] - } -} - -#> - -# Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request. -# Make sure to uncomment the sections you which to add. - -#$Registry = @( -# # To add more repeat this separated by a comma -# @{ -# Path = "" -# Name = "" -# Type = "" -# Value = "" -# OriginalValue = "" -# } -#) - -#$Service = @( -# # To add more repeat this separated by a comma -# @{ -# Name = "" -# StartupType = "" -# OriginalType = "" -# } -#) - -#$ScheduledTask = @( -# # To add more repeat this separated by a comma -# @{ -# Name = "" -# State = "" -# OriginalState = "" -# } -#) - -#$Appx = @( -# "" -#) - -#$InvokeScript = @( -# "" -#) - -#$UndoScript = @( -# "" -#) - -$NameofButton = "WPF" + "" - -$ButtonToAdd = New-Object psobject -$jsonfile = Get-Content ./config/tweaks.json | ConvertFrom-Json - -# Remove if already exists -if($jsonfile.$NameofButton){ - $jsonfile.psobject.Properties.remove($NameofButton) -} - -if($Registry){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "registry" -Value $Registry} -if($Service){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "service" -Value $Service} -if($ScheduledTask){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "ScheduledTask" -Value $ScheduledTask} -if($Appx){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "Appx" -Value $Appx} -if($InvokeScript){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "InvokeScript" -Value $InvokeScript} -if($UndoScript){Add-Member -InputObject $ButtonToAdd -MemberType NoteProperty -Name "UndoScript" -Value $UndoScript} - -Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofButton -Value $ButtonToAdd - -($jsonfile | ConvertTo-Json -Depth 5).replace('\r\n',"`r`n") | Out-File ./config/tweaks.json - -#=========================================================================== -# dns.json -#=========================================================================== - -<# - dns.json - ----------------- - This file holds all the DNS entries. - - The structure of the json is as follows - -{ - "DNS Provider": [ - "Primary": "IP address", - "Secondary": "IP address" - ] -} - -Example: -{ - "Cloudflare":{ - "Primary": "1.1.1.1", - "Secondary": "1.0.0.1" - } -} -#> - -# Modify the variables and run his code. It will import the current file and add your addition. From there you can create a pull request. - -$NameofProvider = "" -replace " ","_" -$IPAddress = @{ - "Primary" = "0.0.0.0" - "Secondary" = "0.0.0.0" -} - -$ButtonToAdd = New-Object psobject -$jsonfile = Get-Content ./config/dns.json | ConvertFrom-Json - -# Remove if already exists -if($jsonfile.$NameofProvider){ - $jsonfile.psobject.Properties.remove($NameofProvider) -} - -Add-Member -InputObject $jsonfile -MemberType NoteProperty -Name $NameofProvider -Value $IPAddress - -($jsonfile | ConvertTo-Json -Depth 5).replace('\r\n',"`r`n") | Out-File ./config/dns.json \ No newline at end of file diff --git a/config/preset.json b/config/preset.json index f19742d0..78083d15 100644 --- a/config/preset.json +++ b/config/preset.json @@ -14,7 +14,8 @@ "WPFTweaksDeleteTempFiles", "WPFTweaksEndTaskOnTaskbar", "WPFTweaksRestorePoint", - "WPFTweaksTeredo" + "WPFTweaksTeredo", + "WPFTweaksPowershell7Tele" ], "Minimal": [ "WPFTweaksConsumerFeatures", diff --git a/config/themes.json b/config/themes.json index 7500bb87..4bc3766b 100644 --- a/config/themes.json +++ b/config/themes.json @@ -1,5 +1,30 @@ { "Classic": { + "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", + "ComboBoxBackgroundColor": "#FFFFFF", "LabelboxForegroundColor": "#000000", "MainForegroundColor": "#000000", @@ -9,6 +34,18 @@ "LinkHoverForegroundColor": "#000000", "GroupBorderBackgroundColor": "#000000", "ComboBoxForegroundColor": "#000000", + + "ButtonFontSize": "12", + "ButtonFontFamily": "Arial", + "ButtonWidth": "200", + "ButtonHeight": "25", + "ConfigTabButtonFontSize": "16", + + "SearchBarWidth": "200", + "SearchBarHeight": "25", + "SearchBarTextBoxFontSize": "16", + "SearchBarClearButtonFontSize": "14", + "ButtonInstallBackgroundColor": "#FFFFFF", "ButtonTweaksBackgroundColor": "#FFFFFF", "ButtonConfigBackgroundColor": "#FFFFFF", @@ -24,74 +61,148 @@ "ButtonBackgroundSelectedColor": "#F0F0F0", "ButtonForegroundColor": "#000000", "ToggleButtonOnColor": "#2e77ff", + "ButtonBorderThickness": "1", "ButtonMargin": "1", "ButtonCornerRadius": "2", - "ToggleButtonHeight": "25", "BorderColor": "#000000", "BorderOpacity": "0.2", "ShadowPulse": "Forever" }, "Matrix": { - "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": "#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", - "ToggleButtonHeight": "25", - "BorderColor": "#FFAC1C", - "BorderOpacity": "0.8", - "ShadowPulse": "0:0:3" + "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", + + "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": "#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": { - "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": "#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", - "ToggleButtonHeight": "25", - "BorderColor": "#FFAC1C", - "BorderOpacity": "0.2", - "ShadowPulse": "Forever" + "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", + + "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" } -} \ No newline at end of file +} diff --git a/config/tweaks.json b/config/tweaks.json index 637aa9dc..afae0216 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -2317,6 +2317,19 @@ "Invoke-WPFTweakPS7 -action \"PS5\"" ] }, + "WPFTweaksPowershell7Tele": { + "Content": "Disable Powershell 7 Telemetry", + "Description": "This will create an Environment Variable called 'POWERSHELL_TELEMETRY_OPTOUT' with a value of '1' which will tell Powershell 7 to not send Telemetry Data.", + "category": "Essential Tweaks", + "panel": "1", + "Order": "a009_", + "InvokeScript": [ + "[Environment]::SetEnvironmentVariable('POWERSHELL_TELEMETRY_OPTOUT', '1', 'Machine')" + ], + "UndoScript": [ + "[Environment]::SetEnvironmentVariable('POWERSHELL_TELEMETRY_OPTOUT', '', 'Machine')" + ] + }, "WPFTweaksStorage": { "Content": "Disable Storage Sense", "Description": "Storage Sense deletes temp files automatically.", @@ -2983,35 +2996,75 @@ ] }, "WPFToggleDarkMode": { - "Content": "Dark Theme", + "Content": "Enable Dark Theme for Windows", "Description": "Enable/Disable Dark Mode.", "category": "Customize Preferences", "panel": "2", - "Order": "a060_", + "Order": "a100_", "Type": "Toggle" }, "WPFToggleBingSearch": { - "Content": "Bing Search in Start Menu", + "Content": "Enable Bing Search in Start Menu", "Description": "If enable then includes web search results from Bing in your Start Menu search.", "category": "Customize Preferences", "panel": "2", - "Order": "a061_", + "Order": "a101_", "Type": "Toggle" }, "WPFToggleNumLock": { - "Content": "NumLock on Startup", + "Content": "Enable NumLock on Startup", "Description": "Toggle the Num Lock key state when your computer starts.", "category": "Customize Preferences", "panel": "2", - "Order": "a062_", + "Order": "a102_", "Type": "Toggle" }, "WPFToggleVerboseLogon": { - "Content": "Verbose Logon Messages", + "Content": "Enable Verbose Messages During Logon", "Description": "Show detailed messages during the login process for troubleshooting and diagnostics.", "category": "Customize Preferences", "panel": "2", - "Order": "a063_", + "Order": "a103_", + "Type": "Toggle" + }, + "WPFToggleSnapWindow": { + "Content": "Enable Snap Window", + "Description": "If enabled you can align windows by dragging them. | Relogin Required", + "category": "Customize Preferences", + "panel": "2", + "Order": "a104_", + "Type": "Toggle" + }, + "WPFToggleSnapFlyout": { + "Content": "Enable Snap Assist Flyout", + "Description": "If enabled then Snap preview is disabled when maximize button is hovered.", + "category": "Customize Preferences", + "panel": "2", + "Order": "a105_", + "Type": "Toggle" + }, + "WPFToggleSnapSuggestion": { + "Content": "Enable Snap Assist Suggestion", + "Description": "If enabled then you will get suggestions to snap other applications in the left over spaces.", + "category": "Customize Preferences", + "panel": "2", + "Order": "a106_", + "Type": "Toggle" + }, + "WPFToggleMouseAcceleration": { + "Content": "Enable Mouse Acceleration", + "Description": "If Enabled then Cursor movement is affected by the speed of your physical mouse movements.", + "category": "Customize Preferences", + "panel": "2", + "Order": "a107_", + "Type": "Toggle" + }, + "WPFToggleStickyKeys": { + "Content": "Enable Sticky Keys", + "Description": "If Enabled then Sticky Keys is activated - Sticky keys is an accessibility feature of some graphical user interfaces which assists users who have physical disabilities or help users reduce repetitive strain injury.", + "category": "Customize Preferences", + "panel": "2", + "Order": "a108_", "Type": "Toggle" }, "WPFToggleShowExt": { @@ -3019,55 +3072,31 @@ "Description": "If enabled then File extensions (e.g., .txt, .jpg) are visible.", "category": "Customize Preferences", "panel": "2", - "Order": "a064_", - "Type": "Toggle" - }, - "WPFToggleSnapWindow": { - "Content": "Snap Window", - "Description": "If enabled you can align windows by dragging them. | Relogin Required", - "category": "Customize Preferences", - "panel": "2", - "Order": "a065_", - "Type": "Toggle" - }, - "WPFToggleSnapFlyout": { - "Content": "Snap Assist Flyout", - "Description": "If enabled then Snap preview is disabled when maximize button is hovered.", - "category": "Customize Preferences", - "panel": "2", - "Order": "a066_", - "Type": "Toggle" - }, - "WPFToggleSnapSuggestion": { - "Content": "Snap Assist Suggestion", - "Description": "If enabled then you will get suggestions to snap other applications in the left over spaces.", - "category": "Customize Preferences", - "panel": "2", - "Order": "a067_", - "Type": "Toggle" - }, - "WPFToggleMouseAcceleration": { - "Content": "Mouse Acceleration", - "Description": "If Enabled then Cursor movement is affected by the speed of your physical mouse movements.", - "category": "Customize Preferences", - "panel": "2", - "Order": "a068_", - "Type": "Toggle" - }, - "WPFToggleStickyKeys": { - "Content": "Sticky Keys", - "Description": "If Enabled then Sticky Keys is activated - Sticky keys is an accessibility feature of some graphical user interfaces which assists users who have physical disabilities or help users reduce repetitive strain injury.", - "category": "Customize Preferences", - "panel": "2", - "Order": "a070_", + "Order": "a200_", "Type": "Toggle" }, "WPFToggleTaskbarSearch": { - "Content": "Taskbar Search", + "Content": "Show Search Button in Taskbar", "Description": "If Enabled Search Button will be on the taskbar.", "category": "Customize Preferences", "panel": "2", - "Order": "a068_", + "Order": "a201_", + "Type": "Toggle" + }, + "WPFToggleTaskView": { + "Content": "Show Task View Button in Taskbar", + "Description": "If Enabled then Task View Button in Taskbar will be shown.", + "category": "Customize Preferences", + "panel": "2", + "Order": "a202_", + "Type": "Toggle" + }, + "WPFToggleTaskbarWidgets": { + "Content": "Show Widgets Button in Taskbar", + "Description": "If Enabled then Widgets Button in Taskbar will be shown.", + "category": "Customize Preferences", + "panel": "2", + "Order": "a203_", "Type": "Toggle" }, "WPFOOSUbutton": { @@ -3075,15 +3104,7 @@ "category": "z__Advanced Tweaks - CAUTION", "panel": "1", "Order": "a039_", - "Type": "220" - }, - "WPFToggleTaskbarWidgets": { - "Content": "Taskbar Widgets", - "Description": "If Enabled then Widgets Icon in Taskbar will be shown.", - "category": "Customize Preferences", - "panel": "2", - "Order": "a069_", - "Type": "Toggle" + "Type": "Button" }, "WPFchangedns": { "Content": "DNS", @@ -3098,42 +3119,37 @@ "category": "z__Advanced Tweaks - CAUTION", "panel": "1", "Order": "a041_", - "Type": "160" + "Type": "Button" }, "WPFUndoall": { "Content": "Undo Selected Tweaks", "category": "z__Advanced Tweaks - CAUTION", "panel": "1", "Order": "a042_", - "Type": "160" + "Type": "Button" }, "WPFAddUltPerf": { "Content": "Add and Activate Ultimate Performance Profile", "category": "Performance Plans", "panel": "2", "Order": "a080_", - "Type": "300" + "Type": "Button", + "ButtonWidth": "300" }, "WPFRemoveUltPerf": { "Content": "Remove Ultimate Performance Profile", "category": "Performance Plans", "panel": "2", "Order": "a081_", - "Type": "300" + "Type": "Button", + "ButtonWidth": "300" }, "WPFWinUtilShortcut": { "Content": "Create WinUtil Shortcut", "category": "Shortcuts", "panel": "2", "Order": "a082_", - "Type": "300" - }, - "WPFToggleTaskView": { - "Content": "Task View", - "Description": "If Enabled then Task View Icon in Taskbar will be shown.", - "category": "Customize Preferences", - "panel": "2", - "Order": "a069_", - "Type": "Toggle" + "Type": "Button", + "ButtonWidth": "300" } } diff --git a/KnownIssues.md b/docs/KnownIssues.md similarity index 89% rename from KnownIssues.md rename to docs/KnownIssues.md index 4acc89d1..3f1e5ce8 100644 --- a/KnownIssues.md +++ b/docs/KnownIssues.md @@ -7,7 +7,7 @@ - If you are having TLS 1.2 issues, or are having trouble resolving `christitus.com/win` then run with the following command: -``` +```ps1 [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12;iex(New-Object Net.WebClient).DownloadString('https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1') ``` @@ -22,14 +22,14 @@ If you are still having issues try using a **VPN**, or changing your **DNS provi - Script doesn't run/PowerShell crashes: 1. Press Windows Key+X and select 'PowerShell (Admin)' (Windows 10) or 'Windows Terminal (Admin)' (Windows 11) 2. Run: - ``` + ```ps1 Set-ExecutionPolicy Unrestricted -Scope Process -Force ``` 3. Run: - ``` + ```ps1 irm christitus.com/win | iex ``` - + ### Other Issues: - Windows taking longer to shut down: @@ -38,12 +38,12 @@ If you are still having issues try using a **VPN**, or changing your **DNS provi control /name Microsoft.PowerOptions /page pageGlobalSettings ``` - If that doesn't work, Disable Hibernation: Press Windows Key+X and select 'PowerShell (Admin)' (Windows 10) or 'Windows Terminal (Admin)' (Windows 11) and enter: - ``` + ```ps1 powercfg /H off ``` - [#69](https://github.com/ChrisTitusTech/winutil/issues/69) [95](https://github.com/ChrisTitusTech/winutil/issues/95) [#232](https://github.com/ChrisTitusTech/winutil/issues/232) Windows Search does not work: Enable Background Apps - [#198](https://github.com/ChrisTitusTech/winutil/issues/198) Xbox Game Bar Activation Broken: Set the Xbox Accessory Management Service to Automatic -``` +```ps1 Get-Service -Name "XboxGipSvc" | Set-Service -StartupType Automatic ``` @@ -51,14 +51,3 @@ Get-Service -Name "XboxGipSvc" | Set-Service -StartupType Automatic - (Windows 11) Quick Settings no longer works: Launch the Script and click 'Enable Action Center' - Explorer no longer launches: Go to Control Panel, File Explorer Options, Change the 'Open File Explorer to' option to 'This PC'. - -- Script doesn't run/PowerShell crashes: - 1. Press Windows Key+X and select 'PowerShell (Admin)' (Windows 10) or 'Windows Terminal (Admin)' (Windows 11) - 2. Run: - ``` - Set-ExecutionPolicy Unrestricted -Scope Process -Force - ``` - 3. Run: - ``` - irm christitus.com/win | iex - ``` diff --git a/docs/assets/CommitGHD.png b/docs/assets/CommitGHD.png new file mode 100644 index 00000000..8ab089b2 Binary files /dev/null and b/docs/assets/CommitGHD.png differ diff --git a/docs/assets/CreateBranch.png b/docs/assets/CreateBranch.png new file mode 100644 index 00000000..8d5eef07 Binary files /dev/null and b/docs/assets/CreateBranch.png differ diff --git a/docs/assets/ForkButton.png b/docs/assets/ForkButton.png new file mode 100644 index 00000000..9632f271 Binary files /dev/null and b/docs/assets/ForkButton.png differ diff --git a/wiki/Get-Installed.png b/docs/assets/Get-Installed.png similarity index 100% rename from wiki/Get-Installed.png rename to docs/assets/Get-Installed.png diff --git a/docs/assets/MicroWinScreen.png b/docs/assets/MicroWinScreen.png new file mode 100644 index 00000000..b815187d Binary files /dev/null and b/docs/assets/MicroWinScreen.png differ diff --git a/docs/assets/ProgramInstall.png b/docs/assets/ProgramInstall.png new file mode 100644 index 00000000..654fcadc Binary files /dev/null and b/docs/assets/ProgramInstall.png differ diff --git a/docs/assets/ProgramInstallButton.png b/docs/assets/ProgramInstallButton.png new file mode 100644 index 00000000..1bfb5cb0 Binary files /dev/null and b/docs/assets/ProgramInstallButton.png differ diff --git a/docs/assets/ProgramUninstall.png b/docs/assets/ProgramUninstall.png new file mode 100644 index 00000000..0f1b8d3d Binary files /dev/null and b/docs/assets/ProgramUninstall.png differ diff --git a/wiki/Settings-Export.png b/docs/assets/Settings-Export.png similarity index 100% rename from wiki/Settings-Export.png rename to docs/assets/Settings-Export.png diff --git a/docs/assets/TweaksScreen.PNG b/docs/assets/TweaksScreen.PNG new file mode 100644 index 00000000..6ed96b0e Binary files /dev/null and b/docs/assets/TweaksScreen.PNG differ diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png new file mode 100644 index 00000000..a4f4bc5d Binary files /dev/null and b/docs/assets/favicon.png differ diff --git a/screen-install.png b/docs/assets/screen-install.png similarity index 100% rename from screen-install.png rename to docs/assets/screen-install.png diff --git a/docs/contribute.md b/docs/contribute.md new file mode 100644 index 00000000..857f425e --- /dev/null +++ b/docs/contribute.md @@ -0,0 +1,57 @@ +# How to Contribute? + +## Issues + +* If you encounter any challenges or problems with the script, I kindly request that you submit them via the "Issues" tab on the GitHub repository. By filling out the provided template, you can provide specific details about the issue, allowing me (and others in the community) to promptly address any bugs, or consider feature requests. + +## Contribute Code + +* Pull Requests are now handled directly on the **MAIN branch**. This was done since we can now select specific releases to launch via releases in GitHub. + +* If you're doing code changes, then you can submit a PR to `main` branch, but I am very selective about these. + +> [!WARNING] +> Do not use a code formatter, massive amounts of line changes, and make multiple feature changes. +> EACH FEATURE CHANGE SHOULD BE IT'S OWN Pull Request! + +* When creating pull requests, it is essential to thoroughly document all changes made. This includes, but not limited to, documenting any additions made to the `tweaks` section and corresponding `undo tweak`, so users are able to remove the newly added tweaks if necessary, and comprehensive documentation is required for all code changes, document your changes and briefly explain why you made your changes in your Pull Request Description. Failure to adhere to this format may result in denial of the pull request. Additionally, Any code lacking sufficient documentation may also be denied. + +* By following these guidelines, we can maintain a high standard of quality and ensure that the codebase remains organized and well-documented. + +> [!NOTE] +> When creating a function, please include "WPF" or "WinUtil" in the file name so it can be loaded into the runspace. + +## Walk through + +### Fork the Repo +* Fork the WinUtil Repository [here](https://github.com/ChrisTitusTech/winutil) to create a copy that will be available in your Repository-list. +![Fork](assets/ForkButton.png) + +### Clone the Fork +* While you can make your changes directly through the Web, we recommend cloning the repo to your device to test your fork easily. +* Using the application GitHub Desktop (available in WinUtil) you can easily manage your repos locally. You can do it using other tools like git-cli (available in WinUtil), we recommend GitHub Desktop for ease of use. +* Install GitHub Desktop if not already installed +* Log in using the same GitHub account u used to fork WinUtil +* Choose the fork under "Your Repositories" and press "clone {repo name}" +* Create a new Branch and name it something relatable to your changes, + +* Now you can modify WinUtil to your liking using your prefered text editor. + + +### Testing your changes +* To test to see if your changes work as intended run following commands in a powershell teminal: + +* Change the directory where you are running the commands to the forked project. +* `cd {path to the folder with the compile.ps1}` +* Run following command to compile and run Winutil +* `.\Compile.ps1 -run` +* After seeing that your changes work properly feel free to commit the changes to the repository and make a PR, for help on that follow the documentation below. + +### Commiting the changes +* Commit your changes once you are fine with the result +* Push the changes to "upload" them to your fork on github.com. + +### Making a PR +* To make a PR on your repo under a new branch linking to the main branch a button will show and say Preview and Create pull request. Click that button and fill in all information that is provided on the template. Once all the information is filled in correctly check your PR to make sure there is not a WinUtil.ps1 file attached to the PR. Once everything is good make the PR and wait for Chris (The Maintainer) to accept or deny your PR. Once it is accepted in by Chris you will be able to see your changes in the /windev build. +* If you do not see your feature in the main /win build that is fine. As all new changes go into the /windev build to make sure everything is working ok before going fully public. +* Congrats you just submitted your first PR. Thank you so much for contributing to WinUtil. \ No newline at end of file diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 00000000..e3b3daef --- /dev/null +++ b/docs/faq.md @@ -0,0 +1,4 @@ +# FAQ's + +## How do I uninstall WinUtil? +* You do not have to uninstall WinUtil. As it is a script you run from Powershell it only loads into your RAM. This means as soon as you close WinUtil it will be deleted off your system. \ No newline at end of file diff --git a/docs/img/ProgramInstall.png b/docs/img/ProgramInstall.png new file mode 100644 index 00000000..654fcadc Binary files /dev/null and b/docs/img/ProgramInstall.png differ diff --git a/docs/img/ProgramInstallButton.png b/docs/img/ProgramInstallButton.png new file mode 100644 index 00000000..4a3b181b Binary files /dev/null and b/docs/img/ProgramInstallButton.png differ diff --git a/docs/img/favicon.png b/docs/img/favicon.png new file mode 100644 index 00000000..a4f4bc5d Binary files /dev/null and b/docs/img/favicon.png differ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..ace691f3 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,12 @@ +# Welcome to Chris Titus WinUtil Official Documentation! + +[![](https://dcbadge.limes.pink/api/server/https://discord.gg/RUbZUZyByQ)](https://discord.gg/RUbZUZyByQ) + +## Running + +There are 4 ways to run WinUtil. The 4 ways goes as follows: + +* `irm christitus.com/win | iex` - Runs WinUtil from ChrisTitus's website using the latest Full Releases. +* `irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/winutil.ps1 | iex` - Runs WinUtil from github using the latest Full Release. +* `irm christitus.com/windev | iex` - Runs WinUtil from ChrisTitus website using the latest Pre-Release. +* `irm https://github.com/ChrisTitusTech/winutil/releases/latest/download/windev.ps1 | iex` - Runs WinUtil from github using the latest Pre-Release. \ No newline at end of file diff --git a/docs/updates.md b/docs/updates.md new file mode 100644 index 00000000..758fc4bd --- /dev/null +++ b/docs/updates.md @@ -0,0 +1,3 @@ +# Update Log + +# \ No newline at end of file diff --git a/docs/userguide.md b/docs/userguide.md new file mode 100644 index 00000000..38a1e412 --- /dev/null +++ b/docs/userguide.md @@ -0,0 +1,159 @@ +# User Guide + +## Overview +* short one + + +## Walkthrough + +### Program + +#### Installation & Updates +* To install programs select the programs you wish to install or update like the picture below. +![Program Install](assets/ProgramInstall.png) +* Once you have selected the programs you wish to install click the select Install/Upgrade Selected button as seen below. +![Program Install Button](assets/ProgramInstallButton.png) + +#### Upgrade All +* Press the button to upgrade all installed programs that are supported by WinGet, there is no selection needed. + +#### Uninstall +* To uninstall programs select the programs you wish to uninstall like the picture below. +![Program Uninstall](assets/ProgramInstall.png) +* Once you have selected the programs you wish to uninstall click the select Uninstall Selected button as seen below. +![Program Uninstall Button](assets/ProgramUninstall.png) + +#### Get Installed +* Checks for installed programs that are supported by WinGet and selects them in the Utility. + +#### Clear Selection +* Clears ur current selection so no program is checked. + +### Tweaks + +#### Tweaks Addition +* To enable tweaks on your system select Tweaks at the top next to Install. +* Then you can select what tweaks you want adding to your system. We do have some presets you can select from at the top you can see this in the picture below. +![Tweaks Screen](assets/TweaksScreen.PNG) +* After you have chosen your tweaks click the Run Tweaks button at the bottom of the screen. + +#### Tweaks Removal +* To disable tweaks on your system select Tweaks at the top next to Install. +* Then you can select what tweaks you want removing from your system. +* After you have chosen your tweaks you want to remove click the Undo Selected Tweaks button at the bottom of the screen. + +#### Essential Tweaks +* The Tweaks under the Essential + +#### Advanced Tweaks - CAUTION + +#### O&O Shutup + +#### DNS + +#### Customize Preferences + +#### Performance Plans + +#### Shortcuts + + +![Tweaks Screen](assets/TweaksScreen.PNG) + +### Config + +#### Features +* Install the most used Windows Features by checking the checkbox and clicking "Install Features" to install them + +#### Fixes +* Quick Fixes for your system if you are having Issues. + +* Set Up Autologin +* Reset Windows Update +* Reset Network +* System Corruption Scan +* WinGet Reinstall +* Remove Adobe Creative Cloud + +#### Legacy Windows Panels + +### Updates | Not working rn + +### MicroWin + +**MicroWin** lets you customize your Windows 10 and 11 installation images by debloating them however you want. + +![MicroWin](assets/MicroWinScreen.png) + +#### Basic usage + +1. Specify the source Windows ISO to customize + + * If you don't have a Windows ISO file prepared, you can download it using the Media Creation Tool for the respective Windows version. [Here](https://go.microsoft.com/fwlink/?linkid=2156295) is the Windows 11 version, and [here](https://go.microsoft.com/fwlink/?LinkId=2265055) is the Windows 10 version + +2. Configure the debloat process +3. Specify the target location for the new ISO file +4. Let the magic happen! + +**NOTE:** this feature is still in development and you may encounter some issues with the generated images. If that happens, don't hesitate to report an issue! + +#### Options + +* **Download oscdimg.exe from CTT GitHub repo** will grab a OSCDIMG executable from the GitHub repository instead of a Chocolatey package + + OSCDIMG is the tool that lets the program create ISO images. Typically, you would find this in the [Windows Assessment and Deployment Kit](https://learn.microsoft.com/en-us/windows-hardware/get-started/adk-install) + +* Selecting a scratch directory will copy the contents of the ISO file to the directory you specify instead of an automatically generated folder on the `%TEMP%` directory +* You can select an edition of Windows to debloat (**SKU**) using the convenient drop-down menu + + By default, MicroWin will debloat the Pro edition, but you can choose any edition you want + + +##### Customization options + +* **Keep Provisioned Packages**: leaving this option unticked (default) will try to remove every operating system package + + Some packages may remain after processing. This can happen if the packages in question were permanent ones or had been superseded by newer versions + +* **Keep Appx Packages**: leaving this option unticked (default) will try to remove every Microsoft Store app from the Windows image + + This option will exclude some applications that are essential in the case that you want or need to add a Store app later on + +* **Keep Defender**: leaving this option unticked will try to remove every part of Windows Defender, including the Windows Security app + + Leaving this option unticked is **NOT recommended** unless you plan to use a third-party antivirus solution on your MicroWin installation. On that regard, don't install AVs with bad reputation or rogueware + +* **Keep Edge**: leaving this option unticked will try to remove every part of the Microsoft Edge browser using the best methods available + + Leaving this option unticked is not recommended because it might break some applications that might depend on the `Edge WebView2` runtime. However, if that happens, you can easily [reinstall it](https://developer.microsoft.com/en-us/microsoft-edge/webview2) + + +##### Driver integration options + +* **Inject drivers** will add the drivers in the folder that you specify to the target Windows image +* **Import drivers from current system** will add every third-party driver that is present in your active installation + + This makes the target image have the same hardware compatibility of the active installation. However, this means that you will only be able to install the target Windows image and take full advantage of it on computers with **the same hardware**. To avoid this, you'll need to customize the `install.wim` file of the target ISO in the `sources` folder + + +##### Ventoy options + +* **Copy to Ventoy** will copy the target ISO file to any USB drive with [Ventoy](https://ventoy.net/en/index.html) installed + + Ventoy is a solution that lets you boot to any ISO file stored in a drive. Think of it as having multiple bootable USBs in one. Do note though that your drive needs to have enough free space for the target ISO file + + +## Automation + +* Some features are available through automation. This allows you to save your config file pass it to Winutil walk away and come back to a finished system. Here is how you can set it up currently with Winutil >24.01.15 + +* On the Install Tab, click "Get Installed", this will get all installed apps **supported by Winutil** on the system +![GetInstalled](assets/Get-Installed.png) +* Click on the Settings cog in the upper right corner and chose Export, chose file file and location, this will export the setting file. +![SettingsExport](assets/Settings-Export.png) +* Copy this file to a USB or somewhere you can use after Windows installation. +* Use Microwin tab to create a custom Windows image. +* Install the Windows image. +* In the new Windows, Open PowerShell in the admin mode and run command to automatically apply tweaks and install apps from the config file. +* ``` iex "& { $(irm christitus.com/win) } -Config [path-to-your-config] -Run" ``` +* Have a cup of coffee! Come back when it's done. \ No newline at end of file diff --git a/functions/private/ConvertTo-Icon.ps1 b/functions/private/ConvertTo-Icon.ps1 index 5ed7f5e7..44f4d6be 100644 --- a/functions/private/ConvertTo-Icon.ps1 +++ b/functions/private/ConvertTo-Icon.ps1 @@ -2,26 +2,92 @@ function ConvertTo-Icon { <# .DESCRIPTION - This function will convert PNG to ICO file + This function will convert BMP, GIF, EXIF, JPG, PNG and TIFF to ICO file + + .PARAMETER bitmapPath + The file path to bitmap image to make '.ico' file out of. + Supported file types according to Microsoft Documentation is the following: + BMP, GIF, EXIF, JPG, PNG and TIFF. + + .PARAMETER iconPath + The file path to write the new '.ico' resource. + + .PARAMETER overrideIconFile + An optional boolean Parameter that makes the function overrides + the Icon File Path if the file exists. Defaults to $true. .EXAMPLE - ConvertTo-Icon -bitmapPath "$env:TEMP\cttlogo.png" -iconPath $iconPath + try { + ConvertTo-Icon -bitmapPath "$env:TEMP\cttlogo.png" -iconPath "$env:TEMP\cttlogo.ico" + } catch [System.IO.FileNotFoundException] { + # Handle the thrown exception here... + } + + This Example makes a '.ico' file at "$env:TEMP\cttlogo.ico" File Path using the bitmap file + found in "$env:TEMP\cttlogo.png", the function overrides the '.ico' File if it's found. + this function will throw a FileNotFound Exception at the event of not finding the provided bitmap File Path. + + .EXAMPLE + try { + ConvertTo-Icon "$env:TEMP\cttlogo.png" "$env:TEMP\cttlogo.ico" + } catch [System.IO.FileNotFoundException] { + # Handle the thrown exception here... + } + + This Example is the same as Example 1, but uses Positional Parameters instead. + + .EXAMPLE + if (Test-Path "$env:TEMP\cttlogo.png") { + ConvertTo-Icon -bitmapPath "$env:TEMP\cttlogo.png" -iconPath "$env:TEMP\cttlogo.ico" + } + + This Example is same as Example 1, but checks if the bitmap File exists before calling 'ConvertTo-Icon' Function. + This's the recommended way of using this function, as it doesn't require any try-catch blocks. + + .EXAMPLE + try { + ConvertTo-Icon -bitmapPath "$env:TEMP\cttlogo.png" -iconPath "$env:TEMP\cttlogo.ico" -overrideIconFile $false + } catch [System.IO.FileNotFoundException] { + # Handle the thrown exception here... + } + + This Example make use of '-overrideIconFile' Optional Parameter, the default for this paramter is $true. + By doing '-overrideIconFile $false', the 'ConvertTo-Icon' function will raise an exception that needs to be catched throw a 'catch' Code Block, + otherwise it'll crash the running PowerShell instance/process. + #> - param( [Parameter(Mandatory=$true)] - $bitmapPath, - $iconPath = "$env:temp\newicon.ico" + param( + [Parameter(Mandatory=$true, position=0)] + [string]$bitmapPath, + [Parameter(Mandatory=$true, position=1)] + [string]$iconPath, + [Parameter(position=2)] + [bool]$overrideIconFile = $true ) Add-Type -AssemblyName System.Drawing if (Test-Path $bitmapPath) { + if ((Test-Path $iconPath) -AND ($overrideIconFile -eq $false)) { + Write-Host "[ConvertTo-Icon] Icon File is found at '$iconPath', and the 'overrideIconFile' Parameter is set to '$overrideIconFile'. Skipping the bitmap to icon convertion..." -ForegroundColor Yellow + return + } + + # Load bitmap file into memory, and make an Icon version out of it $b = [System.Drawing.Bitmap]::FromFile($bitmapPath) $icon = [System.Drawing.Icon]::FromHandle($b.GetHicon()) + + # Create the folder for the new icon file if it doesn't exists + $iconFolder = (New-Object System.IO.FileInfo($iconPath)).Directory.FullName + [System.IO.Directory]::CreateDirectory($iconFolder) | Out-Null + + # Write the Icon File and do some cleaning-up $file = New-Object System.IO.FileStream($iconPath, 'OpenOrCreate') $icon.Save($file) $file.Close() $icon.Dispose() - #explorer "/SELECT,$iconpath" } - else { Write-Warning "$BitmapPath does not exist" } -} \ No newline at end of file + else { + throw [System.IO.FileNotFoundException] "[ConvertTo-Icon] The provided bitmap File Path is not found at '$bitmapPath'." + } +} diff --git a/functions/private/Get-TabXaml.ps1 b/functions/private/Get-TabXaml.ps1 index ea6d69f5..231af7af 100644 --- a/functions/private/Get-TabXaml.ps1 +++ b/functions/private/Get-TabXaml.ps1 @@ -6,8 +6,10 @@ function Get-TabXaml { 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 + The number of columns to display the applications in, default is 0 .OUTPUTS The XAML for the tab .EXAMPLE @@ -15,10 +17,20 @@ function Get-TabXaml { #> - param( [Parameter(Mandatory=$true)] - $tabname, - $columncount = 0 + 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) { @@ -39,6 +51,7 @@ function Get-TabXaml { 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)) { @@ -53,7 +66,22 @@ function Get-TabXaml { # Add Order property to keep the original order of tweaks and features $organizedData[$appObject.panel][$appInfo.Category]["$($appInfo.order)$appName"] = $appObject } - $panelcount=0 + + # 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 @@ -61,19 +89,27 @@ function Get-TabXaml { $paneltotal = $columncount } # add ColumnDefinitions to evenly draw colums - $blockXml="`r`n"+("`r`n"*($paneltotal))+"`r`n" - # Iterate through organizedData by panel, category, and application + $blockXml = "" + $blockXml += $("`r`n" + " " * ($spaces_per_tab * $tab_repeat) + + "") * $paneltotal + $blockXml += $("`r`n" + " " * ($spaces_per_tab * ($tab_repeat - 1))) + + "" + "`r`n" + + # Iterate through 'organizedData' by panel, category, and application $count = 0 foreach ($panel in ($organizedData.Keys | Sort-Object)) { - $blockXml += "`r`n`r`n" + $blockXml += $precal_indent_m1 + "" + "`r`n" + $blockXml += $precal_indent + "" + "`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 +="`r`n`r`n`r`n" - $blockXml += "`r`n`r`n" + $blockXml += $precal_indent_p2 + "" + "`r`n" + $blockXml += $precal_indent_p1 + "" + "`r`n" + $blockXml += $precal_indent_p1 + "" + "`r`n" + $blockXml += $precal_indent_p2 + "" + "`r`n" $panelcount++ } } @@ -83,49 +119,99 @@ function Get-TabXaml { $categorycontent = $($category -replace '^.__', '') $categoryname = Get-WPFObjectName -type "Label" -name $categorycontent - $blockXml += "`r`n`r`n" - $blockXml += "`r`n`r`n" + $blockXml += $precal_indent_m1 + + "" + "`r`n" + $blockXml += $precal_indent_m2 + + "" + "`r`n" + $blockXml += $precal_indent_m2 + + "" + "`r`n" + $blockXml += $precal_indent_m1 + + "" + "`r`n" $panelcount++ } } + $appInfo = $organizedData[$panel][$category][$appName] - if ("Toggle" -eq $appInfo.Type) { - $blockXml += "`r`n`r`n" - } elseif ("Combobox" -eq $appInfo.Type) { - $blockXml += "`r`n" - # If it is a digit, type is button and button length is digits - } elseif ($appInfo.Type -match "^[\d\.]+$") { - $blockXml += "