├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.yml
│ ├── config.yml
│ └── feature_request.yml
└── workflows
│ ├── ci.yml
│ └── codeql-analysis.yml
├── .gitignore
├── LICENSE
├── README.md
├── assets
├── pages
│ ├── endpage.png
│ ├── page-actioncenter.png
│ ├── page-androidapps.png
│ ├── page-apps.png
│ ├── page-fileexplorer.png
│ ├── page-gaming.png
│ ├── page-gestures.png
│ ├── page-lockscreen.png
│ ├── page-look.png
│ ├── page-msstore.png
│ ├── page-privacy.png
│ ├── page-settingsapp.png
│ ├── page-snaplayouts.png
│ ├── page-startmenu.png
│ ├── page-touchkeyboard.png
│ ├── page-wallpapers.png
│ ├── page-widgets.png
│ ├── page-windowsupdates.png
│ └── startpage.png
└── tiw11.png
├── changes.txt
├── collections
├── Disable TPM 2.0 Check.ini
├── Enable AutoAdminLogon.ini
├── Enable Classic Context menus.ini
├── Join Domain.ini
├── NoADS_for_TIW11.zip
├── Win10X Boot Animation.ini
├── aal_off.bat
├── aal_on.bat
├── drag_drop_fix.zip
├── readme
├── tpm_off.bat
└── tpm_on.bat
└── src
├── TIW11.sln
└── TIW11
├── App.config
├── AppIcon.ico
├── AppLogo.png
├── Controls
└── RoundedButton.cs
├── Helpers
├── DependenciesChecker.cs
├── Strings.cs
├── ThemeHelper.cs
└── Utils.cs
├── MainWindow.Designer.cs
├── MainWindow.cs
├── MainWindow.resx
├── Modules
├── Extensions
│ ├── PluginsBase.cs
│ └── PluginsBindingList.cs
├── GetStarted
│ ├── OS.cs
│ └── Pages.cs
└── OpenTweaks
│ ├── AssessmentBase.cs
│ ├── AssessmentNode.cs
│ ├── Assessments
│ ├── Apps
│ │ ├── AccountInfo.cs
│ │ ├── AppNotifications.cs
│ │ ├── BackgroundApps.cs
│ │ ├── Calendar.cs
│ │ ├── Call.cs
│ │ ├── CallHistory.cs
│ │ ├── Camera.cs
│ │ ├── CellularData.cs
│ │ ├── Contacts.cs
│ │ ├── DiagnosticInformation.cs
│ │ ├── Documents.cs
│ │ ├── Email.cs
│ │ ├── EyeGaze.cs
│ │ ├── FileSystem.cs
│ │ ├── Messaging.cs
│ │ ├── Microphone.cs
│ │ ├── Motion.cs
│ │ ├── Notifications.cs
│ │ ├── OtherDevices.cs
│ │ ├── Pictures.cs
│ │ ├── Radios.cs
│ │ ├── Tasks.cs
│ │ ├── TrackingApps.cs
│ │ ├── Videos.cs
│ │ └── desktop.ini
│ ├── Desktop
│ │ ├── AppsTheme.cs
│ │ ├── SnapAssistFlyout.cs
│ │ ├── Stickers.cs
│ │ ├── Transparency.cs
│ │ ├── Widgets.cs
│ │ ├── WidgetsR.cs
│ │ └── WindowsTheme.cs
│ ├── Explorer
│ │ ├── FileExplorer.cs
│ │ ├── HiddenFileExt.cs
│ │ └── HiddenFileFolder.cs
│ ├── Gaming
│ │ ├── GameDVR.cs
│ │ ├── PowerThrottling.cs
│ │ ├── VisualFX.cs
│ │ └── desktop.ini
│ ├── Paranoia
│ │ ├── CleanMgr.cs
│ │ ├── ExplorerPatcher.cs
│ │ ├── ShutUp11.cs
│ │ └── WindowsSpyBlocker.cs
│ ├── Privacy
│ │ ├── Advertising.cs
│ │ ├── AppsAutoInstall.cs
│ │ ├── Biometrics.cs
│ │ ├── CompatibilityTelemetry.cs
│ │ ├── DiagnosticData.cs
│ │ ├── Feedback.cs
│ │ ├── LocationTracking.cs
│ │ ├── SuggestedContent.cs
│ │ ├── TailoredExperiences.cs
│ │ ├── Telemetry.cs
│ │ └── WindowsTips.cs
│ ├── Settings
│ │ └── RestorePoint.cs
│ ├── System
│ │ ├── EnableWSL.cs
│ │ ├── FaxPrinter.cs
│ │ ├── HyperV.cs
│ │ ├── InstallWSA.cs
│ │ ├── RemoveW11Watermark.cs
│ │ ├── TeamsAutostart.cs
│ │ └── XPSWriter.cs
│ ├── Taskbar
│ │ ├── MostUsedApps.cs
│ │ ├── TaskView.cs
│ │ ├── TaskbarAl.cs
│ │ ├── TaskbarChat.cs
│ │ ├── TaskbarMM.cs
│ │ ├── TaskbarSearch.cs
│ │ └── TaskbarSi.cs
│ └── Update
│ │ └── Wusa.cs
│ ├── ErrorHelper.cs
│ ├── ITreeNode.cs
│ ├── RegistryHelper.cs
│ └── WindowsHelper.cs
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
├── Resources.Designer.cs
├── Resources.resx
├── Resources
└── systemApps.txt
├── ThisIsWin11.csproj
├── Views
├── AppsWindow.Designer.cs
├── AppsWindow.cs
├── AppsWindow.resx
├── AutomateWindow.Designer.cs
├── AutomateWindow.cs
├── AutomateWindow.resx
├── CustomizeWindow.Designer.cs
├── CustomizeWindow.cs
├── CustomizeWindow.resx
├── ExtensionsWindow.Designer.cs
├── ExtensionsWindow.cs
├── ExtensionsWindow.resx
├── HomeWindow.Designer.cs
├── HomeWindow.cs
├── HomeWindow.resx
├── PackagesWindow.Designer.cs
├── PackagesWindow.cs
├── PackagesWindow.resx
├── SettingsWindow.Designer.cs
├── SettingsWindow.cs
└── SettingsWindow.resx
└── app.manifest
/.github/ISSUE_TEMPLATE/bug_report.yml:
--------------------------------------------------------------------------------
1 | name: Bug report
2 | description: Create a report to help us improve (search for duplicates first)
3 | labels: bug
4 | body:
5 | - type: textarea
6 | attributes:
7 | label: Issue description
8 | description: Explain clearly and unambiguously what went wrong
9 | placeholder: |
10 | Tell us here about the bug/problem
11 | validations:
12 | required: true
13 | - type: textarea
14 | attributes:
15 | label: How to reproduce this issue?
16 | description: Try to explain what you did for the bug to occur. A good explanation of steps to reproduce helps us locate the bug faster. If applicable, add screenshots to help explain your problem.
17 | placeholder: |
18 | Step 1: ...
19 | Step 2: ...
20 | ...
21 | validations:
22 | required: true
23 | - type: textarea
24 | attributes:
25 | label: Details
26 | description: To understand the issue, we need some details of your setup & system
27 | placeholder: |
28 | Version: v1.12.2 / v1.9 ...]
29 | validations:
30 | required: true
31 | - type: textarea
32 | attributes:
33 | label: Logs
34 | description:
35 | placeholder: |
36 | [example_log.txt / example_log.md ...]
37 | validations:
38 | required: false
39 | - type: checkboxes
40 | attributes:
41 | label: Issue tracker rule checks (please read carefully)
42 | options:
43 | - label: "I have checked that my problem is not already reported"
44 | required: true
45 | - label: "I have checked that my problem is not already fixed"
46 | required: true
47 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.yml:
--------------------------------------------------------------------------------
1 | name: Request a Feature
2 | description: Create a report to help us improve (search for duplicates first)
3 | labels: enhancement
4 | body:
5 | - type: textarea
6 | attributes:
7 | label: Feature description
8 | description: Explain clearly
9 | placeholder: |
10 | Tell us here about the feature
11 | validations:
12 | required: true
13 | - type: textarea
14 | attributes:
15 | label: Logs
16 | description: Provide logs
17 | placeholder: |
18 | example_log.txt
19 | validations:
20 | required: false
21 | - type: checkboxes
22 | attributes:
23 | label: Issue tracker rule checks (please read carefully)
24 | options:
25 | - label: "I have checked that this feature is not already asked."
26 | required: true
27 | - label: "I have checked that this feature is not already implemented"
28 | required: true
29 |
30 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | # The name of the work flow. Badges will use this name
2 | name: 'CI'
3 |
4 | on:
5 | push:
6 | branches:
7 | - main
8 | pull_request:
9 | branches:
10 | - main
11 |
12 | jobs:
13 | build:
14 |
15 | runs-on: windows-latest
16 |
17 | steps:
18 | - uses: actions/checkout@v2
19 |
20 | - name: Setup MSBuild Path
21 | uses: microsoft/setup-msbuild@v1.1
22 |
23 | - name: Build ThisIsWin11
24 | run: |
25 | $env:PLATFORM="Any CPU"
26 | msbuild src\TIW11.sln /p:Configuration="Release" /p:Platform="Any CPU" -verbosity:diag
--------------------------------------------------------------------------------
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | #
7 | # ******** NOTE ********
8 | # We have attempted to detect the languages in your repository. Please check
9 | # the `language` matrix defined below to confirm you have the correct set of
10 | # supported CodeQL languages.
11 | #
12 | name: "CodeQL"
13 |
14 | on:
15 | push:
16 | branches: [ "main" ]
17 | pull_request:
18 | # The branches below must be a subset of the branches above
19 | branches: [ "main" ]
20 | schedule:
21 | - cron: '32 9 * * 2'
22 |
23 | jobs:
24 | analyze:
25 | name: Analyze
26 | runs-on: ubuntu-latest
27 | permissions:
28 | actions: read
29 | contents: read
30 | security-events: write
31 |
32 | strategy:
33 | fail-fast: false
34 | matrix:
35 | language: [ 'csharp' ]
36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37 | # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38 |
39 | steps:
40 | - name: Checkout repository
41 | uses: actions/checkout@v3
42 |
43 | # Initializes the CodeQL tools for scanning.
44 | - name: Initialize CodeQL
45 | uses: github/codeql-action/init@v2
46 | with:
47 | languages: ${{ matrix.language }}
48 | # If you wish to specify custom queries, you can do so here or in a config file.
49 | # By default, queries listed here will override any specified in a config file.
50 | # Prefix the list here with "+" to use these queries and those in the config file.
51 |
52 | # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53 | # queries: security-extended,security-and-quality
54 |
55 |
56 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57 | # If this step fails, then you should remove it and run the build manually (see below)
58 | - name: Autobuild
59 | uses: github/codeql-action/autobuild@v2
60 |
61 | # ℹ️ Command-line programs to run using the OS shell.
62 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63 |
64 | # If the Autobuild fails above, remove it and uncomment the following three lines.
65 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66 |
67 | # - run: |
68 | # echo "Run, Build Application using script"
69 | # ./location_of_script_within_repo/buildscript.sh
70 |
71 | - name: Perform CodeQL Analysis
72 | uses: github/codeql-action/analyze@v2
73 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Builtbybel
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 | 
3 | 
4 | 
5 |
6 |
7 |
8 | ## ... well
9 | # ThisIsWin11
10 | ### which helps you know, set up and customize Windows 11.
11 |
12 | 
13 | _This is not a product made by Microsoft and it's in no way related to them._
14 |
15 |
16 | ## Features
17 | ThisIsWin11 lets you customize Windows 11 all in one place. It is slowly expanded as a practical all-rounder for Windows 11 replacing some discontinued PowerToys components and adding additional ones.
18 |
19 | **Included components**
20 |
21 | - **GetStarted** ThisIsWin11 is starting off with a helpful introduction to what you can find in Windows 11. This component extends Microsoft's Get Started app.
22 | - **OpenTweaks** allows it to customize the more obscure settings of Windows 11 system's UI. It replaces Microsoft PowerToys **[TweakUI](https://en.wikipedia.org/wiki/Tweak_UI)** _(available from Windows 95 - Windows XP)_ which was no longer integrated into the relaunched PowerToys as of Windows 10.
23 | - **PumpedApp** makes it possible to remove unwanted features and apps from Windows 11 such as the Camera and Alarm apps, and other preinstalled bloat that you can live without.
24 | - **Packages** powered by [Windows Package Manager](https://github.com/microsoft/winget-cli) allows you to create your own custom install packages.
25 | - **PowerUI** allows you to apply automation capabilities based on PowerShell and community scripts.
26 | - **Extensions** allows you creating custom tweaks
27 |
28 | ## System Requirements
29 | - Windows 11 ONLY (do NOT use this app on Windows 10)
30 |
31 | ## Download and installing
32 |
33 | ### Download directly from GitHub
34 | - [Click here to download the latest version of ThisIsWin11](https://github.com/builtbybel/ThisIsWin11/releases)
35 |
36 |
37 | ### Installation
38 | Install from [Scoop](https://scoop.sh/):
39 | ```powershell
40 | scoop bucket add extras
41 | scoop install thisiswin11
42 | ```
43 |
44 | Alternatively, a classic installation is not necessary at all, because TIW11 is 100% portable. All you have to do is to extract the `TIW11.zip` archive and run the file provided as .exe
45 |
46 | ## Support
47 | If you like the tool please consider supporting me via PayPal.
48 |
49 | - You can [buy me a coffee or donut, some banana, a shirt, BMW i4 or Taycan, the stars or whatever you want here](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@builtbybel.com&lc=US&item_name=%20Builtbybel&no_note=0&cn=¤cy_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted)
50 |
51 | ## Credits
52 | Icon by [Alfredo Creates, CC Atribution](https://icon-icons.com/de/symbol/Unternehmens-social-media-logo-Marke-windows/82802)
53 |
54 | ---
55 | > [builtbybel](https://www.builtbybel.com) ·
56 | > GitHub [@builtbybel](https://github.com/builtbybel) ·
57 | > Twitter [@builtbybel](https://twitter.com/builtbybel)
58 |
--------------------------------------------------------------------------------
/assets/pages/endpage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/endpage.png
--------------------------------------------------------------------------------
/assets/pages/page-actioncenter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-actioncenter.png
--------------------------------------------------------------------------------
/assets/pages/page-androidapps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-androidapps.png
--------------------------------------------------------------------------------
/assets/pages/page-apps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-apps.png
--------------------------------------------------------------------------------
/assets/pages/page-fileexplorer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-fileexplorer.png
--------------------------------------------------------------------------------
/assets/pages/page-gaming.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-gaming.png
--------------------------------------------------------------------------------
/assets/pages/page-gestures.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-gestures.png
--------------------------------------------------------------------------------
/assets/pages/page-lockscreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-lockscreen.png
--------------------------------------------------------------------------------
/assets/pages/page-look.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-look.png
--------------------------------------------------------------------------------
/assets/pages/page-msstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-msstore.png
--------------------------------------------------------------------------------
/assets/pages/page-privacy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-privacy.png
--------------------------------------------------------------------------------
/assets/pages/page-settingsapp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-settingsapp.png
--------------------------------------------------------------------------------
/assets/pages/page-snaplayouts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-snaplayouts.png
--------------------------------------------------------------------------------
/assets/pages/page-startmenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-startmenu.png
--------------------------------------------------------------------------------
/assets/pages/page-touchkeyboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-touchkeyboard.png
--------------------------------------------------------------------------------
/assets/pages/page-wallpapers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-wallpapers.png
--------------------------------------------------------------------------------
/assets/pages/page-widgets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-widgets.png
--------------------------------------------------------------------------------
/assets/pages/page-windowsupdates.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/page-windowsupdates.png
--------------------------------------------------------------------------------
/assets/pages/startpage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/pages/startpage.png
--------------------------------------------------------------------------------
/assets/tiw11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/assets/tiw11.png
--------------------------------------------------------------------------------
/changes.txt:
--------------------------------------------------------------------------------
1 |
2 | This release of ThisIsWin11 fixes some minor issues and has been repackaged with the new BloatyNosy app https://github.com/builtbybel/BloatyNosy. This univeral Debloater and PC Manager is going to be sooner or later the successor of ThisIsWin11.
3 |
--------------------------------------------------------------------------------
/collections/Disable TPM 2.0 Check.ini:
--------------------------------------------------------------------------------
1 | [Info]
2 | Name=Disable TPM 2.0 Check
3 | Description=This Plugin will bypass TPM 2.0, RAM and Secure Boot check
4 | Author=Builtbybel
5 |
6 | [Toggle]
7 | Enable=tpm_on.bat
8 | Disable=tpm_off.bat
9 |
10 | [Status]
11 | Command=REG QUERY "HKLM\SYSTEM\Setup\LabConfig" /V BypassTPMCheck
12 | Type=output
13 | Value=0x1
14 |
--------------------------------------------------------------------------------
/collections/Enable AutoAdminLogon.ini:
--------------------------------------------------------------------------------
1 | [Info]
2 | Name=Enable AutoAdminLogon
3 | Description=This Plugin will enable auto logon with default username and password
4 | Author=Oleksis
5 |
6 | [Toggle]
7 | Enable=aal_on.bat
8 | Disable=aal_off.bat
9 |
10 | [Status]
11 | Command=REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V AutoAdminLogon
12 | Type=output
13 | Value=1
--------------------------------------------------------------------------------
/collections/Enable Classic Context menus.ini:
--------------------------------------------------------------------------------
1 | [Info]
2 | Name=Enable Classic Context menus in Windows 11
3 | Description=This Plugin will enable the classic context menus in Windows 11 (restart required)
4 | Author=Builtbybel
5 |
6 | [Toggle]
7 | Enable=REG ADD "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /VE /T REG_SZ /D "" /F
8 | Disable=REG DELETE "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" /F
9 |
10 | [Status]
11 | Command=REG QUERY "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32"
12 | Type=output
13 | Value=REG_SZ
14 |
--------------------------------------------------------------------------------
/collections/Join Domain.ini:
--------------------------------------------------------------------------------
1 | [Info]
2 | Name=Join Domain
3 | Description=This Plugin will open a window to join domain or rename PC
4 | Author=Builtbybel
5 |
6 | [Toggle]
7 | Enable=sysdm.cpl
8 |
9 | [Status]
10 | Command=REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V DefaultDomainName
11 | Type=output
12 | Value=REG_SZ
--------------------------------------------------------------------------------
/collections/NoADS_for_TIW11.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/collections/NoADS_for_TIW11.zip
--------------------------------------------------------------------------------
/collections/Win10X Boot Animation.ini:
--------------------------------------------------------------------------------
1 | [Info]
2 | Name=Windows 10X Boot Animation
3 | Description=This Plugin will enable the Windows 10X Boot Animation
4 | Author=Vichingo455
5 |
6 | [Toggle]
7 | Enable=reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\BootControl" /v "BootProgressAnimation" /t REG_DWORD /d 1 /f
8 | Disable=reg delete "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\BootControl" /f
9 |
10 | [Status]
11 | Command=REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\BootControl" /V BootProgressAnimation
12 | Type=output
13 | Value=0x1
--------------------------------------------------------------------------------
/collections/aal_off.bat:
--------------------------------------------------------------------------------
1 | REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V AutoAdminLogon /F
2 | REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V DefaultUserName /F
3 | REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V DefaultPassword /F
--------------------------------------------------------------------------------
/collections/aal_on.bat:
--------------------------------------------------------------------------------
1 | REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V AutoAdminLogon /T REG_SZ /D 1 /F
2 | REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V DefaultUserName /T REG_SZ /D %USERNAME% /F
3 | REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /V DefaultPassword /T REG_SZ /D __PASSWORD__ /F
4 | msg "%USERNAME%" "Please add a Password for the currently logged user here: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon |DefaultPassword:"
--------------------------------------------------------------------------------
/collections/drag_drop_fix.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/collections/drag_drop_fix.zip
--------------------------------------------------------------------------------
/collections/readme:
--------------------------------------------------------------------------------
1 | You will find here new objects (plugins, tweaks, scripts, templates etc.) for ThisIsWin11.
2 |
--------------------------------------------------------------------------------
/collections/tpm_off.bat:
--------------------------------------------------------------------------------
1 | REG DELETE HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /V BypassTPMCheck /F
2 | REG DELETE HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /V BypassRAMCheck /F
3 | REG DELETE HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig /V BypassSecureBootCheck /F
--------------------------------------------------------------------------------
/collections/tpm_on.bat:
--------------------------------------------------------------------------------
1 | REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig" /V BypassTPMCheck /T REG_DWORD /D 1 /F
2 | REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig" /V BypassRAMCheck /T REG_DWORD /D 1 /F
3 | REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig" /V BypassSecureBootCheck /T REG_DWORD /D 1 /F
--------------------------------------------------------------------------------
/src/TIW11.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31025.194
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThisIsWin11", "TIW11\ThisIsWin11.csproj", "{787B5529-1330-474B-8F5D-8A7CE2521DFD}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {787B5529-1330-474B-8F5D-8A7CE2521DFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {787B5529-1330-474B-8F5D-8A7CE2521DFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {787B5529-1330-474B-8F5D-8A7CE2521DFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {787B5529-1330-474B-8F5D-8A7CE2521DFD}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {6A746480-2DCC-4165-9F32-6AF26842C1C7}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/src/TIW11/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/TIW11/AppIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/src/TIW11/AppIcon.ico
--------------------------------------------------------------------------------
/src/TIW11/AppLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/builtbybel/ThisIsWin11/24e8f2a0bff240134afe3771646d67a78fb97b9f/src/TIW11/AppLogo.png
--------------------------------------------------------------------------------
/src/TIW11/Controls/RoundedButton.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Runtime.InteropServices;
4 | using System.Windows.Forms;
5 |
6 | namespace ThisIsWin11.Controls
7 | {
8 | internal class RoundedButton : Button
9 | {
10 | [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
11 | private static extern IntPtr RoundPanel(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect, int nWidthEllipse, int nHeightEllipse);
12 |
13 | protected override void OnPaint(PaintEventArgs e)
14 | {
15 | base.OnPaint(e);
16 | IntPtr ptr = RoundPanel(0, 0, Width, Height, 2, 2);
17 | Region = Region.FromHrgn(ptr);
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/TIW11/Helpers/DependenciesChecker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Windows.Forms;
4 |
5 | namespace ThisIsWin11.Helpers
6 | {
7 | internal class DependenciesChecker
8 | {
9 | // Requires Packages module
10 | public static bool IsWingetInstalled()
11 | {
12 | string LocalWindowsAppsDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Microsoft\\WindowsApps\\";
13 | bool ExecutableExists;
14 | if (System.IO.File.Exists(LocalWindowsAppsDir + "winget.exe"))
15 | {
16 | ExecutableExists = true;
17 | }
18 | else
19 | {
20 | MessageBox.Show("We could not locate winget on your System.\nPlease install it by clicking on the button above.", "Packages", MessageBoxButtons.OK, MessageBoxIcon.Warning);
21 | ExecutableExists = false;
22 | }
23 | return ExecutableExists;
24 | }
25 |
26 | //public static void WingetInstallPackage(string packageid)
27 | //{
28 | // var proc = new Process
29 | // {
30 | // StartInfo = new ProcessStartInfo
31 | // {
32 | // FileName = Strings.Paths.ShellWT,
33 | // Arguments = "winget install --id " + packageid + " --accept-source-agreements --accept-package-agreements",
34 | // UseShellExecute = false,
35 | // CreateNoWindow = false,
36 | // }
37 | // };
38 |
39 | // proc.Start();
40 | // proc.WaitForExit();
41 | //}
42 |
43 | }
44 | }
--------------------------------------------------------------------------------
/src/TIW11/Helpers/Strings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Windows.Forms;
4 |
5 | namespace ThisIsWin11.Helpers
6 | {
7 | internal class Strings
8 | {
9 |
10 | public static readonly string TweetIntent = "https://twitter.com/intent/tweet?text=Try%20the%20new%20%23ThisIsWin11%20app%20which%20allows%20you%20to%20customize%20the%20more%20obscure%20settings%20of%20%23Windows11%20systems%20UI.%0a%0ahttps://github.com/builtbybel/ThisIsWin11";
11 |
12 | public static class Data
13 | {
14 | public static string DataRootDir = Application.StartupPath +
15 | @"\data\";
16 |
17 | public static string ScriptsRootDir = Application.StartupPath +
18 | @"\data\scripts\";
19 |
20 | public static string ScriptsLogsDir = Application.StartupPath +
21 | @"\data\scripts\logs\";
22 | }
23 |
24 | public static class Uri
25 | {
26 | public const string URL_ASSEMBLY = "https://raw.githubusercontent.com/builtbybel/ThisIsWin11/main/src/TIW11/Properties/AssemblyInfo.cs";
27 | public const string URL_TWITTER = "https://twitter.com/builtbybel";
28 | public const string URL_DONATE = "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate@builtbybel.com&lc=US&item_name=%20Builtbybel&no_note=0&cn=¤cy_code=USD&bn=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted";
29 | public const string URL_GITREPO = "https://github.com/builtbybel/ThisIsWin11";
30 | public const string URL_FEEDBACK = URL_GITREPO + "/issues/new?labels=crash+report&title=[BUG] or [FEEDBACK] or [SUGGESTION]&body=Describe your issue here:";
31 | public const string URL_GITLATEST = URL_GITREPO +"/releases/latest";
32 | public const string URL_GITCHANGELOG = "https://raw.githubusercontent.com/builtbybel/thisiswin11/main/changes.txt";
33 | public const string URL_POWERUI_PLUGS = "https://github.com/builtbybel/ThisIsWin11/tree/main/collections";
34 | public const string URL_INFOABOUTAPP = "https://www.builtbybel.com/apps/thisiswin11";
35 | }
36 |
37 | public static class Paths
38 | {
39 | public static string SysDir = Path.GetPathRoot(Environment.SystemDirectory);
40 | public static string WinDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows);
41 | public static string AppDataDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
42 | public static string LocalAppDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
43 |
44 | public static string ShellWT = LocalAppDataDir +
45 | @"\Microsoft\WindowsApps\wt.exe";
46 |
47 | public static string ShellCommandPrompt = SysDir +
48 | @"Windows\System32\cmd.exe";
49 |
50 | public static string ShellPS = SysDir +
51 | @"Windows\System32\WindowsPowerShell\v1.0\powershell.exe";
52 | }
53 |
54 | // Create data directory if non present
55 | public static void CreateDataDir()
56 | {
57 | bool dirExists = Directory.Exists(@"data");
58 | if (!dirExists)
59 | Directory.CreateDirectory(@"data");
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/src/TIW11/Helpers/ThemeHelper.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 | using System.Drawing;
4 | using System.Windows.Forms;
5 |
6 | namespace ThisIsWin11
7 | {
8 | public class ThemeHelper
9 | {
10 | // Dark theme
11 | public static Color DarkBackgroundColorNav = Color.FromArgb(21, 21, 21);
12 | public static Color DarkForgroundColorNav = Color.White;
13 | public static Color DarkMouseOverBackColorNav = Color.FromArgb(238, 125, 195);
14 |
15 | public static Color DarkBackgroundColor = Color.FromArgb(32, 32, 32);
16 | public static Color DarkBackgroundContrast = Color.FromArgb(45, 45, 45);
17 |
18 | public static Color DarkForgroundColor = Color.FromArgb(230, 230, 230);
19 | public static Color DarkForgroundAccent = Color.FromArgb(255, 148, 238);
20 |
21 | public static Color DarkMouseOverBackColor = Color.HotPink;
22 |
23 | // Light theme
24 | public static Color LightBackgroundColorNav = Color.White;
25 | public static Color LightForgroundColorNav = Color.Black;
26 | public static Color LightMouseOverBackColorNav = Color.FromArgb(238, 125, 195);
27 |
28 | public static Color LightBackgroundColor = Color.White;
29 | public static Color LightBackgroundContrast = Color.Gainsboro;
30 | public static Color LightBackgroundButtonContrast = Color.White;
31 |
32 | public static Color LightForgroundColor = Color.Black;
33 | public static Color LightForegroundContrast = Color.FromArgb(64,64,64);
34 | public static Color LightForgroundAccent = Color.DimGray;
35 |
36 | public static Color LightMouseOverBackColor = Color.WhiteSmoke;
37 |
38 | // Get default Windows 11 theme
39 | public static bool AppsUseLightTheme()
40 | {
41 | bool AppsUseLightTheme = true;
42 | try
43 | {
44 | using (RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"))
45 | {
46 | if (key != null && key.GetValue("AppsUseLightTheme") != null)
47 | {
48 | Int64 value = Convert.ToInt64(key.GetValue("AppsUseLightTheme").ToString());
49 | if (value == 0)
50 | AppsUseLightTheme = false;
51 | }
52 | }
53 | }
54 | catch (Exception ex)
55 | {
56 | MessageBox.Show(ex.Message, "AppsUseLightTheme");
57 | }
58 |
59 | if (AppsUseLightTheme)
60 | {
61 | return true;
62 | }
63 | else
64 |
65 | return false;
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/Extensions/PluginsBase.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.IO;
3 | using System.Runtime.InteropServices;
4 | using System.Text;
5 | using System.Text.RegularExpressions;
6 |
7 | internal class Plugin
8 | {
9 | public enum PlugStatus
10 | {
11 | Enabled = 1,
12 | Disabled = 0,
13 | Indeterminate = 2
14 | }
15 |
16 | [DllImport("kernel32", CharSet = CharSet.Unicode)]
17 | private static extern int GetPrivateProfileString(string section, string key, string defaultValue, StringBuilder value, int size, string path);
18 |
19 | private readonly string PathDirectory;
20 | private readonly string PathFile;
21 |
22 | public string Name { get; }
23 | public string Description { get; }
24 | public string Author { get; }
25 |
26 | public PlugStatus Status;
27 |
28 | public int State => (int)Status;
29 |
30 | private string Read(string section, string key, string defaultValue = "")
31 | {
32 | var value = new StringBuilder(255);
33 | GetPrivateProfileString(section, key, defaultValue, value, 255, PathFile);
34 | return value.ToString();
35 | }
36 |
37 | public Plugin(string path)
38 | {
39 | PathDirectory = Path.GetFullPath(Path.GetDirectoryName(path));
40 | PathFile = path;
41 |
42 | Name = Read("Info", "Name");
43 | Description = Read("Info", "Description");
44 | Author = Read("Info", "Author");
45 | Status = Update();
46 | }
47 |
48 | public void Toggle()
49 | {
50 | var startInfo = new ProcessStartInfo()
51 | {
52 | FileName = "cmd",
53 | Arguments = "/C " + Read("Toggle", Status == PlugStatus.Disabled || Status == PlugStatus.Indeterminate ? "Enable" : "Disable").Replace("{}", PathDirectory),
54 | WorkingDirectory = PathDirectory,
55 | UseShellExecute = false,
56 | CreateNoWindow = true
57 | };
58 |
59 | startInfo.EnvironmentVariables["TIW11"] = (1 - Status).ToString();
60 |
61 | Process.Start(startInfo).WaitForExit();
62 | Status = Update();
63 | }
64 |
65 | private PlugStatus Update()
66 | {
67 | // Return indeterminate if status section not configured
68 | if (Read("Status", "Command").Trim().Length == 0) return PlugStatus.Indeterminate;
69 |
70 | var process = Process.Start(new ProcessStartInfo("cmd", "/C " + Read("Status", "Command"))
71 | {
72 | RedirectStandardOutput = true,
73 | WorkingDirectory = PathDirectory,
74 | UseShellExecute = false,
75 | CreateNoWindow = true
76 | });
77 |
78 | process.WaitForExit();
79 | return (new Regex(Read("Status", "Value"))).IsMatch(Read("Status", "Type") == "output" ? process.StandardOutput.ReadToEnd().Replace("\r\n", "\n") : process.ExitCode.ToString()) ? PlugStatus.Enabled : PlugStatus.Disabled;
80 | }
81 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/Extensions/PluginsBindingList.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 |
5 | internal class PluginsBindingList : BindingList
6 | {
7 | private PropertyDescriptor sortProperty;
8 | private ListSortDirection sortDirection;
9 | private bool isSorted = false;
10 |
11 | protected override void ApplySortCore(PropertyDescriptor property, ListSortDirection direction)
12 | {
13 | ((List)Items).Sort(new Comparison((T x, T y) => ((IComparable)property.GetValue(x)).CompareTo(property.GetValue(y)) * (direction == ListSortDirection.Ascending ? -1 : 1)));
14 |
15 | sortProperty = property;
16 | sortDirection = direction;
17 | isSorted = true;
18 | }
19 |
20 | protected override void RemoveSortCore()
21 | {
22 | sortProperty = null;
23 | sortDirection = ListSortDirection.Ascending;
24 | isSorted = false;
25 | }
26 |
27 | protected override bool SupportsSortingCore => true;
28 |
29 | protected override ListSortDirection SortDirectionCore => sortDirection;
30 |
31 | protected override PropertyDescriptor SortPropertyCore => sortProperty;
32 |
33 | protected override bool IsSortedCore => isSorted;
34 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/GetStarted/OS.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 | using System.Windows.Forms;
4 |
5 | namespace ThisIsWin11.GetStarted
6 | {
7 | public class OS
8 | {
9 | public bool IsWin11()
10 | {
11 | try
12 | {
13 | RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
14 | int osbuild = Convert.ToInt32(key.GetValue("CurrentBuildNumber"));
15 | if (osbuild >= 21996)
16 | {
17 | return true;
18 | }
19 | }
20 | catch { }
21 | return false;
22 | }
23 |
24 | public string GetVersion()
25 | {
26 | RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
27 |
28 | var UBR = key.GetValue("UBR").ToString();
29 | var CurrentBuild = key.GetValue("CurrentBuild").ToString();
30 |
31 | string version = CurrentBuild + "." + UBR;
32 |
33 | return "Build " + version;
34 | }
35 |
36 | public string Is64Bit()
37 | {
38 | string bitness = string.Empty;
39 |
40 | if (Environment.Is64BitOperatingSystem)
41 | {
42 | bitness = "64bit";
43 | }
44 | else
45 | {
46 | bitness = "32bit";
47 | }
48 |
49 | return bitness;
50 | }
51 |
52 | // Ref. https://docs.microsoft.com/en-us/previous-versions/system-center/configuration-manager-2003/cc180825(v=technet.10)?redirectedfrom=MSDN
53 | public string GetChassisType()
54 | {
55 | if (SystemInformation.PowerStatus.BatteryChargeStatus == BatteryChargeStatus.NoSystemBattery)
56 | {
57 | return "Desktop";
58 | }
59 | else
60 | {
61 | return "Laptop";
62 | }
63 | }
64 | }
65 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/GetStarted/Pages.cs:
--------------------------------------------------------------------------------
1 | namespace ThisIsWin11.GetStarted
2 | {
3 | public enum PageTitle
4 | {
5 | GetStarted = 0,
6 | NewLook,
7 | StartMenu,
8 | Apps,
9 | Privacy,
10 | MicrosoftStore,
11 | ActionCenter,
12 | FileExplorer,
13 | SettingsApp,
14 | WindowsUpdates,
15 | SnapLayouts,
16 | Widgets,
17 | GestureControls,
18 | WallpapersNSounds,
19 | LockScreen,
20 | TouchKeyboard,
21 | AndroidApps,
22 | Gaming,
23 | Finish,
24 | Custom
25 | }
26 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/AssessmentBase.cs:
--------------------------------------------------------------------------------
1 | namespace ThisIsWin11.OpenTweaks.Assessment
2 | {
3 | public abstract class AssessmentBase
4 | {
5 | ///
6 | /// Name of Assessment
7 | ///
8 | /// The asssessment name
9 | public abstract string ID();
10 |
11 | ///
12 | /// Tooltip text of sssessments
13 | ///
14 | /// The asssessment tooltip
15 | public abstract string Info();
16 |
17 | ///
18 | /// Checks whether assessments should be applied
19 | ///
20 | /// Returns true if the asssessment should be applied, false otherwise.
21 | public abstract bool CheckAssessment();
22 |
23 | ///
24 | /// Do the Assessment
25 | ///
26 | /// Returns true if the asssessment was successfull, false otherwise.
27 | public abstract bool DoAssessment();
28 |
29 | ///
30 | /// Undo the Assessment
31 | ///
32 | /// Returns true if the asssessment was successfull, false otherwise.
33 | public abstract bool UndoAssessment();
34 | }
35 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/AssessmentNode.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Forms;
2 | using ThisIsWin11.OpenTweaks.Assessment;
3 |
4 | namespace ThisIsWin11.OpenTweaks
5 | {
6 | internal class AssessmentNode : TreeNode
7 | {
8 | public AssessmentBase Assessment { get; }
9 |
10 | public AssessmentNode(AssessmentBase assessment)
11 | {
12 | Assessment = assessment;
13 | Text = Assessment.ID();
14 | ToolTipText = Assessment.Info();
15 | Checked = true;
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/AccountInfo.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class AccountInfo : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to account info";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to account info has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to account info has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/AppNotifications.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class AppNotifications : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\PushNotifications";
10 | private const int desiredValue = 0;
11 |
12 | public override string ID()
13 | {
14 | return "App notifications";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.IntEquals(keyName, "ToastEnabled", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "ToastEnabled", desiredValue, RegistryValueKind.DWord);
34 |
35 | logger.Log("- App notifications has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "ToastEnabled", "1", RegistryValueKind.DWord);
50 | logger.Log("- App notifications has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/BackgroundApps.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class BackgroundApps : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications";
10 | private const int desiredValue = 1;
11 |
12 | public override string ID()
13 | {
14 | return "Apps running in background";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.IntEquals(keyName, "GlobalUserDisabled", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "GlobalUserDisabled", desiredValue, RegistryValueKind.DWord);
34 |
35 | logger.Log("- App access to running in background has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "GlobalUserDisabled", 0, RegistryValueKind.DWord);
50 | logger.Log("- App access to running in background has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Calendar.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Calendar : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appointments";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to calendar";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to calendar has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to calendar has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Call.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Call : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCall";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to call";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to call has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to call has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/CallHistory.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class CallHistory : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCallHistory";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to call history";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to call history has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to call history has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Camera.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Camera : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to camera";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to camera has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to camera has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/CellularData.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class CellularData : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\cellularData";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to cellular data";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to cellular data has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to cellular data has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Contacts.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Contacts : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\contacts";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to contacts";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to contacts has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to contacts has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/DiagnosticInformation.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class DiagnosticInformation : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to diagnostics";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to diagnostics has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to diagnostics has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Documents.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Documents : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to documents";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to documents has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to documents has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Email.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Email : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\email";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to email";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to email has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to email has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/EyeGaze.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class EyeGaze : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\gazeInput";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to eye tracking";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to eye tracking has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to eye tracking has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/FileSystem.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class FileSystem : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to file system";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to filesystem has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to filesystem has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Messaging.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Messaging : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\chat";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to messaging";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to messaging has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to messaging has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Microphone.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Microphone : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to microphone";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to microphone has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to microphone has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Motion.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Motion : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\activity";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to motion";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to motion has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to motion has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Notifications.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Notifications : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to notifications";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to notifications has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to notifications has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/OtherDevices.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
5 | {
6 | internal class OtherDevices : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetooth";
11 | private const string keyName2 = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync";
12 | private const string desiredValue = "Deny";
13 |
14 | public override string ID()
15 | {
16 | return "App access to other devices";
17 | }
18 |
19 | public override string Info()
20 | {
21 | return "";
22 | }
23 |
24 | public override bool CheckAssessment()
25 | {
26 | return !(
27 | RegistryHelper.StringEquals(keyName, "Value", desiredValue) &&
28 | RegistryHelper.StringEquals(keyName2, "Value", desiredValue)
29 | );
30 | }
31 |
32 | public override bool DoAssessment()
33 | {
34 | try
35 | {
36 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
37 | Registry.SetValue(keyName2, "Value", desiredValue, RegistryValueKind.String);
38 |
39 | logger.Log("- App access to other devices has been successfully disabled.");
40 | logger.Log(keyName + Environment.NewLine + keyName2);
41 | return true;
42 | }
43 | catch
44 | { }
45 |
46 | return false;
47 | }
48 |
49 | public override bool UndoAssessment()
50 | {
51 | try
52 | {
53 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
54 | Registry.SetValue(keyName2, "Value", "Allow", RegistryValueKind.String);
55 | logger.Log("- App access to other devices has been successfully enabled.");
56 | return true;
57 | }
58 | catch
59 | { }
60 |
61 | return false;
62 | }
63 | }
64 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Pictures.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Pictures : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to pictures";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to pictures has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to pictures has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Radios.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Radios : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\radios";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to radios";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to radios has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to radios has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Tasks.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Tasks : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userDataTasks";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to tasks";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to tasks has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to tasks has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/TrackingApps.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class TrackingApps : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
10 | private const int desiredValue = 0;
11 |
12 | public override string ID()
13 | {
14 | return "Tracking of app starts";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.IntEquals(keyName, "Start_TrackProgs", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Start_TrackProgs", desiredValue, RegistryValueKind.DWord);
34 |
35 | logger.Log("- Tracking of app starts has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Start_TrackProgs", 1, RegistryValueKind.DWord);
50 | logger.Log("- Tracking of app starts has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/Videos.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Apps
4 | {
5 | internal class Videos : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary";
10 | private const string desiredValue = "Deny";
11 |
12 | public override string ID()
13 | {
14 | return "App access to videos";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
34 |
35 | logger.Log("- App access to videos has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
50 | logger.Log("- App access to videoshas been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Apps/desktop.ini:
--------------------------------------------------------------------------------
1 | [LocalizedFileNames]
2 | PowerThrottling.cs=@PowerThrottling.cs,0
3 |
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/AppsTheme.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Desktop
4 | {
5 | internal class AppsTheme : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
10 | private const int desiredValue = 0;
11 |
12 | public override string ID()
13 | {
14 | return "Use Apps dark theme";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "This will also enable dark theme for ThisIsWin11.";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.IntEquals(keyName, "AppsUseLightTheme", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "AppsUseLightTheme", desiredValue, RegistryValueKind.DWord);
34 |
35 | logger.Log("- Apps dark theme has been successfully enabled.");
36 | logger.Log(keyName);
37 |
38 | logger.Log("\n\nDark theme will also be enabled for ThisIsWin11.\nPlease restart the app for the changes to take effect.");
39 |
40 | return true;
41 | }
42 | catch
43 | { }
44 |
45 | return false;
46 | }
47 |
48 | public override bool UndoAssessment()
49 | {
50 | try
51 | {
52 | Registry.SetValue(keyName, "AppsUseLightTheme", "1", RegistryValueKind.DWord);
53 | logger.Log("- Apps light theme has been successfully enabled.");
54 | return true;
55 | }
56 | catch
57 | { }
58 |
59 | return false;
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/SnapAssistFlyout.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Desktop
5 | {
6 | internal class SnapAssistFlyout : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Disable Snap Assist";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "When you hover over the maximize button in apps, this feature gives you a flyout to display possible layouts.";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "EnableSnapAssistFlyout", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "EnableSnapAssistFlyout", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Snap Assist Layout has been disabled.\nPlease restart your PC for the changes to take effect.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable Snap Assist {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "EnableSnapAssistFlyout", 1, RegistryValueKind.DWord);
51 | logger.Log("- Snap Assist has been enabled.\nPlease restart your PC for the changes to take effect.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Stickers.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Desktop
4 | {
5 | internal class Stickers : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\current\device\Stickers";
10 | private const int desiredValue = 1;
11 |
12 | public override string ID()
13 | {
14 | return "Enable Desktop Stickers";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.IntEquals(keyName, "EnableStickers", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "EnableStickers", desiredValue, RegistryValueKind.DWord);
34 |
35 | logger.Log("- Desktop Stickers has been enabled (ONLY available in 22H2 Build 22621 and higher).");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "EnableStickers", "0", RegistryValueKind.DWord);
50 | logger.Log("- Desktop Sticker feature has been disabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Transparency.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Desktop
5 | {
6 | internal class Transparency : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Disable acrylic Fluent Design effects";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "EnableTransparency", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "EnableTransparency", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Transparency effects has been disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable transparency effects {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "EnableTransparency", 1, RegistryValueKind.DWord);
51 | logger.Log("- Transparency effects has been enabled.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Widgets.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Desktop
5 | {
6 | internal class Widgets : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Disable Widgets";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "TaskbarDa", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "TaskbarDa", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Widgets has been disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable Widgets {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "TaskbarDa", 1, RegistryValueKind.DWord);
51 | logger.Log("- Widgets has been enabled.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/WidgetsR.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Net;
5 |
6 | namespace ThisIsWin11.OpenTweaks.Assessment.Desktop
7 | {
8 | internal class WidgetsRemove : AssessmentBase
9 | {
10 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
11 |
12 | public override string ID()
13 | {
14 | return "Uninstall Widgets";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "The Widgets app runs in the background even with the option turned off.\nThis will uninstall the Widgets app package.";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | var appPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Packages", "MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy");
25 |
26 | if (!Directory.Exists(appPath))
27 | {
28 | return false;
29 | }
30 |
31 | return true;
32 | }
33 |
34 | public override bool DoAssessment()
35 | {
36 | try
37 | {
38 | using (var client = new WebClient())
39 | {
40 | logger.Log("- Uninstalling Widgets app");
41 | WindowsHelper.RunWT("winget uninstall \"windows web experience pack\"");
42 | logger.Log("Done.");
43 | return true;
44 | }
45 | }
46 | catch (Exception ex)
47 | { logger.Log("{0}", ex.Message); }
48 |
49 | return false;
50 | }
51 |
52 | public override bool UndoAssessment()
53 | {
54 | try
55 | {
56 | using (var client = new WebClient())
57 | {
58 | logger.Log("- Installing Widgets app...\nWe've opened the download link in the Microsoft Store.\n\nPlease install the package \"Windows Web Experience Pack\". ");
59 | Process.Start("ms-windows-store://pdp/?ProductId=9MSSGKG348SP");
60 |
61 | return true;
62 | }
63 | }
64 | catch (Exception ex)
65 | { logger.Log("{0}", ex.Message); }
66 |
67 | return false;
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/WindowsTheme.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Desktop
4 | {
5 | internal class WindowsTheme : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
10 | private const int desiredValue = 0;
11 |
12 | public override string ID()
13 | {
14 | return "Use Windows dark theme";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.IntEquals(keyName, "SystemUsesLightTheme", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "SystemUsesLightTheme", desiredValue, RegistryValueKind.DWord);
34 |
35 | logger.Log("- Windows dark theme has been successfully enabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "SystemUsesLightTheme", "1", RegistryValueKind.DWord);
50 | logger.Log("- Windows light theme has been successfully enabled.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Explorer/FileExplorer.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Explorer
4 | {
5 | internal class FileExplorer : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked";
10 |
11 | public override string ID()
12 | {
13 | return "Enable Windows 10 File Explorer";
14 | }
15 |
16 | public override string Info()
17 | {
18 | return "";
19 | }
20 |
21 | public override bool CheckAssessment()
22 | {
23 | return !(
24 | RegistryHelper.StringEquals(keyName, "{e2bf9676-5f8f-435c-97eb-11607a5bedf7}", "")
25 | );
26 | }
27 |
28 | public override bool DoAssessment()
29 | {
30 | try
31 | {
32 | Registry.SetValue(keyName, "{e2bf9676-5f8f-435c-97eb-11607a5bedf7}", "", RegistryValueKind.String);
33 |
34 | logger.Log("- Windows 10 File Explorer has been successfully enabled.\nRestart is required for the changes to take effect!");
35 | logger.Log(keyName);
36 | return true;
37 | }
38 | catch
39 | { }
40 |
41 | return false;
42 | }
43 |
44 | public override bool UndoAssessment()
45 | {
46 | try
47 | {
48 | var RegKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked", true);
49 | RegKey.DeleteValue("{e2bf9676-5f8f-435c-97eb-11607a5bedf7}");
50 |
51 | logger.Log("- Windows 10 File Explorer has been successfully disabled.\nRestart is required for the changes to take effect!");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Explorer/HiddenFileExt.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Explorer
5 | {
6 | internal class HiddenFileExt : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Show hidden file name extensions";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "HideFileExt", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "HideFileExt", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- File name extensions are now visible.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not hide file name extensions {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "HideFileExt", 1, RegistryValueKind.DWord);
51 | logger.Log("- File name extensions are now hidden again.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Explorer/HiddenFileFolder.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Explorer
5 | {
6 | internal class HiddenFileFolder : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
11 | private const int desiredValue = 1;
12 |
13 | public override string ID()
14 | {
15 | return "Show hidden files, folders and drives in File Explorer";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "Hidden", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "Hidden", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Hidden files, folders and drives are now visible.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not hide files, folders and drives {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "Hidden", 2, RegistryValueKind.DWord);
51 | logger.Log("- Files, folders and drives are now hidden again.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Gaming/GameDVR.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Gaming
5 | {
6 | internal class GameDVR : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\System\GameConfigStore";
11 | private const string keyName2 = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\ApplicationManagement\AllowGameDVR";
12 | private const int desiredValue = 0;
13 | private const int desiredValue2 = 2;
14 | private const int desiredValue3 = 0;
15 |
16 | public override string ID()
17 | {
18 | return "Disable Game DVR feature";
19 | }
20 |
21 | public override string Info()
22 | {
23 | return "The built-in Game DVR feature helps you record your gameplay, capture screenshots, and share them online.\n" +
24 | "But it can interfere with your game’s performance, too. Background recording requires some of your GPU power, and some gamers will want all the GPU power they can get.\n" +
25 | "If you experience low FPS or FPS loss after upgrading to Windows 11, you may resolve the issue by disabling the Xbox DVR feature.";
26 |
27 | }
28 |
29 | public override bool CheckAssessment()
30 | {
31 | return !(
32 | RegistryHelper.IntEquals(keyName, "GameDVR_Enabled", desiredValue) &&
33 | RegistryHelper.IntEquals(keyName, "GameDVR_FSEBehaviorMode", desiredValue2) &&
34 | RegistryHelper.IntEquals(keyName2, "value", desiredValue3)
35 | );
36 | }
37 |
38 | public override bool DoAssessment()
39 | {
40 | try
41 | {
42 | Registry.SetValue(keyName, "GameDVR_Enabled", desiredValue, RegistryValueKind.DWord);
43 | Registry.SetValue(keyName, "GameDVR_FSEBehaviorMode", desiredValue2, RegistryValueKind.DWord);
44 | Registry.SetValue(keyName2, "value", desiredValue3, RegistryValueKind.DWord);
45 |
46 | logger.Log("- Game DVR feature has been successfully disabled.");
47 | logger.Log(keyName + Environment.NewLine + keyName2);
48 | return true;
49 | }
50 | catch
51 | { }
52 |
53 | return false;
54 | }
55 |
56 | public override bool UndoAssessment()
57 | {
58 | try
59 | {
60 | Registry.SetValue(keyName, "GameDVR_Enabled", "1", RegistryValueKind.DWord);
61 | Registry.SetValue(keyName, "GameDVR_FSEBehaviorMode", "0", RegistryValueKind.DWord);
62 | Registry.SetValue(keyName2, "value", 1, RegistryValueKind.DWord);
63 |
64 | logger.Log("- Game DVR feature has been successfully enabled.");
65 | logger.Log(keyName + Environment.NewLine + keyName2);
66 | return true;
67 | }
68 | catch
69 | { }
70 |
71 | return false;
72 | }
73 | }
74 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Gaming/PowerThrottling.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Gaming
4 | {
5 | internal class PowerThrottling : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerThrottling";
10 | private const int desiredValue = 1;
11 |
12 | public override string ID()
13 | {
14 | return "Disable PowerThrottling";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "With the Windows 10 Fall Creators Update, Microsoft’s OS has added feature called Power Throttling\n" +
20 | "(Power Throttling is only available on Intel 6th gen and higher processors), a way to increase the battery life of laptops by slowing down background processes.\n" +
21 | "This feature is enabled by default in laptops and tablets. Though Windows is good at detecting background apps and limiting power, there might be situations where this feature is not so desirable.";
22 | }
23 |
24 | public override bool CheckAssessment()
25 | {
26 | return !(
27 | RegistryHelper.IntEquals(keyName, "PowerThrottlingOff", desiredValue)
28 | );
29 | }
30 |
31 | public override bool DoAssessment()
32 | {
33 | try
34 | {
35 | Registry.SetValue(keyName, "PowerThrottlingOff", desiredValue, RegistryValueKind.DWord);
36 |
37 | logger.Log("- PowerThrottling has been successfully disabled.");
38 | logger.Log(keyName);
39 | return true;
40 | }
41 | catch
42 | { }
43 |
44 | return false;
45 | }
46 |
47 | public override bool UndoAssessment()
48 | {
49 | try
50 | {
51 | var RegKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Power\PowerThrottling", true);
52 | RegKey.DeleteValue("PowerThrottlingOff");
53 |
54 | logger.Log("- PowerThrottling has been successfully enabled.");
55 | logger.Log(keyName);
56 | return true;
57 | }
58 | catch
59 | { }
60 |
61 | return false;
62 | }
63 | }
64 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Gaming/VisualFX.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Gaming
4 | {
5 | internal class VisualFX : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects";
10 | private const int desiredValue = 2;
11 |
12 | public override string ID()
13 | {
14 | return "Adjust visual effects for best performance";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "Visual effects are the visual bells and whistles for the appearance of Windows for your account.\n" +
20 | "These visual bells and whistles can affect the performance of Windows on the PC though.\n" +
21 | "This will turn off all visual effects under My computer->Properties->Advanced->Settings->and set to \"Adjust for best performance\"";
22 | }
23 |
24 | public override bool CheckAssessment()
25 | {
26 | return !(
27 | RegistryHelper.IntEquals(keyName, "VisualFXSetting", desiredValue)
28 | );
29 | }
30 |
31 | public override bool DoAssessment()
32 | {
33 | try
34 | {
35 | Registry.SetValue(keyName, "VisualFXSetting", desiredValue, RegistryValueKind.DWord);
36 |
37 | logger.Log("- Visual effects has been optimized.");
38 | logger.Log(keyName);
39 | return true;
40 | }
41 | catch
42 | { }
43 |
44 | return false;
45 | }
46 |
47 | public override bool UndoAssessment()
48 | {
49 | try
50 | {
51 | Registry.SetValue(keyName, "VisualFXSetting", 0, RegistryValueKind.DWord);
52 |
53 | logger.Log("- Visual effects has been set to default choosing Windows what's best for your computer.");
54 | logger.Log(keyName);
55 | return true;
56 | }
57 | catch
58 | { }
59 |
60 | return false;
61 | }
62 | }
63 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Gaming/desktop.ini:
--------------------------------------------------------------------------------
1 | [LocalizedFileNames]
2 | PowerThrottling.cs=@PowerThrottling.cs,0
3 |
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Paranoia/CleanMgr.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Paranoia
5 | {
6 | internal class CleanMgr : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 | private string curCleaner = @"data\Burnbytes.exe";
10 |
11 | public override string ID()
12 | {
13 | return "Run Disk Cleanup";
14 | }
15 |
16 | public override string Info()
17 | {
18 | return "This will run cleanmgr.exe (the modernized version Burnbytes is preferred, if stored in the data folder of this app.)";
19 | }
20 |
21 | public override bool CheckAssessment()
22 | {
23 | return !(
24 | File.Exists(@"data\Burnbytes.exe")
25 | );
26 | }
27 |
28 | public override bool DoAssessment()
29 | {
30 | try
31 | {
32 | if (File.Exists(curCleaner))
33 | {
34 | logger.Log("- Loading Burnbytes app and calculating how much space you will be able to free...\nPlease wait.");
35 | logger.Log("(Press button to clean your system.)");
36 | WindowsHelper.ProcStart(curCleaner, "");
37 | }
38 | else
39 | {
40 | logger.Log("- Burnbytes app not found. We are cleaning your system with cleanmgr.exe\n\n" +
41 | "Download Burnbytes here: https://github.com/builtbybel/burnbytes\n" +
42 | "and put it to the data folder of this app.\n\n");
43 | throw new Exception();
44 | }
45 | return true;
46 | }
47 | catch
48 | {
49 | logger.Log("Running cleanmgr.exe with -verylowdisk parameter in non-interactive mode...");
50 | WindowsHelper.ProcStart("cleanmgr.exe", "/verylowdisk");
51 | logger.Log("You have successfully resolved the low disk space condition.");
52 | return true;
53 | }
54 | }
55 |
56 | public override bool UndoAssessment()
57 | {
58 | logger.Log("- Nothing to undo here...");
59 | return false;
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Paranoia/ExplorerPatcher.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Net;
4 |
5 | namespace ThisIsWin11.PumpedApp.Assessment.ThirdParty
6 | {
7 | internal class ExplorerPatcher : AssessmentBase
8 | {
9 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
10 | private const string configIcons = @"/c %windir%\explorer.exe shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}\SystemIcons";
11 |
12 | public override string ID()
13 | {
14 | return "Enable classic Taskbar with https://github.com/valinet/ExplorerPatcher";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "This third-party tool will hack a Windows 10 taskbar back into Windows 11";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Windows) + "\\dxgi.dll");
25 | }
26 |
27 | public override bool DoAssessment()
28 | {
29 | try
30 | {
31 | using (var client = new WebClient())
32 | {
33 | //download ExplorerPatcher
34 | logger.Log("- Downloading ExplorerPatcher from https://github.com/valinet/ExplorerPatcher");
35 | client.DownloadFile("https://github.com/builtbybel/ThisIsWin11/blob/main/collections/third-party/dxgi.dll", "data\\dxgi.dll");
36 |
37 | //patching
38 | logger.Log("- Patching Explorer");
39 | File.Move("data\\dxgi.dll", Helpers.Strings.Paths.WinDir + "\\dxgi.dll");
40 |
41 | WindowsHelper.RunCmd("/c taskkill /f /im explorer.exe");
42 | WindowsHelper.RunCmd("/c start explorer.exe");
43 |
44 | logger.Log("INFO: Once File Explorer restarts, some necessary files (symbol files) will be downloaded from Microsoft (around 50MB)." +
45 | "\nThis should be relatively quick, depending on your Internet connection speed.");
46 |
47 | logger.Log("\nAs you have noticed, some system tray icons are missing (e.g. clock, sound etc.)\nWe've opened a window where you can enable your icons.");
48 | WindowsHelper.RunCmd(configIcons);
49 |
50 | logger.Log("\n- Done.\nA big shout out to https://github.com/valinet\n\n" +
51 | "How-to configure: https://github.com/valinet/ExplorerPatcher#configuration-interface");
52 |
53 | return true;
54 | }
55 | }
56 | catch (Exception ex)
57 | { logger.Log("{0}", ex.Message); }
58 |
59 | return false;
60 | }
61 |
62 | public override bool UndoAssessment()
63 | {
64 | try
65 | {
66 | //unpatching
67 | logger.Log("- Uninstalling ExplorePatcher");
68 | File.Move(Helpers.Strings.Paths.WinDir + "\\dxgi.dll", Environment.GetFolderPath(Environment.SpecialFolder.Windows) + "\\dxgio.dll");
69 |
70 | WindowsHelper.RunCmd("/c taskkill /f /im explorer.exe");
71 | WindowsHelper.RunCmd("/c start explorer.exe");
72 |
73 | File.Delete(Helpers.Strings.Paths.WinDir + "\\dxgio.dll");
74 |
75 | logger.Log("\n- Done.\nDeleting %appdata%\\ExplorerPatcher directory as well.");
76 | Directory.Delete(Helpers.Strings.Paths.AppDataDir + "\\ExplorerPatcher", true);
77 |
78 | return true;
79 | }
80 | catch (Exception ex)
81 | { logger.Log("{0}", ex.Message); }
82 |
83 | return false;
84 | }
85 | }
86 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Paranoia/ShutUp11.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Paranoia
5 | {
6 | internal class ShutUp11 : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 | private static string OOSU10 = Helpers.Strings.Data.DataRootDir + "OOSU10.exe";
10 | private static string OOSU10CFG = Helpers.Strings.Data.DataRootDir + "ooshutup10.cfg";
11 |
12 | public override string ID()
13 | {
14 | return "Automate O&O ShutUp10++";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "This app provide only the GUI for a third-party configuration file.";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | logger.Log("Usage of " + ID() +
25 | "\n1. Download the application at https://www.oo-software.com/shutup10" +
26 | "\n2. Export your configuration as ooshutup10.cfg" +
27 | "\n3. Put both (app + configuration file) to \"Data\" folder of TIW11."
28 | );
29 | return (File.Exists(OOSU10) && File.Exists(OOSU10CFG)
30 | );
31 | }
32 |
33 | public override bool DoAssessment()
34 | {
35 | try
36 | {
37 | logger.Log("Applying O&O ShutUp10++ configuration...");
38 | WindowsHelper.ProcStart(OOSU10, OOSU10CFG + " /quiet");
39 |
40 | return true;
41 | }
42 | catch (Exception ex)
43 | { logger.Log("O&O ShutUp10++ not found. {0}", ex.Message); }
44 |
45 | return false;
46 | }
47 |
48 | public override bool UndoAssessment()
49 | {
50 | logger.Log("Revert your changes in O&O ShutUp10++");
51 | return true;
52 | }
53 | }
54 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Paranoia/WindowsSpyBlocker.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Text.RegularExpressions;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Paranoia
5 | {
6 | internal class WindowsSpyBlocker : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 | private static string spyList = Helpers.Strings.Data.DataRootDir + "spy.txt";
10 |
11 | public override string ID()
12 | {
13 | return "Block Windows 11 telemetry with WindowsSpyBlocker";
14 | }
15 |
16 | public override string Info()
17 | {
18 | return "This app provide only the GUI for a third-party IP list.\nPowered by https://github.com/crazy-max/WindowsSpyBlocker";
19 | }
20 |
21 | internal static string CleanIp(string line)
22 | {
23 | return Regex.Replace(line, @"\s{2,}", " ");
24 | }
25 |
26 | public override bool CheckAssessment()
27 | {
28 | try
29 | {
30 | logger.Log("The IPs based on the following list will be blocked:");
31 |
32 | string[] ipAddr = File.ReadAllLines(spyList);
33 |
34 | foreach (var currentIpAddr in ipAddr)
35 | {
36 | logger.Log(currentIpAddr.ToString());
37 | }
38 |
39 | return false;
40 | }
41 | catch
42 | {
43 | logger.Log("spy.txt from https://github.com/crazy-max/WindowsSpyBlocker repository not found.\nDownload the file and copy it to \"Data\" directory of this app.");
44 | return false;
45 | }
46 | }
47 |
48 | public override bool DoAssessment()
49 | {
50 | try
51 | {
52 | string[] ipAddr = File.ReadAllLines(spyList);
53 |
54 | foreach (var currentIpAddr in ipAddr)
55 | {
56 | if (!currentIpAddr.StartsWith("#") && (!string.IsNullOrEmpty(currentIpAddr)))
57 | {
58 | CleanIp(currentIpAddr);
59 |
60 | WindowsHelper.RunCmd($"/c netsh advfirewall firewall add rule name=\"{currentIpAddr}_TIW11\" dir=out interface=any action=block remoteip=\"{currentIpAddr}\"");
61 | }
62 | }
63 |
64 | logger.Log("IP list has been blocked.");
65 |
66 | return true;
67 | }
68 | catch
69 | {
70 | logger.Log("spy.txt from https://github.com/crazy-max/WindowsSpyBlocker repository not found.\nDownload the file and copy it to \"Data\" directory of this app.");
71 | return false;
72 | }
73 | }
74 |
75 | public override bool UndoAssessment()
76 | {
77 | string[] ipAddr = File.ReadAllLines(spyList);
78 |
79 | foreach (var currentIpAddr in ipAddr)
80 | {
81 | if (!currentIpAddr.StartsWith("#") && (!string.IsNullOrEmpty(currentIpAddr)))
82 | {
83 | CleanIp(currentIpAddr);
84 |
85 | WindowsHelper.RunCmd($"/c netsh advfirewall firewall delete rule name=\"{currentIpAddr}_TIW11\"");
86 | }
87 | }
88 |
89 | logger.Log("IP list has been unblocked.");
90 |
91 | return true;
92 | }
93 | }
94 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Privacy/Advertising.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Privacy
5 | {
6 | internal class Advertising : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Advertising ID for Relevant Ads";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "Windows 11 comes integrated with advertising. Microsoft assigns a unique identificator to track your activity in the Microsoft Store and on UWP apps to target you with relevant ads.";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "Enabled", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "Enabled", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Advertising ID for Relevant Ads has been successfully disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable advertising ID for Relevant Ads {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "Enabled", 1, RegistryValueKind.DWord);
51 | logger.Log("- Advertising ID for Relevant Ads has been successfully enabled.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Privacy/AppsAutoInstall.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Privacy
5 | {
6 | internal class AppsAutoInstall : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Automatic Installation of apps";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "When you sign-in to a new Windows 11 profile or device for the first time, chance is that you notice several third - party applications and games listed prominently in the Start menu.\n" +
21 | "This setting will block automatic Installation of suggested Windows 11 apps.";
22 | }
23 |
24 | public override bool CheckAssessment()
25 | {
26 | return !(
27 | RegistryHelper.IntEquals(keyName, "SilentInstalledAppsEnabled", desiredValue)
28 | );
29 | }
30 |
31 | public override bool DoAssessment()
32 | {
33 | try
34 | {
35 | Registry.SetValue(keyName, "SilentInstalledAppsEnabled", desiredValue, RegistryValueKind.DWord);
36 |
37 | logger.Log("- Automatic Installation of apps has been successfully disabled.");
38 | logger.Log(keyName);
39 | return true;
40 | }
41 | catch (Exception ex)
42 | { logger.Log("Could not disable automatic Installation of apps {0}", ex.Message); }
43 |
44 | return false;
45 | }
46 |
47 | public override bool UndoAssessment()
48 | {
49 | try
50 | {
51 | Registry.SetValue(keyName, "SilentInstalledAppsEnabled", 1, RegistryValueKind.DWord);
52 | logger.Log("- Automatic Installation of apps has been successfully enabled.");
53 | return true;
54 | }
55 | catch
56 | { }
57 |
58 | return false;
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Privacy/Biometrics.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Privacy
5 | {
6 | internal class Biometrics : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Biometrics";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Windows Hello Biometrics";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "Windows Hello biometrics lets you sign in to your devices, apps, online services, and networks using your face, iris, or fingerprint.";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "Enabled", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "Enabled", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Windows Hello Biometrics has been successfully disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable Windows Hello Biometrics {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "Enabled", 1, RegistryValueKind.DWord);
51 | logger.Log("- Windows Hello Biometrics has been successfully enabled.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Privacy/CompatibilityTelemetry.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Privacy
5 | {
6 | internal class CompatibilityTelemetry : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CompatTelRunner.exe";
11 | private const string desiredValue = @"%windir%\System32\taskkill.exe";
12 |
13 | public override string ID()
14 | {
15 | return "Compatibility Telemetry";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "This process is periodically collecting a variety of technical data about your computer and its performance and sending it to Microsoft for its Windows Customer Experience Improvement Program.";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.StringEquals(keyName, "Debugger", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "Debugger", desiredValue, RegistryValueKind.String);
35 | logger.Log("- Compatibility Telemetry has been successfully disabled.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch (Exception ex)
40 | { logger.Log("Could not disable compatibility telemetry: {0}", ex.Message); }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | var RegKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CompatTelRunner.exe", true);
50 | RegKey.DeleteValue("Debugger");
51 |
52 | logger.Log("- Compatibility Telemetry has been successfully enabled.");
53 | return true;
54 | }
55 | catch
56 | { }
57 |
58 | return false;
59 | }
60 | }
61 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Privacy/DiagnosticData.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Privacy
5 | {
6 | internal class DiagnosticData : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Privacy";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Diagnostic data";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "This will turn off tailored experiences with relevant tips and recommendations by using your diagnostics data. Many people would call this telemetry, or even spying.";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "TailoredExperiencesWithDiagnosticDataEnabled", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "TailoredExperiencesWithDiagnosticDataEnabled", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Diagnostic data has been successfully disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable Diagnostic data {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "TailoredExperiencesWithDiagnosticDataEnabled", 1, RegistryValueKind.DWord);
51 | logger.Log("- Diagnostic data has been successfully enabled.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Privacy/Feedback.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Privacy
5 | {
6 | internal class Feedback : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string periodInNanoSeconds = @"HKEY_CURRENT_USER\Software\Microsoft\Siuf\Rules";
11 | private const string numberOfSIUFInPeriod = @"HKEY_CURRENT_USER\Software\Microsoft\Siuf\Rules";
12 | private const int desiredValue = 0;
13 |
14 | public override string ID()
15 | {
16 | return "Feedback notifications";
17 | }
18 |
19 | public override string Info()
20 | {
21 | return "Changes the Windows 11 feedback frequency from Automatically to Never.";
22 | }
23 |
24 | public override bool CheckAssessment()
25 | {
26 | return !(
27 | RegistryHelper.IntEquals(periodInNanoSeconds, "PeriodInNanoSeconds", desiredValue) &&
28 | RegistryHelper.IntEquals(numberOfSIUFInPeriod, "NumberOfSIUFInPeriod", desiredValue)
29 | );
30 | }
31 |
32 | public override bool DoAssessment()
33 | {
34 | try
35 | {
36 | Registry.SetValue(periodInNanoSeconds, "PeriodInNanoSeconds", desiredValue, RegistryValueKind.DWord);
37 | Registry.SetValue(numberOfSIUFInPeriod, "NumberOfSIUFInPeriod", desiredValue, RegistryValueKind.DWord);
38 |
39 | logger.Log("- Feedback has been successfully disabled.");
40 | logger.Log(periodInNanoSeconds + Environment.NewLine + numberOfSIUFInPeriod);
41 | return true;
42 | }
43 | catch (Exception ex)
44 | { logger.Log("Could not disable Feedback {0}", ex.Message); }
45 |
46 | return false;
47 | }
48 |
49 | public override bool UndoAssessment()
50 | {
51 | try
52 | {
53 | var RegKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Siuf\Rules", true);
54 | RegKey.DeleteValue("NumberOfSIUFInPeriod");
55 | RegKey.DeleteValue("PeriodInNanoSeconds");
56 |
57 | logger.Log("- Feedback has been successfully enabled.");
58 | return true;
59 | }
60 | catch
61 | { }
62 |
63 | return false;
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Privacy/LocationTracking.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Privacy
5 | {
6 | internal class LocationTracking : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location";
11 | private const string desiredValue = @"Deny";
12 |
13 | public override string ID()
14 | {
15 | return "Location tracking";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "Wherever you go, Windows 11 knows you're there. When Location Tracking is turned on, Windows and its apps are allowed to detect the current location of your computer or device.";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.StringEquals(keyName, "Value", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "Value", desiredValue, RegistryValueKind.String);
35 |
36 | logger.Log("- Location tracking has been successfully disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable location tracking {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "Value", "Allow", RegistryValueKind.String);
51 | logger.Log("- Location tracking info has been successfully enabled.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Privacy/SuggestedContent.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Privacy
5 | {
6 | internal class SuggestedContent : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager";
11 | private const string keyName2 = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager";
12 | private const string keyName3 = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager";
13 | private const int desiredValue = 0;
14 |
15 | public override string ID()
16 | {
17 | return "Suggested content in Settings app";
18 | }
19 |
20 | public override string Info()
21 | {
22 | return "";
23 | }
24 |
25 | public override bool CheckAssessment()
26 | {
27 | return !(
28 | RegistryHelper.IntEquals(keyName, "SubscribedContent-338393Enabled", desiredValue) &&
29 | RegistryHelper.IntEquals(keyName2, "SubscribedContent-353694Enabled", desiredValue) &&
30 | RegistryHelper.IntEquals(keyName3, "SubscribedContent-353696Enabled", desiredValue)
31 | );
32 | }
33 |
34 | public override bool DoAssessment()
35 | {
36 | try
37 | {
38 | Registry.SetValue(keyName, "SubscribedContent-338393Enabled", desiredValue, RegistryValueKind.DWord);
39 | Registry.SetValue(keyName2, "SubscribedContent-353694Enabled", desiredValue, RegistryValueKind.DWord);
40 | Registry.SetValue(keyName3, "SubscribedContent-353696Enabled", desiredValue, RegistryValueKind.DWord);
41 |
42 | logger.Log("- Suggested content in Settings app has been successfully disabled.");
43 | logger.Log(keyName + Environment.NewLine + keyName2 + Environment.NewLine + keyName3);
44 | return true;
45 | }
46 | catch (Exception ex)
47 | { logger.Log("Could not disable suggested content in Settings app {0}", ex.Message); }
48 |
49 | return false;
50 | }
51 |
52 | public override bool UndoAssessment()
53 | {
54 | try
55 | {
56 | Registry.SetValue(keyName, "SubscribedContent-338393Enabled", 1, RegistryValueKind.DWord);
57 | Registry.SetValue(keyName2, "SubscribedContent-353694Enabled", 1, RegistryValueKind.DWord);
58 | Registry.SetValue(keyName3, "SubscribedContent-353696Enabled", 1, RegistryValueKind.DWord);
59 |
60 | logger.Log("- Suggested content in Settings app has been successfully enabled.");
61 | logger.Log(keyName + Environment.NewLine + keyName2 + Environment.NewLine + keyName3);
62 | return true;
63 | }
64 | catch
65 | { }
66 |
67 | return false;
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Privacy/TailoredExperiences.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Privacy
5 | {
6 | internal class TailoredExperiences : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Privacy";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Tailored experiences";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "This will prevent Windows 11 using your diagnostic data for personalized tips, ads, and recommendations.";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "TailoredExperiencesWithDiagnosticDataEnabled", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "TailoredExperiencesWithDiagnosticDataEnabled", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Tailored experiences has been successfully disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable Tailored experiences {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "TailoredExperiencesWithDiagnosticDataEnabled", 1, RegistryValueKind.DWord);
51 | logger.Log("- Tailored experiences has been successfully enabled.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Privacy/Telemetry.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Privacy
5 | {
6 | internal class Telemetry : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string dataCollection = @"HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DataCollection";
11 | private const string diagTrack = @"HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\DiagTrack";
12 | private const string dmwappushservice = @"HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\dmwappushservice";
13 | private const int desiredValue = 0;
14 |
15 | public override string ID()
16 | {
17 | return "Connected User Experiences and Telemetry";
18 | }
19 |
20 | public override string Info()
21 | {
22 | return "This will prevent Windows from collecting usage information and setting diagnostic data to Basic, which is the lowest level available for all consumer versions of Windows 11.\n" +
23 | "The services diagtrack & dmwappushservice will also be disabled.\nNOTE: Diagnostic Data must be set to Full to get preview builds from Windows-Insider-Program!";
24 | }
25 |
26 | public override bool CheckAssessment()
27 | {
28 | WindowsHelper.IsServiceRunning("DiagTrack");
29 | WindowsHelper.IsServiceRunning("dmwappushservice");
30 |
31 | return !(
32 | RegistryHelper.IntEquals(dataCollection, "AllowTelemetry", desiredValue) &&
33 | RegistryHelper.IntEquals(diagTrack, "Start", 4) &&
34 | RegistryHelper.IntEquals(dmwappushservice, "Start", 4)
35 |
36 | );
37 | }
38 |
39 | public override bool DoAssessment()
40 | {
41 | try
42 | {
43 | Registry.SetValue(dataCollection, "AllowTelemetry", desiredValue, RegistryValueKind.DWord);
44 | Registry.SetValue(diagTrack, "Start", 4, RegistryValueKind.DWord);
45 | Registry.SetValue(dmwappushservice, "Start", 4, RegistryValueKind.DWord);
46 |
47 | WindowsHelper.DisableService("DiagTrack");
48 | WindowsHelper.DisableService("dmwappushservice");
49 |
50 | logger.Log("- Connected User Experiences and Telemetry has been successfully disabled.");
51 | logger.Log(dataCollection + Environment.NewLine + diagTrack + Environment.NewLine + dmwappushservice);
52 |
53 | return true;
54 | }
55 | catch (Exception ex)
56 | { logger.Log("Could not disable telemetry: {0}", ex.Message); }
57 |
58 | return false;
59 | }
60 |
61 | public override bool UndoAssessment()
62 | {
63 | try
64 | {
65 | Registry.SetValue(dataCollection, "AllowTelemetry", 3, RegistryValueKind.DWord);
66 | Registry.SetValue(diagTrack, "Start", 2, RegistryValueKind.DWord);
67 | Registry.SetValue(dmwappushservice, "Start", 2, RegistryValueKind.DWord);
68 |
69 | WindowsHelper.EnableService("DiagTrack");
70 | WindowsHelper.EnableService("dmwappushservice");
71 |
72 | logger.Log("- Connected User Experiences and Telemetry has been successfully enabled.");
73 | logger.Log(dataCollection + Environment.NewLine + diagTrack + Environment.NewLine + dmwappushservice);
74 | return true;
75 | }
76 | catch (Exception ex)
77 | { logger.Log("Could not enable telemetry: {0}", ex.Message); }
78 |
79 | return false;
80 | }
81 | }
82 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Privacy/WindowsTips.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Privacy
5 | {
6 | internal class WindowsTips : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager ";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Windows 11 tips";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "You will no longer see Windows tips, e.g. Spotlight and Consumer Features, Feedback Notifications etc.";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "SubscribedContent-338393Enabled", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "SubscribedContent-338393Enabled", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Windows 11 tips has been successfully disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable Windows 11 tips {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "SubscribedContent-338393Enabled", 1, RegistryValueKind.DWord);
51 | logger.Log("- Windows 11 tips has been successfully enabled.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Settings/RestorePoint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Management;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Settings
5 | {
6 | internal class RestorePoint : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore";
11 | private const int desiredValue = 1; // Restore Points are enabled
12 |
13 | private static void CreateRestorePoint(string description)
14 | {
15 | var oScope = new ManagementScope("\\\\localhost\\root\\default");
16 | var oPath = new ManagementPath("SystemRestore");
17 | var oGetOp = new ObjectGetOptions();
18 | var oProcess = new ManagementClass(oScope, oPath, oGetOp);
19 |
20 | var oInParams =
21 | oProcess.GetMethodParameters("CreateRestorePoint");
22 | oInParams["Description"] = description;
23 | oInParams["RestorePointType"] = 12; // MODIFY_SETTINGS
24 | oInParams["EventType"] = 100;
25 |
26 | oProcess.InvokeMethod("CreateRestorePoint", oInParams, null);
27 | }
28 |
29 | public override string ID()
30 | {
31 | return $"Create Restore Point ({DateTime.Now})";
32 | }
33 |
34 | public override string Info()
35 | {
36 | return "This will create a Restore Point of your system.";
37 | }
38 |
39 | public override bool CheckAssessment()
40 | {
41 | return !(
42 | RegistryHelper.IntEquals(keyName, "RPSessionInterval", desiredValue)
43 | );
44 | }
45 |
46 | public override bool DoAssessment()
47 | {
48 | try
49 | {
50 | var restorepointName = $"ThisIsWin11 {DateTime.Now}";
51 | logger.Log($"Creating restore point {restorepointName} Please wait.");
52 | CreateRestorePoint(restorepointName);
53 | logger.Log($"Restore point {restorepointName} successfully created.");
54 |
55 | return true;
56 | }
57 | catch (Exception ex)
58 | {
59 | logger.Log("- Creating restore point failed. {0}", ex.Message);
60 |
61 | return false;
62 | }
63 | }
64 |
65 | public override bool UndoAssessment()
66 | {
67 | logger.Log("- Please delete Restore Points from System Restore in Windows 11.\nWe've opened the System Protection page.");
68 | WindowsHelper.RunCmd("/c SystemPropertiesProtection");
69 | return false;
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/System/EnableWSL.cs:
--------------------------------------------------------------------------------
1 | using System.Management.Automation;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.System
4 | {
5 | internal class EnableWSL : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | public override string ID()
10 | {
11 | return "Enable Microsoft Windows Subsystem for Linux";
12 | }
13 |
14 | public override string Info()
15 | {
16 | return "";
17 | }
18 |
19 | public override bool CheckAssessment()
20 | {
21 | string script = "Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux";
22 | PowerShell powerShell = PowerShell.Create();
23 | powerShell.AddScript(script);
24 | var results = powerShell.Invoke();
25 |
26 | foreach (var item in results)
27 | {
28 | var Status = item.Members["State"].Value;
29 |
30 | if (Status.ToString() == "Enabled")
31 | {
32 | logger.Log("Microsoft Windows Subsystem for Linux is already enabled.");
33 | return false;
34 | }
35 | }
36 | logger.Log("Microsoft Windows Subsystem for Linux is disabled.");
37 |
38 | return true;
39 | }
40 |
41 | public override bool DoAssessment()
42 | {
43 | string script = "Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux";
44 |
45 | PowerShell powerShell = PowerShell.Create();
46 |
47 | powerShell.AddScript(script);
48 | powerShell.Invoke();
49 |
50 | logger.Log("- Microsoft Windows Subsystem for Linux has been successfully enabled.");
51 | return true;
52 | }
53 |
54 | public override bool UndoAssessment()
55 | {
56 | string script = "Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux";
57 |
58 | PowerShell powerShell = PowerShell.Create();
59 |
60 | powerShell.AddScript(script);
61 | powerShell.Invoke();
62 |
63 | logger.Log("- Microsoft Windows Subsystem for Linux has been successfully disabled.");
64 | return true;
65 | }
66 | }
67 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/System/FaxPrinter.cs:
--------------------------------------------------------------------------------
1 | using System.Management.Automation;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.System
4 | {
5 | internal class Fax : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | public override string ID()
10 | {
11 | return "Remove Fax Printer";
12 | }
13 |
14 | public override string Info()
15 | {
16 | return "This operation cannot be undone!";
17 | }
18 |
19 | public override bool CheckAssessment()
20 | {
21 | logger.Log("Fax Printer check can not be performed, but we can remove it.");
22 | return false;
23 | }
24 |
25 | public override bool DoAssessment()
26 | {
27 | string script = "Remove-Printer -Name \"Fax\"";
28 |
29 | PowerShell powerShell = PowerShell.Create();
30 |
31 | powerShell.AddScript(script);
32 | powerShell.Invoke();
33 |
34 | if (powerShell.Streams.Error.Count > 0)
35 | {
36 | logger.Log("Fax Printer not found.");
37 | return false;
38 | }
39 |
40 | logger.Log("- Fax printer has been successfully removed.");
41 | return true;
42 | }
43 |
44 | public override bool UndoAssessment()
45 | {
46 | logger.Log("- Fax printer can not be installed.");
47 | return false;
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/System/HyperV.cs:
--------------------------------------------------------------------------------
1 | using System.Management.Automation;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.System
4 | {
5 | internal class HyperV : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | public override string ID()
10 | {
11 | return "Enable Microsoft Hyper-V";
12 | }
13 |
14 | public override string Info()
15 | {
16 | return "Allows the creation of virtual machines.\nE.g., it is also a requirement for Windows Subsystem for Linux and Android.";
17 | }
18 |
19 | public override bool CheckAssessment()
20 | {
21 |
22 | string script = "Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V";
23 | PowerShell powerShell = PowerShell.Create();
24 | powerShell.AddScript(script);
25 | var results = powerShell.Invoke();
26 |
27 | foreach (var item in results)
28 | {
29 | var Status = item.Members["State"].Value;
30 |
31 | if (Status.ToString() == "Enabled")
32 | {
33 | logger.Log("Microsoft-Hyper-V is already enabled.");
34 | return false;
35 |
36 | }
37 | }
38 | logger.Log("Microsoft-Hyper-V is disabled.");
39 |
40 | return true;
41 | }
42 |
43 | public override bool DoAssessment()
44 | {
45 | string script = "Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V";
46 |
47 | logger.Log("Please wait.");
48 | PowerShell powerShell = PowerShell.Create();
49 |
50 | powerShell.AddScript(script);
51 | powerShell.Invoke();
52 |
53 | logger.Log("- Microsoft Hyper-V has been successfully enabled.\nA restart is required for the changes to take effect.");
54 | return true;
55 | }
56 |
57 | public override bool UndoAssessment()
58 | {
59 | string script = "Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V";
60 | logger.Log("Please wait.");
61 | PowerShell powerShell = PowerShell.Create();
62 |
63 | powerShell.AddScript(script);
64 | powerShell.Invoke();
65 |
66 | logger.Log("- Microsoft Hyper-V has been successfully disabled.\nA restart is required for the changes to take effect.");
67 | return true;
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/System/InstallWSA.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Management.Automation;
5 | using System.Net;
6 |
7 | namespace ThisIsWin11.OpenTweaks.Assessment.System
8 | {
9 | internal class InstallWSA : AssessmentBase
10 | {
11 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
12 |
13 | public override string ID()
14 | {
15 | return "Install Microsoft Windows Subsystem for Android";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "Installation is currently ONLY possible in Windows Insider Dev or Beta channel.";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | var appPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Packages", "MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe");
26 |
27 | if (!Directory.Exists(appPath))
28 | {
29 | return true;
30 | }
31 |
32 | return false;
33 | }
34 |
35 | public override bool DoAssessment()
36 | {
37 | try
38 | {
39 | using (var client = new WebClient())
40 | {
41 | logger.Log("- Installing WSA");
42 | logger.Log("\nYou must be in a Beta or Dev channel of the Windows Insider Program....");
43 | WindowsHelper.RunWT("winget install \"9p3395vx91nr\" --accept-source-agreements --accept-package-agreements");
44 | logger.Log("Done.");
45 | logger.Log("\n\nIf you do not meet the requirements, check the following tutorial how-to install WSA on any version of Windows 11:\nhttps://levelup.gitconnected.com/installing-windows-subsystem-for-android-in-windows-11-c33e98c4071c");
46 | return true;
47 | }
48 | }
49 | catch (Exception ex)
50 | { logger.Log("{0}", ex.Message); }
51 |
52 | return false;
53 | }
54 |
55 | public override bool UndoAssessment()
56 | {
57 | try
58 | {
59 | using (var client = new WebClient())
60 | {
61 | logger.Log("- Uninstalling WSA...");
62 | WindowsHelper.RunWT("winget uninstall \"9p3395vx91nr\"");
63 | return true;
64 | }
65 | }
66 | catch (Exception ex)
67 | { logger.Log("{0}", ex.Message); }
68 |
69 | return false;
70 | }
71 | }
72 |
73 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/System/RemoveW11Watermark.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.System
4 | {
5 | internal class RemoveW11Watermark : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Control Panel\UnsupportedHardwareNotificationCache";
10 | private const int desiredValue = 0;
11 |
12 | public override string ID()
13 | {
14 | return "Remove Windows 11 System requirements watermark";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "Microsoft will display with Build 2257 a desktop watermark on devices where Windows 11 is running on unsupported hardware.";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.IntEquals(keyName, "SV2", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "SV2", desiredValue, RegistryValueKind.DWord);
34 |
35 | logger.Log("- Watermark and the settings notification should be gone.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | var RegKey = Registry.CurrentUser.OpenSubKey(@"Control Panel\UnsupportedHardwareNotificationCache", true);
50 |
51 | RegKey.DeleteValue("SV2");
52 | logger.Log("- Watermark has been enabled again.");
53 |
54 | return true;
55 | }
56 | catch
57 | { }
58 |
59 | return false;
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/System/TeamsAutostart.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.System
5 | {
6 | internal class TeamsAutostart : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run";
11 | private string desiredValue = string.Format("C:\\Users\\{0}\\AppData\\Local\\Microsoft\\Teams\\Update.exe --processStart \"Teams.exe\" --process-start-args \"--system-initiated", Environment.UserName);
12 |
13 | public override string ID()
14 | {
15 | return "Disable Microsoft Teams on Startup";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | string AppValue = "com.squirrel.Teams.Teams";
26 |
27 | if (Registry.GetValue(keyName, AppValue, null) == null)
28 | {
29 | logger.Log("Teams AutoStart is already disabled.");
30 |
31 | return false;
32 | }
33 | else
34 | {
35 | logger.Log("Teams AutoStart is enabled.");
36 | return true;
37 | }
38 | }
39 |
40 | public override bool DoAssessment()
41 | {
42 | try
43 | {
44 | var RegKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
45 | RegKey.DeleteValue("com.squirrel.Teams.Teams");
46 |
47 | logger.Log("- Teams AutoStart has been disabled.");
48 | return true;
49 | }
50 | catch
51 | { }
52 |
53 | return false;
54 | }
55 |
56 | public override bool UndoAssessment()
57 | {
58 | try
59 | {
60 | Registry.SetValue(keyName, "com.squirrel.Teams.Teams", desiredValue, RegistryValueKind.String);
61 |
62 | logger.Log("- Teams AutoStart has been enabled again.");
63 | logger.Log(keyName);
64 | return true;
65 | }
66 | catch
67 | { }
68 |
69 | return false;
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/System/XPSWriter.cs:
--------------------------------------------------------------------------------
1 | using System.Management.Automation;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.System
4 | {
5 | internal class XPSWriter : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | public override string ID()
10 | {
11 | return "Remove XPS Documents Writer";
12 | }
13 |
14 | public override string Info()
15 | {
16 | return "";
17 | }
18 |
19 | public override bool CheckAssessment()
20 | {
21 | string script = "Get-WindowsOptionalFeature -Online -FeatureName \"Printing-XPSServices-Features\"";
22 |
23 | PowerShell powerShell = PowerShell.Create();
24 | powerShell.AddScript(script);
25 |
26 | var results = powerShell.Invoke();
27 |
28 | foreach (var item in results)
29 | {
30 | var Status = item.Members["State"].Value;
31 |
32 | if (Status.ToString() == "Enabled")
33 | {
34 | logger.Log("XPS Documents Writer is installed.");
35 | return true;
36 | }
37 | }
38 | logger.Log("XPS Documents Writer not found.");
39 |
40 | /* if (powerShell.Streams.Error.Count > 0)
41 | {
42 | Console.WriteLine("{0} errors", powerShell.Streams.Error.Count);
43 | } */
44 |
45 | return false;
46 | }
47 |
48 | public override bool DoAssessment()
49 | {
50 | string script = "Disable-WindowsOptionalFeature -Online -FeatureName \"Printing-XPSServices-Features\" -NoRestart -WarningAction SilentlyContinue | Out-Null";
51 | PowerShell powerShell = PowerShell.Create();
52 | powerShell.AddScript(script);
53 | var results = powerShell.Invoke();
54 |
55 | if (powerShell.Streams.Error.Count > 0)
56 | {
57 | logger.Log("XPS Documents Writer not found.");
58 | return false;
59 | }
60 |
61 | logger.Log("- XPS Documents Writer has been successfully removed.");
62 | return true;
63 | }
64 |
65 | public override bool UndoAssessment()
66 | {
67 | string script = "Enable-WindowsOptionalFeature -Online -FeatureName \"Printing-XPSServices-Features\" -NoRestart -WarningAction SilentlyContinue | Out-Null";
68 | PowerShell powerShell = PowerShell.Create();
69 | powerShell.AddScript(script);
70 |
71 | var results = powerShell.Invoke();
72 | if (powerShell.Streams.Error.Count > 0)
73 | {
74 | logger.Log("XPS Documents Writer could not be installed.");
75 | return false;
76 | }
77 |
78 | logger.Log("- XPS Documents Writer has been successfully installed.");
79 | return true;
80 | }
81 | }
82 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/MostUsedApps.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar
5 | {
6 | internal class MostUsedApps : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer";
11 | private const int desiredValue = 2;
12 |
13 | public override string ID()
14 | {
15 | return "Hide most used apps in start menu";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "ShowOrHideMostUsedApps", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "ShowOrHideMostUsedApps", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Most Used Apps has been disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable Most Used Apps {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | var RegKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\Explorer", true);
51 | RegKey.DeleteValue("ShowOrHideMostUsedApps");
52 |
53 | logger.Log("- Most Used Apps has been set to default behavior.");
54 | return true;
55 | }
56 | catch
57 | { }
58 |
59 | return false;
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskView.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar
5 | {
6 | internal class TaskView : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Hide Task view button on taskbar";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "ShowTaskViewButton", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "ShowTaskViewButton", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Task view button has been disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable Task view button {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "ShowTaskViewButton", 1 , RegistryValueKind.DWord);
51 | logger.Log("- Task view button has been enabled.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarAl.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar
4 | {
5 | internal class TaskbarAl : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
10 | private const int desiredValue = 0; //left
11 |
12 | public override string ID()
13 | {
14 | return "Align Taskbar to left";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.IntEquals(keyName, "TaskbarAl", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "TaskbarAl", desiredValue, RegistryValueKind.DWord);
34 |
35 | logger.Log("- Taskbar alignment has been set to left.");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "TaskbarAl", "1", RegistryValueKind.DWord);
50 | logger.Log("- Taskbar alignment has been set to middle.");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarChat.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar
5 | {
6 | internal class TaskbarChat : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Hide Chat icon (Microsoft Teams) on taskbar";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "TaskbarMn", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "TaskbarMn", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Chat icon has been disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable chat icon {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "TaskbarMn", 1, RegistryValueKind.DWord);
51 | logger.Log("- Chat icon has been enabled.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarMM.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar
4 | {
5 | internal class TaskbarMM : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
10 | private const int desiredValue = 0;
11 |
12 | public override string ID()
13 | {
14 | return "Hide Taskbar on multiple monitors";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "This will hide secondary taskbars.";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.IntEquals(keyName, "MMTaskbarEnabled", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "MMTaskbarEnabled", desiredValue, RegistryValueKind.DWord);
34 |
35 | WindowsHelper.RunCmd("/c taskkill /f /im explorer.exe");
36 | WindowsHelper.RunCmd("/c start explorer.exe");
37 |
38 | logger.Log("- Taskbar on secondary monitor has been disabled.");
39 | logger.Log(keyName);
40 | return true;
41 | }
42 | catch
43 | { }
44 |
45 | return false;
46 | }
47 |
48 | public override bool UndoAssessment()
49 | {
50 | try
51 | {
52 | Registry.SetValue(keyName, "MMTaskbarEnabled", "1", RegistryValueKind.DWord);
53 |
54 | WindowsHelper.RunCmd("/c taskkill /f /im explorer.exe");
55 | WindowsHelper.RunCmd("/c start explorer.exe");
56 |
57 | logger.Log("- Taskbar on secondary monitor has been enabled.");
58 | return true;
59 | }
60 | catch
61 | { }
62 |
63 | return false;
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarSearch.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 |
4 | namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar
5 | {
6 | internal class TaskbarSearch : AssessmentBase
7 | {
8 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
9 |
10 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search";
11 | private const int desiredValue = 0;
12 |
13 | public override string ID()
14 | {
15 | return "Hide Search icon on taskbar";
16 | }
17 |
18 | public override string Info()
19 | {
20 | return "";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | return !(
26 | RegistryHelper.IntEquals(keyName, "SearchboxTaskbarMode", desiredValue)
27 | );
28 | }
29 |
30 | public override bool DoAssessment()
31 | {
32 | try
33 | {
34 | Registry.SetValue(keyName, "SearchboxTaskbarMode", desiredValue, RegistryValueKind.DWord);
35 |
36 | logger.Log("- Search icon has been disabled.");
37 | logger.Log(keyName);
38 | return true;
39 | }
40 | catch (Exception ex)
41 | { logger.Log("Could not disable search icon {0}", ex.Message); }
42 |
43 | return false;
44 | }
45 |
46 | public override bool UndoAssessment()
47 | {
48 | try
49 | {
50 | Registry.SetValue(keyName, "SearchboxTaskbarMode", 1, RegistryValueKind.DWord);
51 | logger.Log("- Search icon has been enabled.");
52 | return true;
53 | }
54 | catch
55 | { }
56 |
57 | return false;
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarSi.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 |
3 | namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar
4 | {
5 | internal class TaskbarSi : AssessmentBase
6 | {
7 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
8 |
9 | private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced";
10 | private const int desiredValue = 0;
11 |
12 | public override string ID()
13 | {
14 | return "Small Taskbar and icons";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "";
20 | }
21 |
22 | public override bool CheckAssessment()
23 | {
24 | return !(
25 | RegistryHelper.IntEquals(keyName, "TaskbarSi", desiredValue)
26 | );
27 | }
28 |
29 | public override bool DoAssessment()
30 | {
31 | try
32 | {
33 | Registry.SetValue(keyName, "TaskbarSi", desiredValue, RegistryValueKind.DWord);
34 |
35 | logger.Log("- Taskbar size has been set to small.\nRestart is required for the changes to take effect!");
36 | logger.Log(keyName);
37 | return true;
38 | }
39 | catch
40 | { }
41 |
42 | return false;
43 | }
44 |
45 | public override bool UndoAssessment()
46 | {
47 | try
48 | {
49 | Registry.SetValue(keyName, "TaskbarSi", "1", RegistryValueKind.DWord);
50 | logger.Log("- Taskbar size has been set to default/medium.\nRestart is required for the changes to take effect!");
51 | return true;
52 | }
53 | catch
54 | { }
55 |
56 | return false;
57 | }
58 | }
59 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/Assessments/Update/Wusa.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 |
5 | namespace ThisIsWin11.OpenTweaks.Assessment.Update
6 | {
7 | internal class Wusa : AssessmentBase
8 | {
9 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
10 | private static string kbList = Helpers.Strings.Data.DataRootDir + "brokenKB.txt";
11 |
12 | public override string ID()
13 | {
14 | return "*Uninstall broken Windows 11 updates";
15 | }
16 |
17 | public override string Info()
18 | {
19 | return "This will uninstall Windows 11 updates that have known issues or that are causing problems on your computer.\n" +
20 | "Click the button to search the database for broken updates.";
21 | }
22 |
23 | public override bool CheckAssessment()
24 | {
25 | try
26 | {
27 | logger.Log("The following KnowledgeBase (KB) numbers will be uninstalled:");
28 |
29 | string[] Kb = File.ReadAllLines(kbList);
30 |
31 | foreach (var currentKb in Kb)
32 | {
33 | logger.Log("- KB" + currentKb.ToString());
34 | }
35 | }
36 | catch
37 | {
38 | logger.Log("- There are currently no Windows 11 updates registered in the database which might cause problems or crashes.");
39 | }
40 |
41 | return (File.Exists(kbList));
42 | }
43 |
44 | public override bool DoAssessment()
45 | {
46 | try
47 | {
48 | logger.Log("The following KnowledgeBase (KB) numbers will be uninstalled:");
49 |
50 | string[] Kb = File.ReadAllLines(kbList);
51 |
52 | foreach (var currentKb in Kb)
53 | {
54 | logger.Log("- KB" + currentKb.ToString());
55 | var kbNumber = Convert.ToInt32(currentKb.ToString().Replace("KB", null));
56 | WindowsHelper.RunCmd($"/c start wusa /uninstall /kb:{kbNumber} /norestart");
57 | }
58 | logger.Log("\nPlease restart your PC for the changes to take effect.");
59 | return true;
60 | }
61 | catch
62 | {
63 | logger.Log("- There are currently no Windows 11 updates registered in the database which might cause problems or crashes.");
64 | return false;
65 | }
66 | }
67 |
68 | public override bool UndoAssessment()
69 | {
70 | logger.Log("Reinstall the Update via Windows update...\nWe've opened the Windows update page.");
71 | Process.Start("ms-settings:windowsupdate-action");
72 | return true;
73 | }
74 | }
75 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/ErrorHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace ThisIsWin11
5 | {
6 | internal class ErrorHelper
7 | {
8 | private static RichTextBox target = null;
9 |
10 | // Errorlogger to target rtbPS
11 | public void SetTarget(RichTextBox richText)
12 | {
13 | target = richText;
14 | }
15 |
16 | public void Log(string format, params object[] args)
17 | {
18 | format += "\r\n";
19 |
20 | try
21 | {
22 | if (target.InvokeRequired)
23 | {
24 | target.Invoke(new Action(() =>
25 | target.AppendText(string.Format(format, args))
26 | ));
27 | }
28 | else
29 | {
30 | target.AppendText(string.Format(format, args));
31 | }
32 | }
33 | catch { }
34 | }
35 |
36 | public static ErrorHelper Instance
37 | {
38 | get => new ErrorHelper();
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/ITreeNode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Windows.Forms;
4 |
5 | namespace ThisIsWin11.OpenTweaks.ITreeNode
6 | {
7 | public static class ITreeNode
8 | {
9 | public static IEnumerable All(this TreeNodeCollection nodes)
10 | {
11 | if (nodes == null) throw new ArgumentNullException(nameof(nodes));
12 |
13 | foreach (TreeNode n in nodes)
14 | {
15 | yield return n;
16 |
17 | foreach (TreeNode child in n.Nodes.All())
18 | {
19 | yield return child;
20 | }
21 | }
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/RegistryHelper.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 | using System.Windows.Forms;
4 |
5 | namespace ThisIsWin11.OpenTweaks.Assessment
6 | {
7 | // Check whether registry values equal
8 | internal class RegistryHelper
9 | {
10 | public static bool IntEquals(string keyName, string valueName, int expectedValue)
11 | {
12 | try
13 | {
14 | var value = Registry.GetValue(keyName, valueName, null);
15 | return (value != null && (int)value == expectedValue);
16 | }
17 | catch (Exception ex)
18 |
19 | {
20 | MessageBox.Show(keyName, ex.Message, MessageBoxButtons.OK);
21 | return false;
22 | }
23 | }
24 |
25 | // Check whether registry strings equal
26 | public static bool StringEquals(string keyName, string valueName, string expectedValue)
27 | {
28 | try
29 | {
30 | var value = Registry.GetValue(keyName, valueName, null);
31 | return (value != null && (string)value == expectedValue);
32 | }
33 | catch (Exception ex)
34 | {
35 | MessageBox.Show(keyName, ex.Message, MessageBoxButtons.OK);
36 | return false;
37 | }
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/src/TIW11/Modules/OpenTweaks/WindowsHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Globalization;
4 | using System.Text;
5 |
6 | namespace ThisIsWin11
7 | {
8 | public static class WindowsHelper
9 | {
10 | private static readonly ErrorHelper logger = ErrorHelper.Instance;
11 |
12 | // Command Prompt (to be replaced with wt.exe)
13 | public static void RunCmd(string args)
14 | {
15 | ProcStart(Helpers.Strings.Paths.ShellCommandPrompt, args);
16 | }
17 |
18 | // Windows Terminal will be the default command line experience in TIW11 in 2022
19 | public static void RunWT(string args)
20 | {
21 | ProcStart(Helpers.Strings.Paths.ShellWT, args);
22 | }
23 |
24 | public static void ProcStart(string name, string args)
25 | {
26 | try
27 | {
28 | var proc = new Process
29 | {
30 | StartInfo = new ProcessStartInfo
31 | {
32 | FileName = name,
33 | Arguments = args,
34 | UseShellExecute = false,
35 | RedirectStandardOutput = true,
36 | StandardOutputEncoding = Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.OEMCodePage),
37 | CreateNoWindow = true
38 | }
39 | };
40 | proc.Start();
41 | string line = null;
42 | while (!proc.StandardOutput.EndOfStream)
43 | {
44 | line += Environment.NewLine + proc.StandardOutput.ReadLine();
45 | }
46 | proc.WaitForExit();
47 | logger.Log($"{name} {args} {line}");
48 | }
49 | catch
50 | {
51 | logger.Log($"Could not start {name} {args}.");
52 | }
53 | }
54 |
55 | public static void IsServiceRunning(string service)
56 | {
57 | logger.Log($"Check if {service} service is running");
58 | RunCmd($"/c sc query {service} | find \"RUNNING\"");
59 | }
60 |
61 | public static void DisableService(string service)
62 | {
63 | RunCmd($"/c net stop {service}");
64 | ProcStart(Helpers.Strings.Paths.ShellPS, $"-command \"Set-Service -Name {service} -StartupType disabled\"");
65 | logger.Log($"Disable {service} service");
66 | }
67 |
68 | public static void EnableService(string service)
69 | {
70 | RunCmd($"/c net start {service}");
71 | ProcStart(Helpers.Strings.Paths.ShellPS, $"-command \"Set-Service -Name {service} -StartupType auto\"");
72 | logger.Log($"Enable {service} service");
73 | }
74 | }
75 | }
--------------------------------------------------------------------------------
/src/TIW11/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Web;
4 | using System.Windows.Forms;
5 |
6 | namespace ThisIsWin11
7 | {
8 | internal static class Program
9 | {
10 | ///
11 | /// Gets App version
12 | ///
13 | internal static string GetCurrentVersionTostring() => new Version(Application.ProductVersion).ToString(3);
14 |
15 | ///
16 | /// Sends Crash report to GitHub with exception details
17 | ///
18 | public static void SendCrashReport(Exception ex)
19 | {
20 | string header = HttpUtility.UrlEncode(ex.Message);
21 | string body = $"***ThisIsWin1 {GetCurrentVersionTostring()}***\n\n" +
22 | $"**Message**\n{ex.Message}\n\n" +
23 | $"**Source**\n{ex.Source}\n\n" +
24 | $"**Stack Trace**\n```{ex.StackTrace}```\n\n";
25 |
26 | body = HttpUtility.UrlEncode(body);
27 |
28 | string uri = $"https://github.com/builtbybel/ThisIsWin11/issues/new?labels=crash+report&title={header}&body={body}";
29 | Process.Start(uri);
30 | }
31 |
32 | ///
33 | /// The main entry point for the application.
34 | ///
35 | [STAThread]
36 | private static void Main(string[] switches)
37 | {
38 | Application.EnableVisualStyles();
39 | Application.SetCompatibleTextRenderingDefault(false);
40 |
41 | // Command-line switches
42 | if (switches.Length == 1)
43 | {
44 | string arg = switches[0].Trim();
45 |
46 | // GetStarted
47 | if (arg == "/getstarted")
48 | {
49 | HomeWindow opentweaks = new HomeWindow(null);
50 | opentweaks.ShowDialog();
51 | }
52 |
53 | // OpenTweaks
54 | if (arg == "/opentweaks")
55 | {
56 | CustomizeWindow opentweaks = new CustomizeWindow();
57 | opentweaks.ShowDialog();
58 | }
59 |
60 | // PumpedApp
61 | if (arg == "/pumpedapp")
62 | {
63 | AppsWindow pumpedapp = new AppsWindow();
64 | pumpedapp.ShowDialog();
65 | }
66 |
67 | // Packages
68 | if (arg == "/packages")
69 | {
70 | PackagesWindow packages = new PackagesWindow();
71 | packages.ShowDialog();
72 | }
73 |
74 | // PowerUI
75 | if (arg == "/powerui")
76 | {
77 | AutomateWindow packages = new AutomateWindow();
78 | packages.ShowDialog();
79 | }
80 | }
81 | #if !DEBUG
82 | else
83 | try
84 | {
85 | }
86 | catch (Exception ex)
87 | {
88 | SendCrashReport(ex);
89 | throw;
90 | }
91 |
92 | #endif
93 |
94 | Application.Run(new MainWindow());
95 | }
96 | }
97 | }
--------------------------------------------------------------------------------
/src/TIW11/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // Allgemeine Informationen über eine Assembly werden über die folgenden
5 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
6 | // die einer Assembly zugeordnet sind.
7 | [assembly: AssemblyTitle("ThisIsWin11")]
8 | [assembly: AssemblyDescription("PowerToys for Windows 11")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("Builtbybel")]
11 | [assembly: AssemblyProduct("ThisIsWin11")]
12 | [assembly: AssemblyCopyright("Copyright © 2023 Builtbybel")]
13 | [assembly: AssemblyTrademark("Builtbybel")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
17 | // für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
18 | // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
19 | [assembly: ComVisible(false)]
20 |
21 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
22 | [assembly: Guid("787b5529-1330-474b-8f5d-8a7ce2521dfd")]
23 |
24 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
25 | //
26 | // Hauptversion
27 | // Nebenversion
28 | // Buildnummer
29 | // Revision
30 | //
31 | // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
32 | // indem Sie "*" wie unten gezeigt eingeben:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.5.0")]
35 | [assembly: AssemblyFileVersion("1.5.0")]
36 |
--------------------------------------------------------------------------------
/src/TIW11/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Dieser Code wurde von einem Tool generiert.
4 | // Laufzeitversion:4.0.30319.42000
5 | //
6 | // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
7 | // der Code erneut generiert wird.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ThisIsWin11.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
17 | ///
18 | // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
19 | // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
20 | // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
21 | // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ThisIsWin11.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
51 | /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Sucht eine lokalisierte Zeichenfolge, die 18.01.2022 11:24:25,76
65 | /// ähnelt.
66 | ///
67 | internal static string buildDate {
68 | get {
69 | return ResourceManager.GetString("buildDate", resourceCulture);
70 | }
71 | }
72 |
73 | ///
74 | /// Sucht eine lokalisierte Zeichenfolge, die 1527c705-839a-4832-9118-54d4Bd6a0c89
75 | ///c5e2524a-ea46-4f67-841f-6a9465d9d515
76 | ///E2A4F912-2574-4A75-9BB0-0D023378592B
77 | ///F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE
78 | ///InputApp
79 | ///Microsoft.AAD.BrokerPlugin
80 | ///Microsoft.AccountsControl
81 | ///Microsoft.Advertising.Xaml
82 | ///Microsoft.AsyncTextService
83 | ///Microsoft.BioEnrollment
84 | ///Microsoft.CredDialogHost
85 | ///Microsoft.ECApp
86 | ///Microsoft.LockApp
87 | ///Microsoft.MicrosoftEdge
88 | ///Microsoft.MicrosoftEdgeDevToolsClient
89 | ///Microsoft.NET
90 | ///Microsoft.PPIProjection
91 | ///Microsoft.Services.Store.Engagement
92 | ///Microsoft.VCLibs
93 | ///Microsoft.Wi [Rest der Zeichenfolge wurde abgeschnitten]"; ähnelt.
94 | ///
95 | internal static string systemApps {
96 | get {
97 | return ResourceManager.GetString("systemApps", resourceCulture);
98 | }
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/src/TIW11/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Dieser Code wurde von einem Tool generiert.
4 | // Laufzeitversion:4.0.30319.42000
5 | //
6 | // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
7 | // der Code erneut generiert wird.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ThisIsWin11.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/TIW11/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/TIW11/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Dieser Code wurde von einem Tool generiert.
4 | // Laufzeitversion:4.0.30319.42000
5 | //
6 | // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
7 | // der Code erneut generiert wird.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ThisIsWin11 {
12 | using System;
13 |
14 |
15 | ///
16 | /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
17 | ///
18 | // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
19 | // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
20 | // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
21 | // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ThisIsWin11.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
51 | /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Sucht eine lokalisierte Zeichenfolge, die 1527c705-839a-4832-9118-54d4Bd6a0c89
65 | ///c5e2524a-ea46-4f67-841f-6a9465d9d515
66 | ///E2A4F912-2574-4A75-9BB0-0D023378592B
67 | ///F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE
68 | ///InputApp
69 | ///Microsoft.AAD.BrokerPlugin
70 | ///Microsoft.AccountsControl
71 | ///Microsoft.Advertising.Xaml
72 | ///Microsoft.AsyncTextService
73 | ///Microsoft.BioEnrollment
74 | ///Microsoft.CredDialogHost
75 | ///Microsoft.ECApp
76 | ///Microsoft.LockApp
77 | ///Microsoft.MicrosoftEdge
78 | ///Microsoft.MicrosoftEdgeDevToolsClient
79 | ///Microsoft.NET
80 | ///Microsoft.PPIProjection
81 | ///Microsoft.Services.Store.Engagement
82 | ///Microsoft.VCLibs
83 | ///Microsoft.Wi [Rest der Zeichenfolge wurde abgeschnitten]"; ähnelt.
84 | ///
85 | internal static string systemapps {
86 | get {
87 | return ResourceManager.GetString("systemapps", resourceCulture);
88 | }
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/src/TIW11/Resources/systemApps.txt:
--------------------------------------------------------------------------------
1 | 1527c705-839a-4832-9118-54d4Bd6a0c89
2 | c5e2524a-ea46-4f67-841f-6a9465d9d515
3 | E2A4F912-2574-4A75-9BB0-0D023378592B
4 | F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE
5 | InputApp
6 | Microsoft.AAD.BrokerPlugin
7 | Microsoft.AccountsControl
8 | Microsoft.Advertising.Xaml
9 | Microsoft.AsyncTextService
10 | Microsoft.BioEnrollment
11 | Microsoft.CredDialogHost
12 | Microsoft.ECApp
13 | Microsoft.LockApp
14 | Microsoft.MicrosoftEdge
15 | Microsoft.MicrosoftEdgeDevToolsClient
16 | Microsoft.NET
17 | Microsoft.PPIProjection
18 | Microsoft.Services.Store.Engagement
19 | Microsoft.VCLibs
20 | Microsoft.Win32WebViewHost
21 | Microsoft.WindowsStore
22 | Microsoft.WindowsCalculator
23 | Microsoft.XboxGameCallableUI
24 | Microsoft.Windows.Apprep.ChxApp
25 | Microsoft.Windows.AssignedAccessLockApp
26 | Microsoft.Windows.CapturePicker
27 | Microsoft.Windows.CloudExperienceHost
28 | Microsoft.Windows.ContentDeliveryManager
29 | Microsoft.Windows.Cortana
30 | Microsoft.Windows.NarratorQuickStart
31 | Microsoft.Windows.OOBENetworkCaptivePortal
32 | Microsoft.Windows.OOBENetworkConnectionFlow
33 | Microsoft.Windows.ParentalControls
34 | Microsoft.Windows.PeopleExperienceHost
35 | Microsoft.Windows.PinningConfirmationDialog
36 | Microsoft.Windows.SecHealthUI
37 | Microsoft.Windows.SecureAssessmentBrowser
38 | Microsoft.Windows.ShellExperienceHost
39 | Microsoft.Windows.XGpuEjectDialog
40 | Windows.CBSPreview
41 | windows.immersivecontrolpanel
42 | Windows.PrintDialog
43 |
--------------------------------------------------------------------------------
/src/TIW11/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
52 |
53 |
54 |
55 | true
56 |
57 |
58 |
59 |
60 |
74 |
75 |
76 |
--------------------------------------------------------------------------------