├── .gitattributes
├── .gitignore
├── .gitmodules
├── Deploy
├── Installer
│ ├── Icon.ico
│ ├── Installer.nsi
│ ├── License.txt
│ └── nsis.ps1
└── Portable
│ └── portable.ps1
├── DisableNvidiaTelemetry.sln
├── DisableNvidiaTelemetry
├── App.config
├── App.xaml
├── App.xaml.cs
├── Controller
│ ├── NvidiaController.cs
│ └── NvidiaControllerResult.cs
├── DisableNvidiaTelemetry.csproj
├── Icon.ico
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── MarginSetter.cs
├── Model
│ ├── ITelemetry.cs
│ ├── TaskNotFoundException.cs
│ ├── TelemetryRegistryKey.cs
│ ├── TelemetryService.cs
│ └── TelemetryTask.cs
├── PortableSettingsProvider.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Resources
│ ├── GitHub-Mark-Light-120px-plus.png
│ ├── bg.png
│ ├── binoculars-256.png
│ ├── btn_donate_92x26.png
│ ├── honeycomb-dark.png
│ └── honeycomb-gray.png
├── SwitchCheckbox.cs
├── Utilities
│ ├── AppUtils.cs
│ ├── GeforceUtilities.cs
│ ├── Logging.cs
│ ├── ServiceHelper.cs
│ ├── TaskSchedulerUtilities.cs
│ ├── UpdaterUtilities.cs
│ └── WindowsUtils.cs
├── View
│ ├── TelemetryControl.xaml
│ └── TelemetryControl.xaml.cs
├── app.manifest
└── packages.config
├── README.md
└── appveyor.yml
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 | *.VC.VC.opendb
85 |
86 | # Visual Studio profiler
87 | *.psess
88 | *.vsp
89 | *.vspx
90 | *.sap
91 |
92 | # TFS 2012 Local Workspace
93 | $tf/
94 |
95 | # Guidance Automation Toolkit
96 | *.gpState
97 |
98 | # ReSharper is a .NET coding add-in
99 | _ReSharper*/
100 | *.[Rr]e[Ss]harper
101 | *.DotSettings.user
102 |
103 | # JustCode is a .NET coding add-in
104 | .JustCode
105 |
106 | # TeamCity is a build add-in
107 | _TeamCity*
108 |
109 | # DotCover is a Code Coverage Tool
110 | *.dotCover
111 |
112 | # NCrunch
113 | _NCrunch_*
114 | .*crunch*.local.xml
115 | nCrunchTemp_*
116 |
117 | # MightyMoose
118 | *.mm.*
119 | AutoTest.Net/
120 |
121 | # Web workbench (sass)
122 | .sass-cache/
123 |
124 | # Installshield output folder
125 | [Ee]xpress/
126 |
127 | # DocProject is a documentation generator add-in
128 | DocProject/buildhelp/
129 | DocProject/Help/*.HxT
130 | DocProject/Help/*.HxC
131 | DocProject/Help/*.hhc
132 | DocProject/Help/*.hhk
133 | DocProject/Help/*.hhp
134 | DocProject/Help/Html2
135 | DocProject/Help/html
136 |
137 | # Click-Once directory
138 | publish/
139 |
140 | # Publish Web Output
141 | *.[Pp]ublish.xml
142 | *.azurePubxml
143 | # TODO: Comment the next line if you want to checkin your web deploy settings
144 | # but database connection strings (with potential passwords) will be unencrypted
145 | *.pubxml
146 | *.publishproj
147 |
148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
149 | # checkin your Azure Web App publish settings, but sensitive information contained
150 | # in these scripts will be unencrypted
151 | PublishScripts/
152 |
153 | # NuGet Packages
154 | *.nupkg
155 | # The packages folder can be ignored because of Package Restore
156 | **/packages/*
157 | # except build/, which is used as an MSBuild target.
158 | !**/packages/build/
159 | # Uncomment if necessary however generally it will be regenerated when needed
160 | #!**/packages/repositories.config
161 | # NuGet v3's project.json files produces more ignoreable files
162 | *.nuget.props
163 | *.nuget.targets
164 |
165 | # Microsoft Azure Build Output
166 | csx/
167 | *.build.csdef
168 |
169 | # Microsoft Azure Emulator
170 | ecf/
171 | rcf/
172 |
173 | # Windows Store app package directories and files
174 | AppPackages/
175 | BundleArtifacts/
176 | Package.StoreAssociation.xml
177 | _pkginfo.txt
178 |
179 | # Visual Studio cache files
180 | # files ending in .cache can be ignored
181 | *.[Cc]ache
182 | # but keep track of directories ending in .cache
183 | !*.[Cc]ache/
184 |
185 | # Others
186 | ClientBin/
187 | ~$*
188 | *~
189 | *.dbmdl
190 | *.dbproj.schemaview
191 | *.pfx
192 | *.publishsettings
193 | node_modules/
194 | orleans.codegen.cs
195 |
196 | # Since there are multiple workflows, uncomment next line to ignore bower_components
197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
198 | #bower_components/
199 |
200 | # RIA/Silverlight projects
201 | Generated_Code/
202 |
203 | # Backup & report files from converting an old project file
204 | # to a newer Visual Studio version. Backup files are not needed,
205 | # because we have git ;-)
206 | _UpgradeReport_Files/
207 | Backup*/
208 | UpgradeLog*.XML
209 | UpgradeLog*.htm
210 |
211 | # SQL Server files
212 | *.mdf
213 | *.ldf
214 |
215 | # Business Intelligence projects
216 | *.rdl.data
217 | *.bim.layout
218 | *.bim_*.settings
219 |
220 | # Microsoft Fakes
221 | FakesAssemblies/
222 |
223 | # GhostDoc plugin setting file
224 | *.GhostDoc.xml
225 |
226 | # Node.js Tools for Visual Studio
227 | .ntvs_analysis.dat
228 |
229 | # Visual Studio 6 build log
230 | *.plg
231 |
232 | # Visual Studio 6 workspace options file
233 | *.opt
234 |
235 | # Visual Studio LightSwitch build output
236 | **/*.HTMLClient/GeneratedArtifacts
237 | **/*.DesktopClient/GeneratedArtifacts
238 | **/*.DesktopClient/ModelManifest.xml
239 | **/*.Server/GeneratedArtifacts
240 | **/*.Server/ModelManifest.xml
241 | _Pvt_Extensions
242 |
243 | # Paket dependency manager
244 | .paket/paket.exe
245 | paket-files/
246 |
247 | # FAKE - F# Make
248 | .fake/
249 |
250 | # JetBrains Rider
251 | .idea/
252 | *.sln.iml
253 |
254 | # =========================
255 | # Operating System Files
256 | # =========================
257 |
258 | # OSX
259 | # =========================
260 |
261 | .DS_Store
262 | .AppleDouble
263 | .LSOverride
264 |
265 | # Thumbnails
266 | ._*
267 |
268 | # Files that might appear in the root of a volume
269 | .DocumentRevisions-V100
270 | .fseventsd
271 | .Spotlight-V100
272 | .TemporaryItems
273 | .Trashes
274 | .VolumeIcon.icns
275 |
276 | # Directories potentially created on remote AFP share
277 | .AppleDB
278 | .AppleDesktop
279 | Network Trash Folder
280 | Temporary Items
281 | .apdisk
282 |
283 | # Windows
284 | # =========================
285 |
286 | # Windows image file caches
287 | Thumbs.db
288 | ehthumbs.db
289 |
290 | # Folder config file
291 | Desktop.ini
292 |
293 | # Recycle Bin used on file shares
294 | $RECYCLE.BIN/
295 |
296 | # Windows Installer files
297 | *.cab
298 | *.msi
299 | *.msm
300 | *.msp
301 |
302 | # Windows shortcuts
303 | *.lnk
304 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "Deploy/Installer/NsisDotNetChecker"]
2 | path = Deploy/Installer/NsisDotNetChecker
3 | url = https://github.com/ReVolly/NsisDotNetChecker.git
4 |
--------------------------------------------------------------------------------
/Deploy/Installer/Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateShoffner/Disable-Nvidia-Telemetry/f5434902eddec792043180d1a7f9e5f78aed1335/Deploy/Installer/Icon.ico
--------------------------------------------------------------------------------
/Deploy/Installer/Installer.nsi:
--------------------------------------------------------------------------------
1 | !include "MUI2.nsh"
2 | !include "NsisDotNetChecker\nsis\DotNetChecker.nsh"
3 |
4 | !addplugindir "NsisDotNetChecker\bin"
5 |
6 | ;--------------------------------
7 | ;Constants
8 |
9 | !define PRIMARY_EXE_NAME "Disable Nvidia Telemetry"
10 |
11 | !define PRODUCT_NAME "Disable Nvidia Telemetry"
12 | !define PRODUCT_VERSION "${APPLICATION_VERSION}"
13 | !define PRODUCT_PUBLISHER "Nate Shoffner"
14 | !define PRODUCT_WEB_SITE "https://nateshoffner.com"
15 | !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRIMARY_EXE_NAME}.exe"
16 | !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
17 | !define PRODUCT_UNINST_ROOT_KEY "HKLM"
18 |
19 | ;--------------------------------
20 | ;General
21 |
22 | Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
23 | OutFile "${PRODUCT_NAME} ${PRODUCT_VERSION} Setup.exe"
24 |
25 | ;Default installation folder
26 | InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
27 |
28 | ;Get installation folder from registry if available
29 | InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
30 |
31 | ShowInstDetails show
32 | ShowUnInstDetails show
33 |
34 | SetCompressor lzma
35 |
36 | ;Request application privileges for Windows Vista
37 | RequestExecutionLevel admin
38 |
39 | BrandingText "${PRODUCT_PUBLISHER}"
40 |
41 | ;--------------------------------
42 | ;Interface Settings
43 |
44 | !define MUI_ABORTWARNING
45 | !define MUI_ICON "Icon.ico"
46 | !define MUI_UNICON "Icon.ico"
47 |
48 | ;--------------------------------
49 | ;Pages
50 |
51 | !insertmacro MUI_PAGE_LICENSE "License.txt"
52 | !insertmacro MUI_PAGE_DIRECTORY
53 | !insertmacro MUI_PAGE_INSTFILES
54 | !insertmacro MUI_UNPAGE_CONFIRM
55 | !insertmacro MUI_UNPAGE_INSTFILES
56 | !define MUI_FINISHPAGE_RUN
57 | !define MUI_FINISHPAGE_RUN_TEXT "Run Program"
58 | !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchProgram"
59 | !insertmacro MUI_PAGE_FINISH
60 |
61 | Section
62 |
63 | SetOutPath "$INSTDIR"
64 | SetOverwrite ifnewer
65 |
66 | !insertmacro CheckNetFramework 45 ;
67 |
68 | File "License.txt"
69 | File "${SOLUTION_DIRECTORY}\DisableNvidiaTelemetry\bin\Release\Disable Nvidia Telemetry.exe"
70 | File "${SOLUTION_DIRECTORY}\DisableNvidiaTelemetry\bin\Release\Disable Nvidia Telemetry.exe.config"
71 | File "${SOLUTION_DIRECTORY}\DisableNvidiaTelemetry\bin\Release\log4net.dll"
72 | File "${SOLUTION_DIRECTORY}\DisableNvidiaTelemetry\bin\Release\Microsoft.Win32.TaskScheduler.dll"
73 | File "${SOLUTION_DIRECTORY}\DisableNvidiaTelemetry\bin\Release\Newtonsoft.Json.dll"
74 | File "${SOLUTION_DIRECTORY}\DisableNvidiaTelemetry\bin\Release\ExtendedVersion.dll"
75 | File "${SOLUTION_DIRECTORY}\DisableNvidiaTelemetry\bin\Release\FontAwesome5.WPF.dll"
76 | File "${SOLUTION_DIRECTORY}\DisableNvidiaTelemetry\bin\Release\WPFCustomMessageBox.dll"
77 |
78 | CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
79 | CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRIMARY_EXE_NAME}.lnk" "$INSTDIR\${PRIMARY_EXE_NAME}.exe"
80 |
81 | SectionEnd
82 |
83 | ;--------------------------------
84 | ;Languages
85 |
86 | !insertmacro MUI_LANGUAGE "English"
87 |
88 | ;--------------------------------
89 | ;Uninstaller Section
90 |
91 | Section "Uninstall"
92 |
93 | ExecWait "$INSTDIR\Disable Nvidia Telemetry.exe -unregistertask" $0
94 |
95 | Delete "$INSTDIR\License.txt"
96 | Delete "$INSTDIR\Disable Nvidia Telemetry.exe"
97 | Delete "$INSTDIR\\Disable Nvidia Telemetry.exe.config"
98 | Delete "$INSTDIR\log4net.dll"
99 | Delete "$INSTDIR\Microsoft.Win32.TaskScheduler.dll"
100 | Delete "$INSTDIR\Newtonsoft.Json.dll"
101 | Delete "$INSTDIR\ExtendedVersion.dll"
102 | Delete "$INSTDIR\FontAwesome5.WPF.dll"
103 | Delete "$INSTDIR\WPFCustomMessageBox.dll"
104 | Delete "$INSTDIR\Uninstall.exe"
105 | Delete "$SMPROGRAMS\Disable Nvidia Telemetry\Disable Nvidia Telemetry.lnk"
106 | RMDir "$SMPROGRAMS\Disable Nvidia Telemetry"
107 | RMDir "$INSTDIR"
108 |
109 | DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
110 | DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
111 |
112 | SetAutoClose true
113 |
114 | SectionEnd
115 |
116 | Function .onInstSuccess
117 | WriteUninstaller "$INSTDIR\Uninstall.exe"
118 | WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\${PRIMARY_EXE_NAME}.exe"
119 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
120 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\Uninstall.exe"
121 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PRIMARY_EXE_NAME}.exe"
122 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
123 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
124 | WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
125 | FunctionEnd
126 |
127 | Function LaunchProgram
128 | ExecShell "" "$INSTDIR\Disable Nvidia Telemetry.exe"
129 | FunctionEnd
--------------------------------------------------------------------------------
/Deploy/Installer/License.txt:
--------------------------------------------------------------------------------
1 | Copyright (C) 2018 Nate Shoffner
2 |
3 | This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
4 |
5 | Redistribution of this software is allowed, but the origin of this software must not be misrepresented; you must not claim that you wrote the original software.
6 |
7 | E-mail: nate.shoffner@gmail.com
8 | Homepage: https://nateshoffner.com
--------------------------------------------------------------------------------
/Deploy/Installer/nsis.ps1:
--------------------------------------------------------------------------------
1 | & git clone "https://github.com/ReVolly/NsisDotNetChecker" "$env:APPVEYOR_BUILD_FOLDER\Deploy\Installer\NsisDotNetChecker" 2>&1 | % { $_.ToString() }
2 |
3 | & "C:\Program Files (x86)\NSIS\makensis.exe" /DAPPLICATION_VERSION="$env:APPVEYOR_BUILD_VERSION" /DSOLUTION_DIRECTORY="$env:APPVEYOR_BUILD_FOLDER" "$env:APPVEYOR_BUILD_FOLDER\Deploy\Installer\Installer.nsi"
4 |
5 | $installer = "$env:APPVEYOR_BUILD_FOLDER\Deploy\Installer\Disable Nvidia Telemetry $env:APPVEYOR_BUILD_VERSION Setup.exe"
6 |
7 | # move executable to project directory for clean AppVeyor artifact name
8 | Move-Item "$installer" "$env:APPVEYOR_BUILD_FOLDER"
--------------------------------------------------------------------------------
/Deploy/Portable/portable.ps1:
--------------------------------------------------------------------------------
1 | $temp_directory = "$env:APPVEYOR_BUILD_FOLDER\Deploy\Portable\~TEMP"
2 | New-Item "$temp_directory" -type directory
3 |
4 | $zip_archive = "$env:APPVEYOR_BUILD_FOLDER\Deploy\Portable\Disable Nvidia Telemetry $env:APPVEYOR_BUILD_VERSION Portable.exe"
5 |
6 | # build using portable configuration
7 | & msbuild.exe "$env:APPVEYOR_BUILD_FOLDER\DisableNvidiaTelemetry.sln" /p:Configuration=Portable
8 |
9 | $output_directory = "$env:APPVEYOR_BUILD_FOLDER\DisableNvidiaTelemetry\bin\Portable"
10 |
11 | # copy files
12 | Get-ChildItem -Path "$output_directory" | % {
13 | Copy-Item $_.fullname "$temp_directory" -Force -Exclude @("*.xml", "*.pdb", "*.manifest", "*.application", "*.vshost.*", "JetBrains.Annotations.dll")
14 | }
15 |
16 | # zip contents in self-extracting archive
17 | & 7z "a" "$zip_archive" "-mmt" "-mx5" "-sfx7z.sfx" "-r" "$temp_directory\*.*"
18 |
19 | # move executable to project directory for clean AppVeyor artifact name
20 | Move-Item "$zip_archive" "$env:APPVEYOR_BUILD_FOLDER"
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26228.9
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DisableNvidiaTelemetry", "DisableNvidiaTelemetry\DisableNvidiaTelemetry.csproj", "{96BD5143-61F8-4B32-A6DD-8125A4EFE8AA}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Portable|Any CPU = Portable|Any CPU
12 | Release|Any CPU = Release|Any CPU
13 | EndGlobalSection
14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 | {96BD5143-61F8-4B32-A6DD-8125A4EFE8AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16 | {96BD5143-61F8-4B32-A6DD-8125A4EFE8AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
17 | {96BD5143-61F8-4B32-A6DD-8125A4EFE8AA}.Portable|Any CPU.ActiveCfg = Portable|Any CPU
18 | {96BD5143-61F8-4B32-A6DD-8125A4EFE8AA}.Portable|Any CPU.Build.0 = Portable|Any CPU
19 | {96BD5143-61F8-4B32-A6DD-8125A4EFE8AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
20 | {96BD5143-61F8-4B32-A6DD-8125A4EFE8AA}.Release|Any CPU.Build.0 = Release|Any CPU
21 | EndGlobalSection
22 | GlobalSection(SolutionProperties) = preSolution
23 | HideSolutionNode = FALSE
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | True
54 |
55 |
56 | 0
57 |
58 |
59 | True
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Linq;
4 | using System.Windows;
5 | using DisableNvidiaTelemetry.Controller;
6 | using DisableNvidiaTelemetry.Properties;
7 | using DisableNvidiaTelemetry.Utilities;
8 | using log4net.Core;
9 | using WPFCustomMessageBox;
10 |
11 | namespace DisableNvidiaTelemetry
12 | {
13 | ///
14 | /// Interaction logic for App.xaml
15 | ///
16 | public partial class App : Application
17 | {
18 | private static void SilentlyDisableTelemetry()
19 | {
20 | Logging.GetFileLogger().Log(Level.Info, DisableNvidiaTelemetry.Properties.Resources.Silently_disabling_telemetry_services);
21 |
22 | foreach (var serviceResult in NvidiaController.EnumerateTelemetryServices().ToList())
23 | {
24 | if (serviceResult.Error == null)
25 | {
26 | var startupResult = NvidiaController.DisableTelemetryServiceStartup(serviceResult.Item);
27 | Logging.GetFileLogger().Log(Level.Info, startupResult.Error != null
28 | ? $"{DisableNvidiaTelemetry.Properties.Resources.Disable_service_startup_failed}: {serviceResult.Item.Service.DisplayName} ({serviceResult.Item.Service.ServiceName})"
29 | : $"{DisableNvidiaTelemetry.Properties.Resources.Automatic_service_startup_disabled}: {serviceResult.Item.Service.DisplayName} ({serviceResult.Item.Service.ServiceName})");
30 | Logging.GetEventLogger().Log(Level.Info, startupResult.Error != null
31 | ? $"{DisableNvidiaTelemetry.Properties.Resources.Disable_service_startup_failed}: {serviceResult.Item.Service.DisplayName} ({serviceResult.Item.Service.ServiceName})"
32 | : $"{DisableNvidiaTelemetry.Properties.Resources.Automatic_service_startup_disabled}: {serviceResult.Item.Service.DisplayName} ({serviceResult.Item.Service.ServiceName})");
33 |
34 | var result = NvidiaController.DisableTelemetryService(serviceResult.Item);
35 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
36 | ? $"{DisableNvidiaTelemetry.Properties.Resources.Failed_to_stop_service}: {serviceResult.Item.Service.DisplayName} ({serviceResult.Item.Service.ServiceName})"
37 | : $"{DisableNvidiaTelemetry.Properties.Resources.Service_stopped}: {serviceResult.Item.Service.DisplayName} ({serviceResult.Item.Service.ServiceName})");
38 | Logging.GetEventLogger().Log(Level.Info, result.Error != null
39 | ? $"{DisableNvidiaTelemetry.Properties.Resources.Failed_to_stop_service}: {serviceResult.Item.Service.DisplayName} ({serviceResult.Item.Service.ServiceName})"
40 | : $"{DisableNvidiaTelemetry.Properties.Resources.Service_stopped}: {serviceResult.Item.Service.DisplayName} ({serviceResult.Item.Service.ServiceName})");
41 | }
42 | }
43 |
44 | Logging.GetFileLogger().Log(Level.Info, DisableNvidiaTelemetry.Properties.Resources.Silently_disabling_telemetry_tasks);
45 |
46 | foreach (var taskResult in NvidiaController.EnumerateTelemetryTasks().ToList())
47 | {
48 | if (taskResult.Error == null)
49 | {
50 | var result = NvidiaController.DisableTelemetryTask(taskResult.Item);
51 |
52 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
53 | ? $"{DisableNvidiaTelemetry.Properties.Resources.Failed_to_disable_task}: {result.Item.Task.Path}"
54 | : $"{DisableNvidiaTelemetry.Properties.Resources.Task_disabled}: {result.Item.Task.Path}");
55 | Logging.GetEventLogger().Log(Level.Info, result.Error != null
56 | ? $"{DisableNvidiaTelemetry.Properties.Resources.Failed_to_disable_task}: {result.Item.Task.Path}"
57 | : $"{DisableNvidiaTelemetry.Properties.Resources.Task_disabled}: {result.Item.Task.Path}");
58 | }
59 |
60 | else
61 | {
62 | Logging.GetFileLogger().Log(Level.Error, taskResult.Error);
63 | Logging.GetEventLogger().Log(Level.Error, taskResult.Error);
64 | }
65 | }
66 |
67 | Logging.GetFileLogger().Log(Level.Info, DisableNvidiaTelemetry.Properties.Resources.Silently_disabling_telemetry_registry_items);
68 |
69 | foreach (var registryResult in NvidiaController.EnumerateTelemetryRegistryItems().ToList())
70 | {
71 | if (registryResult.Error == null)
72 | {
73 | var result = NvidiaController.DisableTelemetryRegistryItem(registryResult.Item);
74 |
75 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
76 | ? $"{DisableNvidiaTelemetry.Properties.Resources.Failed_to_disable_registry_item}: {result.Item.Name}"
77 | : $"{DisableNvidiaTelemetry.Properties.Resources.Registry_item_disabled}: {result.Item.Name}");
78 | Logging.GetEventLogger().Log(Level.Info, result.Error != null
79 | ? $"{DisableNvidiaTelemetry.Properties.Resources.Failed_to_disable_registry_item}: {result.Item.Name}"
80 | : $"{DisableNvidiaTelemetry.Properties.Resources.Registry_item_disabled}: {result.Item.Name}");
81 | }
82 | }
83 | }
84 |
85 |
86 | private void App_OnStartup(object sender, StartupEventArgs e)
87 | {
88 | AppUtils.InitializeSettings();
89 |
90 | #if PORTABLE
91 | var logDirectory = Path.Combine(Directory.GetCurrentDirectory(), "Logs");
92 | Settings.Default.FileLogging = false;
93 | Settings.Default.Save();
94 | #else
95 | var appData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), DisableNvidiaTelemetry.Properties.Resources.Disable_Nvidia_Telemetry);
96 | if (!Directory.Exists(appData))
97 | Directory.CreateDirectory(appData);
98 |
99 | var logDirectory = Path.Combine(appData, "Logs");
100 | #endif
101 |
102 | Logging.Prepare(logDirectory);
103 | Logging.Enabled = Settings.Default.FileLogging;
104 |
105 | // log all the errors
106 | AppDomain.CurrentDomain.UnhandledException += (s, ee) =>
107 | {
108 | var ex = (Exception) ee.ExceptionObject;
109 | Logging.GetFileLogger().Log(Level.Error, ex.Message, ex);
110 | };
111 |
112 | var showUI = true;
113 |
114 | if (e.Args.Length > 0)
115 | {
116 | Logging.GetFileLogger().Log(Level.Info, $"Startup params: {string.Join(" ", e.Args)}");
117 |
118 | if (e.Args.Contains(AppUtils.StartupParamSilent))
119 | {
120 | showUI = false;
121 | SilentlyDisableTelemetry();
122 | }
123 |
124 | if (e.Args.Contains(AppUtils.StartupParamRegisterTask))
125 | {
126 | showUI = false;
127 |
128 | if (TaskSchedulerUtilities.GetTask() == null)
129 | TaskSchedulerUtilities.Create((TaskSchedulerUtilities.TaskTrigger) Settings.Default.BackgroundTaskTrigger);
130 | }
131 |
132 | if (e.Args.Contains(AppUtils.StartupParamUnregisterTask))
133 | {
134 | showUI = false;
135 | TaskSchedulerUtilities.Remove();
136 | }
137 | }
138 |
139 | if (!AppUtils.IsAdministrator())
140 | CustomMessageBox.Show(DisableNvidiaTelemetry.Properties.Resources.Please_run_the_program_as_administrator_to_continue,
141 | DisableNvidiaTelemetry.Properties.Resources.AdministratorRequired, MessageBoxButton.OK, MessageBoxImage.Error);
142 |
143 | if (showUI)
144 | {
145 | MainWindow = new MainWindow();
146 | MainWindow.Show();
147 | }
148 | }
149 | }
150 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Controller/NvidiaController.cs:
--------------------------------------------------------------------------------
1 | #region
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.ServiceProcess;
6 | using System.Text.RegularExpressions;
7 | using DisableNvidiaTelemetry.Model;
8 | using DisableNvidiaTelemetry.Utilities;
9 | using Microsoft.Win32;
10 | using Microsoft.Win32.TaskScheduler;
11 |
12 | #endregion
13 |
14 | namespace DisableNvidiaTelemetry.Controller
15 | {
16 | internal class NvidiaController
17 | {
18 | ///
19 | /// Returns an enumerable collection of telemetry tasks.
20 | ///
21 | public static IEnumerable> EnumerateTelemetryTasks()
22 | {
23 | var taskFilters = new[]
24 | {
25 | new Regex("NvTmMon_*", RegexOptions.Compiled),
26 | new Regex("NvTmRep*", RegexOptions.Compiled),
27 | new Regex("NvTmRepOnLogon_*", RegexOptions.Compiled)
28 | };
29 |
30 | foreach (var filter in taskFilters)
31 | {
32 | var tasks = TaskService.Instance.FindAllTasks(filter);
33 |
34 | if (tasks.Length == 0)
35 | yield return new NvidiaControllerResult(null, new TaskNotFoundException($"Failed to find task: {filter}")) {Name = filter.ToString()};
36 |
37 | foreach (var task in tasks)
38 | {
39 | var telemetryTask = new TelemetryTask(task);
40 | yield return new NvidiaControllerResult(telemetryTask) {Name = filter.ToString()};
41 | }
42 | }
43 | }
44 |
45 | ///
46 | /// Returns an enumerable collection of telemetry services.
47 | ///
48 | public static IEnumerable> EnumerateTelemetryServices()
49 | {
50 | var serviceNames = new[] {"NvTelemetryContainer"};
51 |
52 | foreach (var serviceName in serviceNames)
53 | {
54 | var sc = new ServiceController(serviceName);
55 |
56 | TelemetryService service = null;
57 | Exception error = null;
58 |
59 | try
60 | {
61 | // throw error if service is not found
62 | var running = sc.Status == ServiceControllerStatus.Running;
63 | service = new TelemetryService(sc);
64 | }
65 |
66 | catch (Exception ex)
67 | {
68 | error = ex;
69 | }
70 |
71 | yield return new NvidiaControllerResult(service, error) {Name = serviceName};
72 | }
73 | }
74 |
75 | ///
76 | /// Returns an enumerable collection of telemetry registry items.
77 | ///
78 | public static IEnumerable> EnumerateTelemetryRegistryItems()
79 | {
80 | var keys = new List
81 | {
82 | new TelemetryRegistryKey(Registry.CurrentUser, @"SOFTWARE\NVIDIA Corporation\NvControlPanel2\Client",
83 | new Dictionary
84 | {
85 | {"OptInOrOutPreference", new TelemetryRegistryKey.RegistryValuePair("1", "0")}
86 | }),
87 | new TelemetryRegistryKey(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\NvContainerLocalSystem",
88 | new Dictionary
89 | {
90 | {
91 | "ImagePath", new TelemetryRegistryKey.RegistryExpressionModifiers(
92 | new Regex(@"-st ""(.*)\\NVIDIA Corporation\\NvContainer\\NvContainerTelemetryApi.dll""$", RegexOptions.Compiled),
93 | new TelemetryRegistryKey.Replacement(
94 | new Regex(@"""(.*)\\NVIDIA Corporation\\NvContainer\\nvcontainer.exe""(.*)$", RegexOptions.Compiled),
95 | @"""$1\NVIDIA Corporation\NvContainer\nvcontainer.exe""$2 -st ""$1\NVIDIA Corporation\NvContainer\NvContainerTelemetryApi.dll"""),
96 | new TelemetryRegistryKey.Replacement(
97 | new Regex(@"(.*) -st ""(.*)\\NVIDIA Corporation\\NvContainer\\NvContainerTelemetryApi.dll""$", RegexOptions.Compiled),
98 | "$1"))
99 | }
100 | }) {RestartRequired = true}
101 | };
102 |
103 | foreach (var key in keys)
104 | {
105 | TelemetryRegistryKey telemetryRegistryKey = null;
106 | Exception error = null;
107 |
108 | try
109 | {
110 | // attempt to enter subkey
111 | var subKey = key.SubKey;
112 | telemetryRegistryKey = key;
113 |
114 | if (subKey == null)
115 | throw new NullReferenceException();
116 | }
117 |
118 | catch (Exception ex)
119 | {
120 | error = ex;
121 | }
122 |
123 | yield return new NvidiaControllerResult(telemetryRegistryKey, error) {Name = key.Name};
124 | }
125 | }
126 |
127 | ///
128 | /// Disables automatic startup for the provided service.
129 | ///
130 | /// The service to disable automatic startup for.
131 | ///
132 | public static NvidiaControllerResult DisableTelemetryServiceStartup(TelemetryService telemetryService)
133 | {
134 | try
135 | {
136 | var modified = false;
137 |
138 | // set service startup to disabled
139 | if (ServiceHelper.GetServiceStartMode(telemetryService.Service) != ServiceStartMode.Disabled)
140 | {
141 | ServiceHelper.ChangeStartMode(telemetryService.Service, ServiceStartMode.Disabled);
142 | modified = true;
143 | }
144 |
145 | return new NvidiaControllerResult(telemetryService) {Modified = modified};
146 | }
147 |
148 | catch (Exception ex)
149 | {
150 | return new NvidiaControllerResult(telemetryService, ex);
151 | }
152 | }
153 |
154 | ///
155 | /// Disables the provided service and waits for it to stop.
156 | ///
157 | /// The service to disable.
158 | ///
159 | public static NvidiaControllerResult DisableTelemetryService(TelemetryService telemetryService)
160 | {
161 | try
162 | {
163 | var modified = false;
164 |
165 | if (telemetryService.Service.Status == ServiceControllerStatus.Running)
166 | {
167 | telemetryService.Service.Stop();
168 | telemetryService.Service.WaitForStatus(ServiceControllerStatus.Stopped);
169 | modified = true;
170 | }
171 |
172 | return new NvidiaControllerResult(telemetryService) {Modified = modified};
173 | }
174 |
175 | catch (Exception ex)
176 | {
177 | return new NvidiaControllerResult(telemetryService, ex);
178 | }
179 | }
180 |
181 | ///
182 | /// Disables the provided task.
183 | ///
184 | /// The task to disable.
185 | ///
186 | public static NvidiaControllerResult DisableTelemetryTask(TelemetryTask telemetryTask)
187 | {
188 | try
189 | {
190 | var modified = false;
191 |
192 | if (telemetryTask.Task.Enabled)
193 | {
194 | telemetryTask.Task.Enabled = false;
195 | modified = true;
196 | }
197 |
198 |
199 | return new NvidiaControllerResult(telemetryTask) {Modified = modified};
200 | }
201 |
202 | catch (Exception ex)
203 | {
204 | return new NvidiaControllerResult(telemetryTask, ex);
205 | }
206 | }
207 |
208 | ///
209 | /// Disables the provided registry keys and its respective value(s).
210 | ///
211 | /// The registry key to disable.
212 | ///
213 | public static NvidiaControllerResult DisableTelemetryRegistryItem(TelemetryRegistryKey telemetryRegistryKey)
214 | {
215 | try
216 | {
217 | var modified = false;
218 |
219 | if (telemetryRegistryKey.IsActive())
220 | {
221 | telemetryRegistryKey.Enabled = false;
222 | modified = true;
223 | }
224 |
225 |
226 | return new NvidiaControllerResult(telemetryRegistryKey) {Modified = modified};
227 | }
228 |
229 | catch (Exception ex)
230 | {
231 | return new NvidiaControllerResult(telemetryRegistryKey, ex);
232 | }
233 | }
234 |
235 | ///
236 | /// Enables automatic startup for the provided service.
237 | ///
238 | /// The service to enable automatic startup for.
239 | ///
240 | public static NvidiaControllerResult EnableTelemetryServiceStartup(TelemetryService telemetryService)
241 | {
242 | try
243 | {
244 | var modified = false;
245 |
246 | // set service startup to automatic
247 | if (ServiceHelper.GetServiceStartMode(telemetryService.Service) != ServiceStartMode.Automatic)
248 | {
249 | ServiceHelper.ChangeStartMode(telemetryService.Service, ServiceStartMode.Automatic);
250 | modified = true;
251 | }
252 |
253 | return new NvidiaControllerResult(telemetryService) {Modified = modified};
254 | }
255 |
256 | catch (Exception ex)
257 | {
258 | return new NvidiaControllerResult(telemetryService, ex);
259 | }
260 | }
261 |
262 | ///
263 | /// Enables the provided service and waits for it to start.
264 | ///
265 | /// The service to enable.
266 | ///
267 | public static NvidiaControllerResult EnableTelemetryService(TelemetryService telemetryService)
268 | {
269 | try
270 | {
271 | var modified = false;
272 |
273 | if (telemetryService.Service.Status != ServiceControllerStatus.Running)
274 | {
275 | telemetryService.Service.Start();
276 | telemetryService.Service.WaitForStatus(ServiceControllerStatus.Running);
277 | modified = true;
278 | }
279 |
280 | return new NvidiaControllerResult(telemetryService) {Modified = modified};
281 | }
282 |
283 | catch (Exception ex)
284 | {
285 | return new NvidiaControllerResult(telemetryService, ex);
286 | }
287 | }
288 |
289 | ///
290 | /// Enables the provided task.
291 | ///
292 | /// The task to enable.
293 | public static NvidiaControllerResult EnableTelemetryTask(TelemetryTask telemetryTask)
294 | {
295 | try
296 | {
297 | var modified = false;
298 |
299 | if (telemetryTask.Task != null && !telemetryTask.Task.Enabled)
300 | {
301 | telemetryTask.Task.Enabled = true;
302 | modified = true;
303 | }
304 |
305 |
306 | return new NvidiaControllerResult(telemetryTask) {Modified = modified};
307 | }
308 |
309 | catch (Exception ex)
310 | {
311 | return new NvidiaControllerResult(telemetryTask, ex);
312 | }
313 | }
314 |
315 |
316 | ///
317 | /// Enables the provided registry key and its respective value(s).
318 | ///
319 | /// The registry key in which to enable.
320 | public static NvidiaControllerResult EnableTelemetryRegistryItem(TelemetryRegistryKey key)
321 | {
322 | try
323 | {
324 | var modified = false;
325 |
326 | if (!key.IsActive())
327 | {
328 | key.Enabled = true;
329 | modified = true;
330 | }
331 |
332 | return new NvidiaControllerResult(key) {Modified = modified};
333 | }
334 |
335 | catch (Exception ex)
336 | {
337 | return new NvidiaControllerResult(key, ex);
338 | }
339 | }
340 | }
341 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Controller/NvidiaControllerResult.cs:
--------------------------------------------------------------------------------
1 | #region
2 |
3 | using System;
4 | using DisableNvidiaTelemetry.Model;
5 |
6 | #endregion
7 |
8 | namespace DisableNvidiaTelemetry.Controller
9 | {
10 | public class NvidiaControllerResult where T : ITelemetry
11 | {
12 | public NvidiaControllerResult(T item, Exception error = null)
13 | {
14 | Item = item;
15 | Error = error;
16 | }
17 |
18 | public bool Modified { get; set; }
19 |
20 | public Exception Error { get; }
21 |
22 | public T Item { get; }
23 |
24 | public string Name { get; set; }
25 | }
26 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/DisableNvidiaTelemetry.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {96BD5143-61F8-4B32-A6DD-8125A4EFE8AA}
8 | WinExe
9 | DisableNvidiaTelemetry
10 | Disable Nvidia Telemetry
11 | v4.5.2
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 | publish\
17 | true
18 | Disk
19 | false
20 | Foreground
21 | 7
22 | Days
23 | false
24 | false
25 | true
26 | 0
27 | 1.0.0.%2a
28 | false
29 | false
30 | true
31 |
32 |
33 | AnyCPU
34 | true
35 | full
36 | false
37 | bin\Debug\
38 | DEBUG;TRACE
39 | prompt
40 | 4
41 |
42 |
43 | AnyCPU
44 | pdbonly
45 | true
46 | bin\Release\
47 | TRACE
48 | prompt
49 | 4
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | app.manifest
58 |
59 |
60 | Icon.ico
61 |
62 |
63 | bin\Portable\
64 | PORTABLE
65 |
66 |
67 |
68 | ..\packages\ExtendedVersion.1.0.1\lib\net35\ExtendedVersion.dll
69 |
70 |
71 | ..\packages\FontAwesome5.WPF.1.0.1\lib\net40\FontAwesome5.WPF.dll
72 |
73 |
74 | ..\packages\TaskScheduler.2.5.24\lib\net452\JetBrains.Annotations.dll
75 |
76 |
77 | ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll
78 |
79 |
80 | ..\packages\TaskScheduler.2.5.24\lib\net452\Microsoft.Win32.TaskScheduler.dll
81 |
82 |
83 | ..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 | 4.0
93 |
94 |
95 |
96 |
97 |
98 | ..\packages\WPFCustomMessageBox.Fork.1.0.9\lib\WPFCustomMessageBox.dll
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | TelemetryControl.xaml
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 | MSBuild:Compile
124 | Designer
125 |
126 |
127 | MSBuild:Compile
128 | Designer
129 |
130 |
131 | App.xaml
132 | Code
133 |
134 |
135 | MainWindow.xaml
136 | Code
137 |
138 |
139 | Designer
140 | MSBuild:Compile
141 |
142 |
143 |
144 |
145 | Code
146 |
147 |
148 | True
149 | True
150 | Resources.resx
151 |
152 |
153 | True
154 | Settings.settings
155 | True
156 |
157 |
158 | PublicResXFileCodeGenerator
159 | Resources.Designer.cs
160 | Designer
161 |
162 |
163 | Designer
164 |
165 |
166 |
167 | SettingsSingleFileGenerator
168 | Settings.Designer.cs
169 |
170 |
171 |
172 |
173 | Designer
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 | False
182 | Microsoft .NET Framework 4.5.2 %28x86 and x64%29
183 | true
184 |
185 |
186 | False
187 | .NET Framework 3.5 SP1
188 | false
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateShoffner/Disable-Nvidia-Telemetry/f5434902eddec792043180d1a7f9e5f78aed1335/DisableNvidiaTelemetry/Icon.ico
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
57 |
58 |
59 |
60 |
61 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
92 |
93 |
99 |
100 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
133 |
134 |
135 |
136 |
137 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
163 |
167 |
171 |
174 | Every Day
175 | After Windows Startup
176 |
177 |
178 |
181 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
209 |
210 |
211 |
212 |
213 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
245 |
246 |
247 |
248 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
282 |
283 |
284 |
285 |
286 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
312 |
314 |
317 | Version 1.0
318 |
319 |
321 | Copyright ©
322 |
324 |
325 |
326 |
327 |
328 | 2018
329 |
330 |
331 |
339 |
340 |
342 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
354 |
355 |
358 |
359 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.ServiceProcess;
6 | using System.Text;
7 | using System.Threading;
8 | using System.Threading.Tasks;
9 | using System.Windows;
10 | using System.Windows.Controls;
11 | using System.Windows.Documents;
12 | using System.Windows.Navigation;
13 | using DisableNvidiaTelemetry.Controller;
14 | using DisableNvidiaTelemetry.Model;
15 | using DisableNvidiaTelemetry.Properties;
16 | using DisableNvidiaTelemetry.Utilities;
17 | using DisableNvidiaTelemetry.View;
18 | using ExtendedVersion;
19 | using log4net.Core;
20 | using WPFCustomMessageBox;
21 |
22 | namespace DisableNvidiaTelemetry
23 | {
24 | public partial class MainWindow : Window
25 | {
26 | private readonly List _logEvents = new List();
27 | private bool _ignoreTaskSetting;
28 | private List _telemetryKeys = new List();
29 | private List _telemetryServices = new List();
30 | private List _telemetryTasks = new List();
31 |
32 | public MainWindow()
33 | {
34 | InitializeComponent();
35 |
36 | lvLogs.ItemsSource = _logEvents;
37 |
38 | LogExtensions.LogEvent += OnLogEvent;
39 | UpdaterUtilities.UpdateResponse += UpdaterUtilities_UpdateResponse;
40 |
41 | var driverVersion = GeforceUtilities.GetDriverVersion();
42 | Logging.GetFileLogger().Log(Level.Info, $"Driver Version: {(driverVersion != null ? driverVersion.ToString() : "N/A")}");
43 |
44 | var gfeVersion = GeforceUtilities.GetGeForceExperienceVersion();
45 | Logging.GetFileLogger().Log(Level.Info, $"GeForce Experience Version: {(gfeVersion != null ? gfeVersion.ToString() : "N/A")}");
46 |
47 | CheckBackgroundTask();
48 |
49 | chkFileLogging.IsChecked = Settings.Default.FileLogging;
50 | chkUpdates.IsChecked = Settings.Default.StartupUpdate;
51 | cbTaskTrigger.SelectedIndex = Settings.Default.BackgroundTaskTrigger;
52 |
53 | if (Logging.IsReadOnly)
54 | {
55 | chkFileLogging.IsEnabled = false;
56 | chkFileLogging.Content += $" ({Properties.Resources.Logging_disabled_on_read_only_device})";
57 | }
58 |
59 | if (Settings.Default.StartupUpdate)
60 | {
61 | btnUpdateCheck.IsEnabled = false;
62 | UpdaterUtilities.UpdateCheck(false);
63 | }
64 |
65 | var version = AppUtils.GetVersion();
66 |
67 | tbVersion.Inlines.Clear();
68 | tbVersion.Inlines.Add(new Run($"{Properties.Resources.Version} {version.ToString(ExtendedVersionFormatFlags.BuildString | ExtendedVersionFormatFlags.Truncated)} "));
69 |
70 | Title += $" v{version.ToString(ExtendedVersionFormatFlags.BuildString | ExtendedVersionFormatFlags.Truncated)} ";
71 |
72 | if (version.Commit != null)
73 | {
74 | var link = new Hyperlink(new Run(version.Commit.ToShorthandString()))
75 | {
76 | NavigateUri = new Uri($"{Properties.Resources.GithubUrl}/commit/{AppUtils.GetVersion().Commit}")
77 | };
78 | link.RequestNavigate += Hyperlink_OnRequestNavigate;
79 | tbVersion.Inlines.Add(link);
80 | }
81 |
82 | #if PORTABLE
83 |
84 | Title += $" ({Properties.Resources.Portable})";
85 |
86 | #endif
87 | }
88 |
89 | private void UpdaterUtilities_UpdateResponse(object sender, UpdaterUtilities.UpdateResponseEventArgs e)
90 | {
91 | var showDialog = (bool) e.UserToken;
92 |
93 | if (e.Error == null)
94 | {
95 | var current = AppUtils.GetVersion().ToVersion();
96 |
97 | if (e.LatestVersion > current)
98 | {
99 | var result = CustomMessageBox.Show(Properties.Resources.Update_available_message, Properties.Resources.Update_available, MessageBoxButton.YesNo, MessageBoxImage.Information);
100 |
101 | if (result == MessageBoxResult.Yes)
102 | Process.Start(e.Url.ToString());
103 | }
104 |
105 | else if (showDialog)
106 | {
107 | CustomMessageBox.Show(
108 | Properties.Resources.No_updates_available_message,
109 | Properties.Resources.Updates);
110 | }
111 | }
112 |
113 | else
114 | {
115 | Logging.GetFileLogger().Log(Level.Error, e.Error, suppressEvents: true);
116 |
117 | if (showDialog)
118 | CustomMessageBox.Show(
119 | Properties.Resources.Update_error_messsage,
120 | Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
121 | }
122 |
123 | btnUpdateCheck.IsEnabled = true;
124 | }
125 |
126 | private void CheckBackgroundTask()
127 | {
128 | _ignoreTaskSetting = true;
129 |
130 | chkBackgroundTask.IsChecked = TaskSchedulerUtilities.GetTask() != null;
131 |
132 | _ignoreTaskSetting = false;
133 | }
134 |
135 | private void OnLogEvent(object sender, LogExtensions.LogEventArgs e)
136 | {
137 | if (e.Log.Equals(Logging.GetFileLogger()))
138 | {
139 | _logEvents.Add(e.Event);
140 | lvLogs.Items.Refresh();
141 | lvLogs.SelectedItem = _logEvents.Last();
142 | lvLogs.ScrollIntoView(_logEvents.Last());
143 | }
144 | }
145 |
146 | private void RefreshTelemetryTasks(bool logging)
147 | {
148 | var tasks = new List();
149 |
150 | foreach (var result in NvidiaController.EnumerateTelemetryTasks())
151 | {
152 | if (logging)
153 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
154 | ? $"{Properties.Resources.Failed_to_find_task}: {result.Name}"
155 | : $"{Properties.Resources.Found_task}: {result.Item.Task.Name}");
156 |
157 | if (result.Error == null)
158 | {
159 | var task = result.Item;
160 |
161 | if (logging)
162 | Logging.GetFileLogger().Log(Level.Info, task.Task.Enabled
163 | ? $"{Properties.Resources.Task_is}: {Properties.Resources.Enabled}"
164 | : $"{Properties.Resources.Task_is}: {Properties.Resources.Disabled}");
165 |
166 | tcTasks.AddTelemetryItem(task, $"{Properties.Resources.Task}: {task.Task.Path}");
167 | tasks.Add(task);
168 | }
169 | }
170 |
171 | _telemetryTasks = tasks;
172 | }
173 |
174 | private void RefreshTelemetryServices(bool logging)
175 | {
176 | var services = new List();
177 |
178 | foreach (var result in NvidiaController.EnumerateTelemetryServices())
179 | {
180 | if (logging)
181 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
182 | ? $"{Properties.Resources.Failed_to_find_service}: {result.Name}"
183 | : $"{Properties.Resources.Found_service}: {result.Item.Service.DisplayName} ({result.Item.Service.ServiceName})");
184 |
185 | if (result.Error == null)
186 | {
187 | var service = result.Item;
188 | var running = service.Service.Status == ServiceControllerStatus.Running;
189 | var startupMode = ServiceHelper.GetServiceStartMode(service.Service);
190 |
191 | var startupModeString = "";
192 |
193 | switch (startupMode)
194 | {
195 | case ServiceStartMode.Manual:
196 | startupModeString = Properties.Resources.Manual;
197 | break;
198 | case ServiceStartMode.Automatic:
199 | startupModeString = Properties.Resources.Automatic;
200 | break;
201 | case ServiceStartMode.Disabled:
202 | startupModeString = Properties.Resources.Disabled;
203 | break;
204 | }
205 |
206 | if (logging)
207 | {
208 | Logging.GetFileLogger().Log(Level.Info, running
209 | ? $"{Properties.Resources.Service_is}: {Properties.Resources.Enabled}"
210 | : $"{Properties.Resources.Service_is}: {Properties.Resources.Disabled}");
211 |
212 | Logging.GetFileLogger().Log(Level.Info, $"{Properties.Resources.Service_startup_mode}: {startupModeString}");
213 | }
214 |
215 | tcServices.AddTelemetryItem(service, $"{Properties.Resources.Service}: {service.Service.DisplayName} ({service.Service.ServiceName})");
216 | services.Add(service);
217 | }
218 | }
219 |
220 | _telemetryServices = services;
221 | }
222 |
223 | private void RefreshTelemetryRegistry(bool logging)
224 | {
225 | var keys = new List();
226 |
227 | foreach (var result in NvidiaController.EnumerateTelemetryRegistryItems())
228 | {
229 | if (logging)
230 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
231 | ? $"{Properties.Resources.Failed_to_find_registry_item}: {result.Name}"
232 | : $"{Properties.Resources.Found_registry_item}: {result.Item.Name}");
233 |
234 | if (result.Error == null)
235 | {
236 | if (logging)
237 | Logging.GetFileLogger().Log(Level.Info, $"{Properties.Resources.Registry_item_is}: {Properties.Resources.Enabled}");
238 |
239 | var key = result.Item;
240 |
241 | var sb = new StringBuilder();
242 |
243 | sb.AppendLine(key.Name);
244 |
245 | foreach (var vd in key.GetValues())
246 | {
247 | sb.Append("@=\"");
248 | sb.Append(vd.Key);
249 | sb.Append("\"");
250 | sb.AppendLine();
251 | }
252 |
253 | tcRegistry.AddTelemetryItem(key, sb.ToString());
254 | keys.Add(key);
255 | }
256 | }
257 |
258 | _telemetryKeys = keys;
259 | }
260 |
261 |
262 | private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
263 | {
264 | RefreshTelemetryServices(true);
265 | RefreshTelemetryTasks(true);
266 | RefreshTelemetryRegistry(true);
267 | }
268 |
269 | private void btnDonate_Click(object sender, RoutedEventArgs e)
270 | {
271 | Process.Start(Properties.Resources.PaypalUrl);
272 | }
273 |
274 | private void chkBackgroundTask_Checked(object sender, RoutedEventArgs e)
275 | {
276 | cbTaskTrigger.IsEnabled = chkBackgroundTask.IsChecked.Value;
277 |
278 | if (_ignoreTaskSetting)
279 | return;
280 |
281 | if (chkBackgroundTask.IsChecked.Value)
282 | TaskSchedulerUtilities.Create((TaskSchedulerUtilities.TaskTrigger) Settings.Default.BackgroundTaskTrigger);
283 | else
284 | TaskSchedulerUtilities.Remove();
285 | }
286 |
287 | private void btnUpdatecheck_Click(object sender, RoutedEventArgs e)
288 | {
289 | btnUpdateCheck.IsEnabled = false;
290 | UpdaterUtilities.UpdateCheck(true);
291 | }
292 |
293 | private void cbTaskTrigger_SelectionChanged(object sender, SelectionChangedEventArgs e)
294 | {
295 | Settings.Default.BackgroundTaskTrigger = cbTaskTrigger.SelectedIndex;
296 | Settings.Default.Save();
297 | }
298 |
299 | private void ChkFileLogging_OnClick(object sender, RoutedEventArgs e)
300 | {
301 | Logging.Enabled = chkFileLogging.IsChecked.Value;
302 | Settings.Default.FileLogging = chkFileLogging.IsChecked.Value;
303 | Settings.Default.Save();
304 | }
305 |
306 | private void ChkUpdates_OnClick(object sender, RoutedEventArgs e)
307 | {
308 | Settings.Default.StartupUpdate = chkUpdates.IsChecked.Value;
309 | Settings.Default.Save();
310 | }
311 |
312 | private void BtnGithub_OnClick(object sender, RoutedEventArgs e)
313 | {
314 | Process.Start(Properties.Resources.GithubUrl);
315 | }
316 |
317 | private void MenuItem_OnClick(object sender, RoutedEventArgs e)
318 | {
319 | Clipboard.SetText(((Logging.LogEvent) lvLogs.SelectedItem).Message.ToString());
320 | }
321 |
322 | private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
323 | {
324 | Process.Start(e.Uri.ToString());
325 | }
326 |
327 | private void tcServices_RefreshClicked(object sender, EventArgs e)
328 | {
329 | tcServices.Reset();
330 | RefreshTelemetryServices(true);
331 | }
332 |
333 | private void tcTasks_RefreshClicked(object sender, EventArgs e)
334 | {
335 | tcTasks.Reset();
336 | RefreshTelemetryTasks(true);
337 | }
338 |
339 | private void tcRegistry_RefreshClicked(object sender, EventArgs e)
340 | {
341 | tcRegistry.Reset();
342 | RefreshTelemetryRegistry(true);
343 | }
344 |
345 | private void tcServices_DefaultClicked(object sender, EventArgs e)
346 | {
347 | tcServices.Reset();
348 |
349 | foreach (var item in _telemetryServices)
350 | {
351 | var result = NvidiaController.EnableTelemetryServiceStartup(item);
352 |
353 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
354 | ? $"{Properties.Resources.Automatic_service_startup_failed}: {item.Service.DisplayName} ({item.Service.ServiceName})"
355 | : $"{Properties.Resources.Automatic_service_startup_enabled}: {item.Service.DisplayName} ({item.Service.ServiceName})");
356 | }
357 |
358 | foreach (var item in _telemetryServices)
359 | {
360 | var result = NvidiaController.EnableTelemetryService(item);
361 |
362 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
363 | ? $"{Properties.Resources.Failed_to_start_service}: {item.Service.DisplayName} ({item.Service.ServiceName})"
364 | : $"{Properties.Resources.Service_started}: {item.Service.DisplayName} ({item.Service.ServiceName})");
365 | }
366 |
367 | RefreshTelemetryServices(false);
368 | }
369 |
370 | private void tcTasks_DefaultClicked(object sender, EventArgs e)
371 | {
372 | tcTasks.Reset();
373 |
374 | foreach (var item in _telemetryTasks)
375 | {
376 | var result = NvidiaController.EnableTelemetryTask(item);
377 |
378 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
379 | ? $"{Properties.Resources.Failed_to_enable_task}: {result.Item.Task.Path}"
380 | : $"{Properties.Resources.Task_enabled}: {result.Item.Task.Path}");
381 | }
382 |
383 | foreach (var item in _telemetryKeys)
384 | {
385 | var result = NvidiaController.EnableTelemetryRegistryItem(item);
386 |
387 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
388 | ? $"{Properties.Resources.Failed_to_enable_registry_item}: {result.Item.Name}"
389 | : $"{Properties.Resources.Registry_item_enabled}: {result.Item.Name}");
390 | }
391 |
392 | RefreshTelemetryTasks(false);
393 | }
394 |
395 | private void tcRegistry_DefaultClicked(object sender, EventArgs e)
396 | {
397 | tcRegistry.Reset();
398 |
399 | foreach (var item in _telemetryKeys)
400 | {
401 | var result = NvidiaController.EnableTelemetryRegistryItem(item);
402 |
403 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
404 | ? $"{Properties.Resources.Failed_to_enable_registry_item}: {result.Item.Name}"
405 | : $"{Properties.Resources.Registry_item_enabled}: {result.Item.Name}");
406 | }
407 |
408 | RefreshTelemetryRegistry(false);
409 | }
410 |
411 | private void TcRegistry_OnTelemetryChanging(object sender, TelemetryControl.TelemetryEventArgs e)
412 | {
413 | var telemetry = (TelemetryRegistryKey) e.Telemetry;
414 |
415 | if (e.Enabled)
416 | {
417 | var result = NvidiaController.EnableTelemetryRegistryItem(telemetry);
418 |
419 | if (result.Error != null)
420 | {
421 | e.Cancel = true;
422 | CustomMessageBox.Show(
423 | Properties.Resources.Failed_to_enable_registry_item,
424 | Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
425 | }
426 |
427 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
428 | ? $"{Properties.Resources.Failed_to_enable_registry_item}: {result.Item.Name}"
429 | : $"{Properties.Resources.Registry_item_enabled}: {result.Item.Name}");
430 | }
431 |
432 | else
433 | {
434 | var result = NvidiaController.DisableTelemetryRegistryItem(telemetry);
435 |
436 | if (result.Error != null)
437 | {
438 | e.Cancel = true;
439 | CustomMessageBox.Show(
440 | Properties.Resources.Failed_to_disable_registry_item,
441 | Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
442 | }
443 |
444 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
445 | ? $"{Properties.Resources.Failed_to_disable_registry_item}: {result.Item.Name}"
446 | : $"{Properties.Resources.Registry_item_disabled}: {result.Item.Name}");
447 | }
448 | }
449 |
450 | private void TcServices_OnTelemetryChanging(object sender, TelemetryControl.TelemetryEventArgs e)
451 | {
452 | var telemetry = (TelemetryService) e.Telemetry;
453 |
454 | if (e.Enabled)
455 | {
456 | var startupResult = NvidiaController.EnableTelemetryServiceStartup(telemetry);
457 |
458 | Logging.GetFileLogger().Log(Level.Info, startupResult.Error != null
459 | ? $"{Properties.Resources.Automatic_service_startup_failed}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})"
460 | : $"{Properties.Resources.Automatic_service_startup_enabled}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})");
461 |
462 | var result = NvidiaController.EnableTelemetryService(telemetry);
463 |
464 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
465 | ? $"{Properties.Resources.Failed_to_start_service}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})"
466 | : $"{Properties.Resources.Service_started}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})");
467 | }
468 |
469 | else
470 | {
471 | var startupResult = NvidiaController.DisableTelemetryServiceStartup(telemetry);
472 |
473 | Logging.GetFileLogger().Log(Level.Info, startupResult.Error != null
474 | ? $"{Properties.Resources.Disable_service_startup_failed}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})"
475 | : $"{Properties.Resources.Automatic_service_startup_disabled}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})");
476 |
477 | var result = NvidiaController.DisableTelemetryService(telemetry);
478 |
479 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
480 | ? $"{Properties.Resources.Failed_to_stop_service}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})"
481 | : $"{Properties.Resources.Service_stopped}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})");
482 | }
483 | }
484 |
485 | private void TcTasks_OnTelemetryChanging(object sender, TelemetryControl.TelemetryEventArgs e)
486 | {
487 | var telemetry = (TelemetryTask) e.Telemetry;
488 |
489 | if (e.Enabled)
490 | {
491 | var result = NvidiaController.EnableTelemetryTask(telemetry);
492 |
493 | if (result.Error != null)
494 | e.Cancel = true;
495 |
496 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
497 | ? $"{Properties.Resources.Failed_to_enable_task}: {result.Item.Task.Path}"
498 | : $"{Properties.Resources.Task_enabled}: {result.Item.Task.Path}");
499 | }
500 |
501 | else
502 | {
503 | var result = NvidiaController.DisableTelemetryTask(telemetry);
504 |
505 | if (result.Error != null)
506 | e.Cancel = true;
507 |
508 | Logging.GetFileLogger().Log(Level.Info, result.Error != null
509 | ? $"{Properties.Resources.Failed_to_disable_task}: {result.Item.Task.Path}"
510 | : $"{Properties.Resources.Task_disabled}: {result.Item.Task.Path}");
511 | }
512 | }
513 |
514 | private void OnTelemetryChanged(object sender, TelemetryControl.TelemetryEventArgs e)
515 | {
516 | if (e.Telemetry.RestartRequired)
517 | Task.Factory.StartNew(() => Thread.Sleep(200))
518 | .ContinueWith(t => { PromptRestart(); }, TaskScheduler.FromCurrentSynchronizationContext());
519 | }
520 |
521 | private static void PromptRestart()
522 | {
523 | var result = CustomMessageBox.ShowYesNo(
524 | Properties.Resources.Restart_required_message,
525 | Properties.Resources.Restart_requried,
526 | Properties.Resources.Restart_now,
527 | Properties.Resources.Restart_later);
528 |
529 | if (result == MessageBoxResult.Yes)
530 | WindowsUtils.Restart();
531 | }
532 |
533 | private void btnGeforce_Click(object sender, RoutedEventArgs e)
534 | {
535 | var path = GeforceUtilities.GetGeforceExperiencePath();
536 |
537 | if (path != null)
538 | Process.Start(path);
539 | }
540 | }
541 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/MarginSetter.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 |
4 | namespace DisableNvidiaTelemetry
5 | {
6 | public class MarginSetter
7 | {
8 | // Using a DependencyProperty as the backing store for Margin. This enables animation, styling, binding, etc...
9 | public static readonly DependencyProperty MarginProperty =
10 | DependencyProperty.RegisterAttached("Margin", typeof(Thickness), typeof(MarginSetter), new UIPropertyMetadata(new Thickness(), CreateThicknesForChildren));
11 |
12 | public static Thickness GetMargin(DependencyObject obj)
13 | {
14 | return (Thickness) obj.GetValue(MarginProperty);
15 | }
16 |
17 | public static void SetMargin(DependencyObject obj, Thickness value)
18 | {
19 | obj.SetValue(MarginProperty, value);
20 | }
21 |
22 | public static void CreateThicknesForChildren(object sender, DependencyPropertyChangedEventArgs e)
23 | {
24 | var panel = sender as Panel;
25 |
26 | if (panel == null) return;
27 |
28 | foreach (var child in panel.Children)
29 | {
30 | var fe = child as FrameworkElement;
31 |
32 | if (fe == null) continue;
33 |
34 | // preserve any possible margins defined locally
35 | var currentMargin = fe.Margin; // new Thickness(fe.Margin.Left, fe.Margin.Top, fe.Margin.Right, fe.Margin.Bottom);
36 | var definedMargin = GetMargin(panel);
37 |
38 | var newMargin = new Thickness(currentMargin.Left + definedMargin.Left,
39 | currentMargin.Top + definedMargin.Top,
40 | currentMargin.Right + definedMargin.Right,
41 | currentMargin.Bottom + definedMargin.Bottom);
42 |
43 | fe.Margin = GetMargin(panel);
44 | }
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Model/ITelemetry.cs:
--------------------------------------------------------------------------------
1 | namespace DisableNvidiaTelemetry.Model
2 | {
3 | public interface ITelemetry
4 | {
5 | bool RestartRequired { get; set; }
6 | bool IsActive();
7 | }
8 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Model/TaskNotFoundException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace DisableNvidiaTelemetry.Model
4 | {
5 | ///
6 | /// Represents an exception where a secheduled task could not be found.
7 | ///
8 | public class TaskNotFoundException : Exception
9 | {
10 | public TaskNotFoundException()
11 | {
12 | }
13 |
14 | public TaskNotFoundException(string message) : base(message)
15 | {
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Model/TelemetryRegistryKey.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using System.Text.RegularExpressions;
4 | using Microsoft.Win32;
5 |
6 | namespace DisableNvidiaTelemetry.Model
7 | {
8 | internal class TelemetryRegistryKey : ITelemetry
9 | {
10 | private readonly string _subKeyPath;
11 | private readonly bool _useRegex;
12 | public Dictionary ValueExpressions;
13 |
14 | public Dictionary ValueStrings;
15 |
16 | public TelemetryRegistryKey(RegistryKey baseKey, string subKeyPath, Dictionary valueStrings)
17 | {
18 | BaseKey = baseKey;
19 | _subKeyPath = subKeyPath;
20 | ValueStrings = valueStrings;
21 | }
22 |
23 | public TelemetryRegistryKey(RegistryKey baseKey, string subKeyPath, Dictionary valueExpressions)
24 | {
25 | BaseKey = baseKey;
26 | _subKeyPath = subKeyPath;
27 | ValueExpressions = valueExpressions;
28 | _useRegex = true;
29 | }
30 |
31 | private RegistryKey BaseKey { get; }
32 |
33 | public RegistryKey SubKey => BaseKey.OpenSubKey(_subKeyPath, RegistryKeyPermissionCheck.ReadWriteSubTree);
34 |
35 | public string Name => $"{BaseKey.Name}\\{_subKeyPath}";
36 |
37 | public bool Enabled
38 | {
39 | set
40 | {
41 | var subKey = SubKey;
42 |
43 | if (_useRegex)
44 | foreach (var vd in ValueExpressions)
45 | {
46 | var currentValue = subKey.GetValue(vd.Key).ToString();
47 |
48 | subKey.SetValue(vd.Key, value
49 | ? vd.Value.Enabled.Regex.Replace(currentValue, vd.Value.Enabled.Replacment)
50 | : vd.Value.Disabled.Regex.Replace(currentValue, vd.Value.Disabled.Replacment));
51 | }
52 |
53 | else
54 | foreach (var vd in ValueStrings)
55 | {
56 | subKey.SetValue(vd.Key, value
57 | ? vd.Value.Enabled
58 | : vd.Value.Disabled);
59 | }
60 | }
61 | }
62 |
63 | public Dictionary GetValues()
64 | {
65 | var values = new Dictionary();
66 |
67 | var subKey = SubKey;
68 |
69 | if (subKey == null)
70 | return null;
71 |
72 | if (_useRegex)
73 | foreach (var vd in ValueExpressions)
74 | {
75 | values.Add(vd.Key, subKey.GetValue(vd.Key)?.ToString());
76 | }
77 |
78 | else
79 | foreach (var vd in ValueStrings)
80 | {
81 | var value = subKey.GetValue(vd.Key);
82 | values.Add(vd.Key, value?.ToString());
83 | }
84 |
85 | return values;
86 | }
87 |
88 | public class RegistryExpressionModifiers
89 | {
90 | public RegistryExpressionModifiers(Regex match, Replacement enabled, Replacement disabled)
91 | {
92 | Match = match;
93 | Enabled = enabled;
94 | Disabled = disabled;
95 | }
96 |
97 | public Regex Match { get; }
98 |
99 | public Replacement Enabled { get; }
100 |
101 | public Replacement Disabled { get; }
102 | }
103 |
104 | public class RegistryValuePair
105 | {
106 | public RegistryValuePair(string enabled, string disabled)
107 | {
108 | Enabled = enabled;
109 | Disabled = disabled;
110 | }
111 |
112 | public string Enabled { get; }
113 |
114 | public string Disabled { get; }
115 | }
116 |
117 |
118 | public class Replacement
119 | {
120 | public Replacement(Regex regex, string replacment)
121 | {
122 | Regex = regex;
123 | Replacment = replacment;
124 | }
125 |
126 | public Regex Regex { get; }
127 | public string Replacment { get; }
128 | }
129 |
130 | #region Implementation of ITelemetry
131 |
132 | public bool IsActive()
133 | {
134 | var subKey = SubKey;
135 |
136 | if (subKey == null)
137 | return false;
138 |
139 | return _useRegex
140 | ? ValueExpressions.Select(vd => vd.Value.Match.IsMatch(subKey.GetValue(vd.Key).ToString())).FirstOrDefault()
141 | : ValueStrings.Any(vd => subKey.GetValue(vd.Key).ToString() == vd.Value.Enabled);
142 | }
143 |
144 | public bool RestartRequired { get; set; }
145 |
146 | #endregion
147 | }
148 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Model/TelemetryService.cs:
--------------------------------------------------------------------------------
1 | using System.ServiceProcess;
2 |
3 | namespace DisableNvidiaTelemetry.Model
4 | {
5 | internal class TelemetryService : ITelemetry
6 | {
7 | public TelemetryService(ServiceController service)
8 | {
9 | Service = service;
10 | }
11 |
12 | public ServiceController Service { get; }
13 |
14 | #region Implementation of ITelemetry
15 |
16 | public bool RestartRequired { get; set; }
17 |
18 | public bool IsActive()
19 | {
20 | return Service != null && Service.Status == ServiceControllerStatus.Running;
21 | }
22 |
23 | #endregion
24 | }
25 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Model/TelemetryTask.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32.TaskScheduler;
2 |
3 | namespace DisableNvidiaTelemetry.Model
4 | {
5 | internal class TelemetryTask : ITelemetry
6 | {
7 | public TelemetryTask(Task task)
8 | {
9 | Task = task;
10 | }
11 |
12 | public Task Task { get; }
13 |
14 | #region Implementation of ITelemetry
15 |
16 | public bool RestartRequired { get; set; }
17 |
18 | public bool IsActive()
19 | {
20 | return Task != null && Task.Enabled;
21 | }
22 |
23 | #endregion
24 | }
25 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/PortableSettingsProvider.cs:
--------------------------------------------------------------------------------
1 | #region
2 |
3 | using System;
4 | using System.Collections.Specialized;
5 | using System.Configuration;
6 | using System.IO;
7 | using System.Xml;
8 | using System.Xml.Serialization;
9 |
10 | #endregion
11 |
12 | namespace DisableNvidiaTelemetry
13 | {
14 | internal class PortableSettingsProvider : SettingsProvider
15 | {
16 | private const string APPLICATION_NAME = "DisableNvidiaTelemetry";
17 | private const string CONFIG_NAME = "Settings.config";
18 |
19 | // Define some static strings later used in our XML creation
20 | // XML Root node
21 | private const string XMLROOT = "configuration";
22 |
23 | // Configuration declaration node
24 | private const string CONFIGNODE = "configSections";
25 |
26 | // Configuration section group declaration node
27 | private const string GROUPNODE = "sectionGroup";
28 |
29 | // User section node
30 | private const string USERNODE = "userSettings";
31 |
32 | // Application Specific Node
33 | private const string APPNODE = APPLICATION_NAME + ".Properties.Settings";
34 |
35 | private XmlDocument xmlDoc;
36 | public override string Name => "PortableSettingsProvider";
37 |
38 | // Override the ApplicationName property, returning the solution name. No need to set anything, we just need to
39 | // retrieve information, though the set method still needs to be defined.
40 | public override string ApplicationName
41 | {
42 | get { return APPLICATION_NAME; }
43 | set { }
44 | }
45 |
46 | private XmlDocument XMLConfig
47 | {
48 | get
49 | {
50 | // Check if we already have accessed the XML config file. If the xmlDoc object is empty, we have not.
51 | if (xmlDoc == null)
52 | {
53 | xmlDoc = new XmlDocument();
54 |
55 | // If we have not loaded the config, try reading the file from disk.
56 | try
57 | {
58 | xmlDoc.Load(Path.Combine(GetAppPath(), GetSettingsFilename()));
59 | }
60 |
61 | // If the file does not exist on disk, catch the exception then create the XML template for the file.
62 | catch (Exception)
63 | {
64 | // XML Declaration
65 | //
66 | var dec = xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null);
67 | xmlDoc.AppendChild(dec);
68 |
69 | // Create root node and append to the document
70 | //
71 | var rootNode = xmlDoc.CreateElement(XMLROOT);
72 | xmlDoc.AppendChild(rootNode);
73 |
74 | // Create Configuration Sections node and add as the first node under the root
75 | //
76 | var configNode = xmlDoc.CreateElement(CONFIGNODE);
77 | xmlDoc.DocumentElement.PrependChild(configNode);
78 |
79 | // Create the user settings section group declaration and append to the config node above
80 | //
81 | var groupNode = xmlDoc.CreateElement(GROUPNODE);
82 | groupNode.SetAttribute("name", USERNODE);
83 | groupNode.SetAttribute("type", "System.Configuration.UserSettingsGroup");
84 | configNode.AppendChild(groupNode);
85 |
86 | // Create the Application section declaration and append to the groupNode above
87 | //
88 | var newSection = xmlDoc.CreateElement("section");
89 | newSection.SetAttribute("name", APPNODE);
90 | newSection.SetAttribute("type", "System.Configuration.ClientSettingsSection");
91 | groupNode.AppendChild(newSection);
92 |
93 | // Create the userSettings node and append to the root node
94 | //
95 | var userNode = xmlDoc.CreateElement(USERNODE);
96 | xmlDoc.DocumentElement.AppendChild(userNode);
97 |
98 | // Create the Application settings node and append to the userNode above
99 | //
100 | var appNode = xmlDoc.CreateElement(APPNODE);
101 | userNode.AppendChild(appNode);
102 | }
103 | }
104 | return xmlDoc;
105 | }
106 | }
107 |
108 | // Override the Initialize method
109 | public override void Initialize(string name, NameValueCollection config)
110 | {
111 | base.Initialize(ApplicationName, config);
112 | }
113 |
114 | // Simply returns the name of the settings file, which is the solution name plus ".config"
115 | public virtual string GetSettingsFilename()
116 | {
117 | return CONFIG_NAME;
118 | }
119 |
120 | // Gets current executable path in order to determine where to read and write the config file
121 | public virtual string GetAppPath()
122 | {
123 | #if PORTABLE
124 | return Directory.GetCurrentDirectory();
125 | #else
126 | var appData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Disable Nvidia Telemetry");
127 | if (!Directory.Exists(appData))
128 | Directory.CreateDirectory(appData);
129 |
130 | return appData;
131 | #endif
132 | }
133 |
134 | // Retrieve settings from the configuration file
135 | public override SettingsPropertyValueCollection GetPropertyValues(SettingsContext sContext, SettingsPropertyCollection settingsColl)
136 | {
137 | // Create a collection of values to return
138 | var retValues = new SettingsPropertyValueCollection();
139 |
140 | // Create a temporary SettingsPropertyValue to reuse
141 |
142 | // Loop through the list of settings that the application has requested and add them
143 | // to our collection of return values.
144 | foreach (SettingsProperty sProp in settingsColl)
145 | {
146 | var setVal = new SettingsPropertyValue(sProp) {IsDirty = false, SerializedValue = GetSetting(sProp)};
147 | retValues.Add(setVal);
148 | }
149 | return retValues;
150 | }
151 |
152 | // Save any of the applications settings that have changed (flagged as "dirty")
153 | public override void SetPropertyValues(SettingsContext sContext, SettingsPropertyValueCollection settingsColl)
154 | {
155 | // Set the values in XML
156 | foreach (SettingsPropertyValue spVal in settingsColl)
157 | {
158 | SetSetting(spVal);
159 | }
160 |
161 | // Write the XML file to disk
162 | try
163 | {
164 | XMLConfig.Save(Path.Combine(GetAppPath(), GetSettingsFilename()));
165 | }
166 | catch
167 | {
168 | //unhandled
169 | }
170 | }
171 |
172 | // Retrieve values from the configuration file, or if the setting does not exist in the file,
173 | // retrieve the value from the application's default configuration
174 | private object GetSetting(SettingsProperty setProp)
175 | {
176 | object retVal;
177 |
178 | try
179 | {
180 | if (setProp.SerializeAs.ToString() == "String")
181 | return XMLConfig.SelectSingleNode("//setting[@name='" + setProp.Name + "']").FirstChild.InnerText;
182 |
183 | var xmlData = XMLConfig.SelectSingleNode(string.Format("//setting[@name='{0}']", setProp.Name)).FirstChild.InnerXml;
184 | return string.Format(@"{0}", xmlData);
185 | }
186 |
187 | catch (Exception)
188 | {
189 | if (setProp.DefaultValue != null)
190 | if (setProp.SerializeAs.ToString() == "String")
191 | {
192 | retVal = setProp.DefaultValue.ToString();
193 | }
194 | else
195 | {
196 | var settingType = setProp.PropertyType.ToString();
197 | var xmlData = setProp.DefaultValue.ToString();
198 | var xs = new XmlSerializer(typeof(string[]));
199 | var data = (string[]) xs.Deserialize(new XmlTextReader(xmlData, XmlNodeType.Element, null));
200 |
201 | switch (settingType)
202 | {
203 | case "System.Collections.Specialized.StringCollection":
204 | var sc = new StringCollection();
205 | sc.AddRange(data);
206 | return sc;
207 |
208 | default:
209 | return "";
210 | }
211 | }
212 | else
213 | retVal = "";
214 | }
215 | return retVal;
216 | }
217 |
218 | private void SetSetting(SettingsPropertyValue setProp)
219 | {
220 | // Define the XML path under which we want to write our settings if they do not already exist
221 | XmlNode settingNode;
222 |
223 | try
224 | {
225 | // Search for the specific settings node we want to update.
226 | // If it exists, return its first child node, (the data here node)
227 | settingNode = XMLConfig.SelectSingleNode("//setting[@name='" + setProp.Name + "']").FirstChild;
228 | }
229 | catch (Exception)
230 | {
231 | settingNode = null;
232 | }
233 |
234 | // If we have a pointer to an actual XML node, update the value stored there
235 | if (settingNode != null)
236 | {
237 | if (setProp.Property.SerializeAs.ToString() == "String")
238 | settingNode.InnerText = setProp.SerializedValue.ToString();
239 | else
240 | settingNode.InnerXml = setProp.SerializedValue.ToString().Replace(@"", "");
241 | }
242 | else
243 | {
244 | // If the value did not already exist in this settings file, create a new entry for this setting
245 |
246 | // Search for the application settings node () and store it.
247 | var tmpNode = XMLConfig.SelectSingleNode("//" + APPNODE);
248 |
249 | // Create a new settings node and assign its name as well as how it will be serialized
250 | var newSetting = xmlDoc.CreateElement("setting");
251 | newSetting.SetAttribute("name", setProp.Name);
252 |
253 | newSetting.SetAttribute("serializeAs", setProp.Property.SerializeAs.ToString() == "String"
254 | ? "String"
255 | : "Xml");
256 |
257 | // Append this node to the application settings node ()
258 | tmpNode.AppendChild(newSetting);
259 |
260 | // Create an element under our named settings node, and assign it the value we are trying to save
261 | var valueElement = xmlDoc.CreateElement("value");
262 | if (setProp.Property.SerializeAs.ToString() == "String")
263 | valueElement.InnerText = setProp.SerializedValue.ToString();
264 | else
265 | valueElement.InnerXml = setProp.SerializedValue.ToString().Replace(@"", "");
266 |
267 | //Append this new element under the setting node we created above
268 | newSetting.AppendChild(valueElement);
269 | }
270 | }
271 | }
272 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 | using System.Windows;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Disable Nvidia Telemetry")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Nate Shoffner")]
12 | [assembly: AssemblyProduct("Disable Nvidia Telemetry")]
13 | [assembly: AssemblyCopyright("Copyright © Nate Shoffner 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | //In order to begin building localizable applications, set
23 | //CultureYouAreCodingWith in your .csproj file
24 | //inside a . For example, if you are using US english
25 | //in your source files, set the to en-US. Then uncomment
26 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
27 | //the line below to match the UICulture setting in the project file.
28 |
29 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
30 |
31 |
32 | [assembly: ThemeInfo(
33 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
34 | //(used if a resource is not found in the page,
35 | // or application resource dictionaries)
36 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
37 | //(used if a resource is not found in the page,
38 | // app, or any theme specific resource dictionaries)
39 | )]
40 |
41 |
42 | // Version information for an assembly consists of the following four values:
43 | //
44 | // Major Version
45 | // Minor Version
46 | // Build Number
47 | // Revision
48 | //
49 | // You can specify all the values or you can default the Build and Revision Numbers
50 | // by using the '*' as shown below:
51 | // [assembly: AssemblyVersion("1.0.*")]
52 | [assembly: AssemblyVersion("1.2.0.0")]
53 | [assembly: AssemblyFileVersion("1.2.0.0")]
54 | [assembly: AssemblyInformationalVersion("1.2.0.0")]
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace DisableNvidiaTelemetry.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | public 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 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | public 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("DisableNvidiaTelemetry.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | public static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized string similar to About.
65 | ///
66 | public static string About {
67 | get {
68 | return ResourceManager.GetString("About", resourceCulture);
69 | }
70 | }
71 |
72 | ///
73 | /// Looks up a localized string similar to Administrator Required.
74 | ///
75 | public static string AdministratorRequired {
76 | get {
77 | return ResourceManager.GetString("AdministratorRequired", resourceCulture);
78 | }
79 | }
80 |
81 | ///
82 | /// Looks up a localized string similar to All Disabled.
83 | ///
84 | public static string All_Disabled {
85 | get {
86 | return ResourceManager.GetString("All_Disabled", resourceCulture);
87 | }
88 | }
89 |
90 | ///
91 | /// Looks up a localized string similar to Icon made by freepik from www.flaticon.com.
92 | ///
93 | public static string ApplicationCredits {
94 | get {
95 | return ResourceManager.GetString("ApplicationCredits", resourceCulture);
96 | }
97 | }
98 |
99 | ///
100 | /// Looks up a localized string similar to This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
101 | ///
102 | ///Redistribution of this software is allowed, but the origin of this software must not be misrepresented; you must not claim that you wrote the original software..
103 | ///
104 | public static string ApplicationLicense {
105 | get {
106 | return ResourceManager.GetString("ApplicationLicense", resourceCulture);
107 | }
108 | }
109 |
110 | ///
111 | /// Looks up a localized string similar to Automatic.
112 | ///
113 | public static string Automatic {
114 | get {
115 | return ResourceManager.GetString("Automatic", resourceCulture);
116 | }
117 | }
118 |
119 | ///
120 | /// Looks up a localized string similar to Automatic service startup disabled.
121 | ///
122 | public static string Automatic_service_startup_disabled {
123 | get {
124 | return ResourceManager.GetString("Automatic_service_startup_disabled", resourceCulture);
125 | }
126 | }
127 |
128 | ///
129 | /// Looks up a localized string similar to Automatic service startup enabled.
130 | ///
131 | public static string Automatic_service_startup_enabled {
132 | get {
133 | return ResourceManager.GetString("Automatic_service_startup_enabled", resourceCulture);
134 | }
135 | }
136 |
137 | ///
138 | /// Looks up a localized string similar to Automatic service startup failed.
139 | ///
140 | public static string Automatic_service_startup_failed {
141 | get {
142 | return ResourceManager.GetString("Automatic_service_startup_failed", resourceCulture);
143 | }
144 | }
145 |
146 | ///
147 | /// Looks up a localized resource of type System.Drawing.Bitmap.
148 | ///
149 | public static System.Drawing.Bitmap binoculars_256 {
150 | get {
151 | object obj = ResourceManager.GetObject("binoculars_256", resourceCulture);
152 | return ((System.Drawing.Bitmap)(obj));
153 | }
154 | }
155 |
156 | ///
157 | /// Looks up a localized resource of type System.Drawing.Bitmap.
158 | ///
159 | public static System.Drawing.Bitmap btn_donate_92x26 {
160 | get {
161 | object obj = ResourceManager.GetObject("btn_donate_92x26", resourceCulture);
162 | return ((System.Drawing.Bitmap)(obj));
163 | }
164 | }
165 |
166 | ///
167 | /// Looks up a localized string similar to Check For Updates.
168 | ///
169 | public static string Check_for_updates {
170 | get {
171 | return ResourceManager.GetString("Check_for_updates", resourceCulture);
172 | }
173 | }
174 |
175 | ///
176 | /// Looks up a localized string similar to Check for updates when program is opened.
177 | ///
178 | public static string Check_for_updates_on_startup {
179 | get {
180 | return ResourceManager.GetString("Check_for_updates_on_startup", resourceCulture);
181 | }
182 | }
183 |
184 | ///
185 | /// Looks up a localized string similar to Copy.
186 | ///
187 | public static string Copy {
188 | get {
189 | return ResourceManager.GetString("Copy", resourceCulture);
190 | }
191 | }
192 |
193 | ///
194 | /// Looks up a localized string similar to Default.
195 | ///
196 | public static string Default {
197 | get {
198 | return ResourceManager.GetString("Default", resourceCulture);
199 | }
200 | }
201 |
202 | ///
203 | /// Looks up a localized string similar to Details.
204 | ///
205 | public static string Details {
206 | get {
207 | return ResourceManager.GetString("Details", resourceCulture);
208 | }
209 | }
210 |
211 | ///
212 | /// Looks up a localized string similar to Disable Nvidia Telemetry.
213 | ///
214 | public static string Disable_Nvidia_Telemetry {
215 | get {
216 | return ResourceManager.GetString("Disable_Nvidia_Telemetry", resourceCulture);
217 | }
218 | }
219 |
220 | ///
221 | /// Looks up a localized string similar to Disable service startup failed.
222 | ///
223 | public static string Disable_service_startup_failed {
224 | get {
225 | return ResourceManager.GetString("Disable_service_startup_failed", resourceCulture);
226 | }
227 | }
228 |
229 | ///
230 | /// Looks up a localized string similar to Disabled.
231 | ///
232 | public static string Disabled {
233 | get {
234 | return ResourceManager.GetString("Disabled", resourceCulture);
235 | }
236 | }
237 |
238 | ///
239 | /// Looks up a localized string similar to Enable logging.
240 | ///
241 | public static string Enable_logging {
242 | get {
243 | return ResourceManager.GetString("Enable_logging", resourceCulture);
244 | }
245 | }
246 |
247 | ///
248 | /// Looks up a localized string similar to Enabled.
249 | ///
250 | public static string Enabled {
251 | get {
252 | return ResourceManager.GetString("Enabled", resourceCulture);
253 | }
254 | }
255 |
256 | ///
257 | /// Looks up a localized string similar to Error.
258 | ///
259 | public static string Error {
260 | get {
261 | return ResourceManager.GetString("Error", resourceCulture);
262 | }
263 | }
264 |
265 | ///
266 | /// Looks up a localized string similar to Event Log.
267 | ///
268 | public static string Event_log {
269 | get {
270 | return ResourceManager.GetString("Event_log", resourceCulture);
271 | }
272 | }
273 |
274 | ///
275 | /// Looks up a localized string similar to Failed to disable registry item.
276 | ///
277 | public static string Failed_to_disable_registry_item {
278 | get {
279 | return ResourceManager.GetString("Failed_to_disable_registry_item", resourceCulture);
280 | }
281 | }
282 |
283 | ///
284 | /// Looks up a localized string similar to Failed to disable task.
285 | ///
286 | public static string Failed_to_disable_task {
287 | get {
288 | return ResourceManager.GetString("Failed_to_disable_task", resourceCulture);
289 | }
290 | }
291 |
292 | ///
293 | /// Looks up a localized string similar to Failed to enable registry item.
294 | ///
295 | public static string Failed_to_enable_registry_item {
296 | get {
297 | return ResourceManager.GetString("Failed_to_enable_registry_item", resourceCulture);
298 | }
299 | }
300 |
301 | ///
302 | /// Looks up a localized string similar to Failed to enable task.
303 | ///
304 | public static string Failed_to_enable_task {
305 | get {
306 | return ResourceManager.GetString("Failed_to_enable_task", resourceCulture);
307 | }
308 | }
309 |
310 | ///
311 | /// Looks up a localized string similar to Failed to find registry item.
312 | ///
313 | public static string Failed_to_find_registry_item {
314 | get {
315 | return ResourceManager.GetString("Failed_to_find_registry_item", resourceCulture);
316 | }
317 | }
318 |
319 | ///
320 | /// Looks up a localized string similar to Failed to find service.
321 | ///
322 | public static string Failed_to_find_service {
323 | get {
324 | return ResourceManager.GetString("Failed_to_find_service", resourceCulture);
325 | }
326 | }
327 |
328 | ///
329 | /// Looks up a localized string similar to Failed to find task.
330 | ///
331 | public static string Failed_to_find_task {
332 | get {
333 | return ResourceManager.GetString("Failed_to_find_task", resourceCulture);
334 | }
335 | }
336 |
337 | ///
338 | /// Looks up a localized string similar to Failed to start service.
339 | ///
340 | public static string Failed_to_start_service {
341 | get {
342 | return ResourceManager.GetString("Failed_to_start_service", resourceCulture);
343 | }
344 | }
345 |
346 | ///
347 | /// Looks up a localized string similar to Failed to stop service.
348 | ///
349 | public static string Failed_to_stop_service {
350 | get {
351 | return ResourceManager.GetString("Failed_to_stop_service", resourceCulture);
352 | }
353 | }
354 |
355 | ///
356 | /// Looks up a localized string similar to Found registry item.
357 | ///
358 | public static string Found_registry_item {
359 | get {
360 | return ResourceManager.GetString("Found_registry_item", resourceCulture);
361 | }
362 | }
363 |
364 | ///
365 | /// Looks up a localized string similar to Found service.
366 | ///
367 | public static string Found_service {
368 | get {
369 | return ResourceManager.GetString("Found_service", resourceCulture);
370 | }
371 | }
372 |
373 | ///
374 | /// Looks up a localized string similar to Found task.
375 | ///
376 | public static string Found_task {
377 | get {
378 | return ResourceManager.GetString("Found_task", resourceCulture);
379 | }
380 | }
381 |
382 | ///
383 | /// Looks up a localized resource of type System.Drawing.Bitmap.
384 | ///
385 | public static System.Drawing.Bitmap GitHub_Mark_Light_120px_plus {
386 | get {
387 | object obj = ResourceManager.GetObject("GitHub_Mark_Light_120px_plus", resourceCulture);
388 | return ((System.Drawing.Bitmap)(obj));
389 | }
390 | }
391 |
392 | ///
393 | /// Looks up a localized string similar to https://github.com/NateShoffner/Disable-Nvidia-Telemetry.
394 | ///
395 | public static string GithubUrl {
396 | get {
397 | return ResourceManager.GetString("GithubUrl", resourceCulture);
398 | }
399 | }
400 |
401 | ///
402 | /// Looks up a localized string similar to https://nateshoffner.com.
403 | ///
404 | public static string Homepage {
405 | get {
406 | return ResourceManager.GetString("Homepage", resourceCulture);
407 | }
408 | }
409 |
410 | ///
411 | /// Looks up a localized resource of type System.Drawing.Bitmap.
412 | ///
413 | public static System.Drawing.Bitmap honeycomb_dark {
414 | get {
415 | object obj = ResourceManager.GetObject("honeycomb_dark", resourceCulture);
416 | return ((System.Drawing.Bitmap)(obj));
417 | }
418 | }
419 |
420 | ///
421 | /// Looks up a localized resource of type System.Drawing.Bitmap.
422 | ///
423 | public static System.Drawing.Bitmap honeycomb_gray {
424 | get {
425 | object obj = ResourceManager.GetObject("honeycomb_gray", resourceCulture);
426 | return ((System.Drawing.Bitmap)(obj));
427 | }
428 | }
429 |
430 | ///
431 | /// Looks up a localized string similar to Logging disabled on read-only device.
432 | ///
433 | public static string Logging_disabled_on_read_only_device {
434 | get {
435 | return ResourceManager.GetString("Logging_disabled_on_read_only_device", resourceCulture);
436 | }
437 | }
438 |
439 | ///
440 | /// Looks up a localized string similar to Manual.
441 | ///
442 | public static string Manual {
443 | get {
444 | return ResourceManager.GetString("Manual", resourceCulture);
445 | }
446 | }
447 |
448 | ///
449 | /// Looks up a localized string similar to No Updates.
450 | ///
451 | public static string No_Updates {
452 | get {
453 | return ResourceManager.GetString("No_Updates", resourceCulture);
454 | }
455 | }
456 |
457 | ///
458 | /// Looks up a localized string similar to There are no updates available..
459 | ///
460 | public static string No_updates_available_message {
461 | get {
462 | return ResourceManager.GetString("No_updates_available_message", resourceCulture);
463 | }
464 | }
465 |
466 | ///
467 | /// Looks up a localized string similar to Open GeForce Experience.
468 | ///
469 | public static string Open_geforce_experience {
470 | get {
471 | return ResourceManager.GetString("Open_geforce_experience", resourceCulture);
472 | }
473 | }
474 |
475 | ///
476 | /// Looks up a localized string similar to https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=nate.shoffner@gmail.com&lc=US&item_name=Disable%20Nvidia%20Telemetry¤cy_code=USD&bn=PP%2dDonationsBF.
477 | ///
478 | public static string PaypalUrl {
479 | get {
480 | return ResourceManager.GetString("PaypalUrl", resourceCulture);
481 | }
482 | }
483 |
484 | ///
485 | /// Looks up a localized string similar to Please run the program as administrator to continue..
486 | ///
487 | public static string Please_run_the_program_as_administrator_to_continue {
488 | get {
489 | return ResourceManager.GetString("Please_run_the_program_as_administrator_to_continue", resourceCulture);
490 | }
491 | }
492 |
493 | ///
494 | /// Looks up a localized string similar to Portable.
495 | ///
496 | public static string Portable {
497 | get {
498 | return ResourceManager.GetString("Portable", resourceCulture);
499 | }
500 | }
501 |
502 | ///
503 | /// Looks up a localized string similar to Refresh.
504 | ///
505 | public static string Refresh {
506 | get {
507 | return ResourceManager.GetString("Refresh", resourceCulture);
508 | }
509 | }
510 |
511 | ///
512 | /// Looks up a localized string similar to Registry item disabled.
513 | ///
514 | public static string Registry_item_disabled {
515 | get {
516 | return ResourceManager.GetString("Registry_item_disabled", resourceCulture);
517 | }
518 | }
519 |
520 | ///
521 | /// Looks up a localized string similar to Registry item enabled.
522 | ///
523 | public static string Registry_item_enabled {
524 | get {
525 | return ResourceManager.GetString("Registry_item_enabled", resourceCulture);
526 | }
527 | }
528 |
529 | ///
530 | /// Looks up a localized string similar to Registry item is.
531 | ///
532 | public static string Registry_item_is {
533 | get {
534 | return ResourceManager.GetString("Registry_item_is", resourceCulture);
535 | }
536 | }
537 |
538 | ///
539 | /// Looks up a localized string similar to Restart Later.
540 | ///
541 | public static string Restart_later {
542 | get {
543 | return ResourceManager.GetString("Restart_later", resourceCulture);
544 | }
545 | }
546 |
547 | ///
548 | /// Looks up a localized string similar to Restart Now.
549 | ///
550 | public static string Restart_now {
551 | get {
552 | return ResourceManager.GetString("Restart_now", resourceCulture);
553 | }
554 | }
555 |
556 | ///
557 | /// Looks up a localized string similar to A Windows restart is required in order for this change to take effect..
558 | ///
559 | public static string Restart_required_message {
560 | get {
561 | return ResourceManager.GetString("Restart_required_message", resourceCulture);
562 | }
563 | }
564 |
565 | ///
566 | /// Looks up a localized string similar to Restart Required.
567 | ///
568 | public static string Restart_requried {
569 | get {
570 | return ResourceManager.GetString("Restart_requried", resourceCulture);
571 | }
572 | }
573 |
574 | ///
575 | /// Looks up a localized string similar to Run in background and disable Nvidia telemetry services and tasks:.
576 | ///
577 | public static string Run_in_background {
578 | get {
579 | return ResourceManager.GetString("Run_in_background", resourceCulture);
580 | }
581 | }
582 |
583 | ///
584 | /// Looks up a localized string similar to Service.
585 | ///
586 | public static string Service {
587 | get {
588 | return ResourceManager.GetString("Service", resourceCulture);
589 | }
590 | }
591 |
592 | ///
593 | /// Looks up a localized string similar to Service is.
594 | ///
595 | public static string Service_is {
596 | get {
597 | return ResourceManager.GetString("Service_is", resourceCulture);
598 | }
599 | }
600 |
601 | ///
602 | /// Looks up a localized string similar to Service started.
603 | ///
604 | public static string Service_started {
605 | get {
606 | return ResourceManager.GetString("Service_started", resourceCulture);
607 | }
608 | }
609 |
610 | ///
611 | /// Looks up a localized string similar to Service startup mode.
612 | ///
613 | public static string Service_startup_mode {
614 | get {
615 | return ResourceManager.GetString("Service_startup_mode", resourceCulture);
616 | }
617 | }
618 |
619 | ///
620 | /// Looks up a localized string similar to Service stopped.
621 | ///
622 | public static string Service_stopped {
623 | get {
624 | return ResourceManager.GetString("Service_stopped", resourceCulture);
625 | }
626 | }
627 |
628 | ///
629 | /// Looks up a localized string similar to Settings.
630 | ///
631 | public static string Settings {
632 | get {
633 | return ResourceManager.GetString("Settings", resourceCulture);
634 | }
635 | }
636 |
637 | ///
638 | /// Looks up a localized string similar to Silently disabling telemetry registry items.
639 | ///
640 | public static string Silently_disabling_telemetry_registry_items {
641 | get {
642 | return ResourceManager.GetString("Silently_disabling_telemetry_registry_items", resourceCulture);
643 | }
644 | }
645 |
646 | ///
647 | /// Looks up a localized string similar to Silently disabling telemetry services.
648 | ///
649 | public static string Silently_disabling_telemetry_services {
650 | get {
651 | return ResourceManager.GetString("Silently_disabling_telemetry_services", resourceCulture);
652 | }
653 | }
654 |
655 | ///
656 | /// Looks up a localized string similar to Silently disabling telemetry tasks.
657 | ///
658 | public static string Silently_disabling_telemetry_tasks {
659 | get {
660 | return ResourceManager.GetString("Silently_disabling_telemetry_tasks", resourceCulture);
661 | }
662 | }
663 |
664 | ///
665 | /// Looks up a localized string similar to https://www.youtube.com/watch?v=cmkpISz6RvA.
666 | ///
667 | public static string String {
668 | get {
669 | return ResourceManager.GetString("String", resourceCulture);
670 | }
671 | }
672 |
673 | ///
674 | /// Looks up a localized string similar to Task.
675 | ///
676 | public static string Task {
677 | get {
678 | return ResourceManager.GetString("Task", resourceCulture);
679 | }
680 | }
681 |
682 | ///
683 | /// Looks up a localized string similar to Task disabled.
684 | ///
685 | public static string Task_disabled {
686 | get {
687 | return ResourceManager.GetString("Task_disabled", resourceCulture);
688 | }
689 | }
690 |
691 | ///
692 | /// Looks up a localized string similar to Task enabled.
693 | ///
694 | public static string Task_enabled {
695 | get {
696 | return ResourceManager.GetString("Task_enabled", resourceCulture);
697 | }
698 | }
699 |
700 | ///
701 | /// Looks up a localized string similar to Task is.
702 | ///
703 | public static string Task_is {
704 | get {
705 | return ResourceManager.GetString("Task_is", resourceCulture);
706 | }
707 | }
708 |
709 | ///
710 | /// Looks up a localized string similar to Disables Nvidia telemetry services and tasks on startup..
711 | ///
712 | public static string Task_scheduler_description {
713 | get {
714 | return ResourceManager.GetString("Task_scheduler_description", resourceCulture);
715 | }
716 | }
717 |
718 | ///
719 | /// Looks up a localized string similar to Disable Nvidia Telemetry.
720 | ///
721 | public static string Task_scheduler_name {
722 | get {
723 | return ResourceManager.GetString("Task_scheduler_name", resourceCulture);
724 | }
725 | }
726 |
727 | ///
728 | /// Looks up a localized string similar to Telemetry.
729 | ///
730 | public static string Telemetry {
731 | get {
732 | return ResourceManager.GetString("Telemetry", resourceCulture);
733 | }
734 | }
735 |
736 | ///
737 | /// Looks up a localized string similar to No telemetry items found for this category.
738 | ///
739 | public static string Telemetry_placeholder {
740 | get {
741 | return ResourceManager.GetString("Telemetry_placeholder", resourceCulture);
742 | }
743 | }
744 |
745 | ///
746 | /// Looks up a localized string similar to Telemetry Registry Items.
747 | ///
748 | public static string Telemetry_registry_items {
749 | get {
750 | return ResourceManager.GetString("Telemetry_registry_items", resourceCulture);
751 | }
752 | }
753 |
754 | ///
755 | /// Looks up a localized string similar to Telemetry Services.
756 | ///
757 | public static string Telemetry_services {
758 | get {
759 | return ResourceManager.GetString("Telemetry_services", resourceCulture);
760 | }
761 | }
762 |
763 | ///
764 | /// Looks up a localized string similar to Telemetry Tasks.
765 | ///
766 | public static string Telemetry_tasks {
767 | get {
768 | return ResourceManager.GetString("Telemetry_tasks", resourceCulture);
769 | }
770 | }
771 |
772 | ///
773 | /// Looks up a localized string similar to Time.
774 | ///
775 | public static string Time {
776 | get {
777 | return ResourceManager.GetString("Time", resourceCulture);
778 | }
779 | }
780 |
781 | ///
782 | /// Looks up a localized string similar to Update Available.
783 | ///
784 | public static string Update_available {
785 | get {
786 | return ResourceManager.GetString("Update_available", resourceCulture);
787 | }
788 | }
789 |
790 | ///
791 | /// Looks up a localized string similar to A new update is available, would you like to download it?.
792 | ///
793 | public static string Update_available_message {
794 | get {
795 | return ResourceManager.GetString("Update_available_message", resourceCulture);
796 | }
797 | }
798 |
799 | ///
800 | /// Looks up a localized string similar to Update Error.
801 | ///
802 | public static string Update_error {
803 | get {
804 | return ResourceManager.GetString("Update_error", resourceCulture);
805 | }
806 | }
807 |
808 | ///
809 | /// Looks up a localized string similar to There was an error while checking for updates..
810 | ///
811 | public static string Update_error_messsage {
812 | get {
813 | return ResourceManager.GetString("Update_error_messsage", resourceCulture);
814 | }
815 | }
816 |
817 | ///
818 | /// Looks up a localized string similar to Updates.
819 | ///
820 | public static string Updates {
821 | get {
822 | return ResourceManager.GetString("Updates", resourceCulture);
823 | }
824 | }
825 |
826 | ///
827 | /// Looks up a localized string similar to Version.
828 | ///
829 | public static string Version {
830 | get {
831 | return ResourceManager.GetString("Version", resourceCulture);
832 | }
833 | }
834 |
835 | ///
836 | /// Looks up a localized string similar to View on GitHub.
837 | ///
838 | public static string View_on_github {
839 | get {
840 | return ResourceManager.GetString("View_on_github", resourceCulture);
841 | }
842 | }
843 | }
844 | }
845 |
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | Administrator Required
122 |
123 |
124 | All Disabled
125 |
126 |
127 | Icon made by freepik from www.flaticon.com
128 |
129 |
130 | This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
131 |
132 | Redistribution of this software is allowed, but the origin of this software must not be misrepresented; you must not claim that you wrote the original software.
133 |
134 |
135 | Automatic
136 |
137 |
138 | Automatic service startup disabled
139 |
140 |
141 | Automatic service startup enabled
142 |
143 |
144 | Automatic service startup failed
145 |
146 |
147 |
148 | ..\Resources\btn_donate_92x26.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
149 |
150 |
151 | Disabled
152 |
153 |
154 | Disable Nvidia Telemetry
155 |
156 |
157 | Disable service startup failed
158 |
159 |
160 | Enabled
161 |
162 |
163 | Failed to disable registry item
164 |
165 |
166 | Failed to disable task
167 |
168 |
169 | Failed to enable registry item
170 |
171 |
172 | Failed to enable task
173 |
174 |
175 | Failed to find registry item
176 |
177 |
178 | Failed to find service
179 |
180 |
181 | Failed to find task
182 |
183 |
184 | Failed to start service
185 |
186 |
187 | Failed to stop service
188 |
189 |
190 | Found registry item
191 |
192 |
193 | Found service
194 |
195 |
196 | Found task
197 |
198 |
199 | https://github.com/NateShoffner/Disable-Nvidia-Telemetry
200 |
201 |
202 | https://nateshoffner.com
203 |
204 |
205 | Logging disabled on read-only device
206 |
207 |
208 | Manual
209 |
210 |
211 | No Updates
212 |
213 |
214 | There are no updates available.
215 |
216 |
217 | https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=nate.shoffner@gmail.com&lc=US&item_name=Disable%20Nvidia%20Telemetry¤cy_code=USD&bn=PP%2dDonationsBF
218 |
219 |
220 | Please run the program as administrator to continue.
221 |
222 |
223 | Registry item disabled
224 |
225 |
226 | Registry item enabled
227 |
228 |
229 | Registry item is
230 |
231 |
232 | Service
233 |
234 |
235 | Service is
236 |
237 |
238 | Service started
239 |
240 |
241 | Service startup mode
242 |
243 |
244 | Service stopped
245 |
246 |
247 | Silently disabling telemetry registry items
248 |
249 |
250 | Silently disabling telemetry services
251 |
252 |
253 | Silently disabling telemetry tasks
254 |
255 |
256 | Task
257 |
258 |
259 | Task disabled
260 |
261 |
262 | Task enabled
263 |
264 |
265 | Task is
266 |
267 |
268 | Disables Nvidia telemetry services and tasks on startup.
269 |
270 |
271 | Disable Nvidia Telemetry
272 |
273 |
274 | Telemetry Registry Items
275 |
276 |
277 | Telemetry Services
278 |
279 |
280 | Telemetry Tasks
281 |
282 |
283 | Update Available
284 |
285 |
286 | A new update is available, would you like to download it?
287 |
288 |
289 | Update Error
290 |
291 |
292 | There was an error while checking for updates.
293 |
294 |
295 | Version
296 |
297 |
298 | ..\Resources\binoculars-256.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
299 |
300 |
301 | ..\Resources\GitHub-Mark-Light-120px-plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
302 |
303 |
304 | ..\Resources\honeycomb-dark.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
305 |
306 |
307 | ..\Resources\honeycomb-gray.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
308 |
309 |
310 | https://www.youtube.com/watch?v=cmkpISz6RvA
311 |
312 |
313 | Portable
314 |
315 |
316 | Error
317 |
318 |
319 | Updates
320 |
321 |
322 | Check for updates when program is opened
323 |
324 |
325 | Enable logging
326 |
327 |
328 | Restart Later
329 |
330 |
331 | Restart Now
332 |
333 |
334 | A Windows restart is required in order for this change to take effect.
335 |
336 |
337 | Restart Required
338 |
339 |
340 | Run in background and disable Nvidia telemetry services and tasks:
341 |
342 |
343 | About
344 |
345 |
346 | Check For Updates
347 |
348 |
349 | Copy
350 |
351 |
352 | Default
353 |
354 |
355 | Details
356 |
357 |
358 | Event Log
359 |
360 |
361 | Open GeForce Experience
362 |
363 |
364 | Refresh
365 |
366 |
367 | Settings
368 |
369 |
370 | Telemetry
371 |
372 |
373 | No telemetry items found for this category
374 |
375 |
376 | Time
377 |
378 |
379 | View on GitHub
380 |
381 |
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace DisableNvidiaTelemetry.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.0.1.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 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
29 | public bool StartupUpdate {
30 | get {
31 | return ((bool)(this["StartupUpdate"]));
32 | }
33 | set {
34 | this["StartupUpdate"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
41 | public int BackgroundTaskTrigger {
42 | get {
43 | return ((int)(this["BackgroundTaskTrigger"]));
44 | }
45 | set {
46 | this["BackgroundTaskTrigger"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("True")]
53 | public bool FileLogging {
54 | get {
55 | return ((bool)(this["FileLogging"]));
56 | }
57 | set {
58 | this["FileLogging"] = value;
59 | }
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 | True
9 |
10 |
11 | 0
12 |
13 |
14 | True
15 |
16 |
17 |
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Resources/GitHub-Mark-Light-120px-plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateShoffner/Disable-Nvidia-Telemetry/f5434902eddec792043180d1a7f9e5f78aed1335/DisableNvidiaTelemetry/Resources/GitHub-Mark-Light-120px-plus.png
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Resources/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateShoffner/Disable-Nvidia-Telemetry/f5434902eddec792043180d1a7f9e5f78aed1335/DisableNvidiaTelemetry/Resources/bg.png
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Resources/binoculars-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateShoffner/Disable-Nvidia-Telemetry/f5434902eddec792043180d1a7f9e5f78aed1335/DisableNvidiaTelemetry/Resources/binoculars-256.png
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Resources/btn_donate_92x26.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateShoffner/Disable-Nvidia-Telemetry/f5434902eddec792043180d1a7f9e5f78aed1335/DisableNvidiaTelemetry/Resources/btn_donate_92x26.png
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Resources/honeycomb-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateShoffner/Disable-Nvidia-Telemetry/f5434902eddec792043180d1a7f9e5f78aed1335/DisableNvidiaTelemetry/Resources/honeycomb-dark.png
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Resources/honeycomb-gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NateShoffner/Disable-Nvidia-Telemetry/f5434902eddec792043180d1a7f9e5f78aed1335/DisableNvidiaTelemetry/Resources/honeycomb-gray.png
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/SwitchCheckbox.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using DisableNvidiaTelemetry.Properties;
3 |
4 | namespace DisableNvidiaTelemetry
5 | {
6 | internal class SwitchCheckbox
7 | {
8 | public static readonly DependencyProperty EnabledTextProperty =
9 | DependencyProperty.RegisterAttached("EnabledText", typeof(string), typeof(SwitchCheckbox), new PropertyMetadata(Resources.Enabled));
10 |
11 | public static readonly DependencyProperty DisabledTextProperty =
12 | DependencyProperty.RegisterAttached("DisabledText", typeof(string), typeof(SwitchCheckbox), new PropertyMetadata(Resources.Disabled));
13 |
14 | public static void SetEnabledText(UIElement element, string value)
15 | {
16 | element.SetValue(EnabledTextProperty, value);
17 | }
18 |
19 | public static string GetEnabledText(UIElement element)
20 | {
21 | return (string) element.GetValue(EnabledTextProperty);
22 | }
23 |
24 | public static void SetDisabledText(UIElement element, string value)
25 | {
26 | element.SetValue(DisabledTextProperty, value);
27 | }
28 |
29 | public static string GetDisabledText(UIElement element)
30 | {
31 | return (string) element.GetValue(DisabledTextProperty);
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Utilities/AppUtils.cs:
--------------------------------------------------------------------------------
1 | using System.Configuration;
2 | using System.Linq;
3 | using System.Reflection;
4 | using System.Security.Principal;
5 | using DisableNvidiaTelemetry.Properties;
6 |
7 | namespace DisableNvidiaTelemetry.Utilities
8 | {
9 | public class AppUtils
10 | {
11 | public const string StartupParamSilent = "-silent";
12 | public const string StartupParamRegisterTask = "-registertask";
13 | public const string StartupParamUnregisterTask = "-unregistertask";
14 |
15 |
16 | public static ExtendedVersion.ExtendedVersion GetVersion()
17 | {
18 | var attribute =
19 | (AssemblyInformationalVersionAttribute) Assembly.GetExecutingAssembly()
20 | .GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false).FirstOrDefault();
21 | var version = new ExtendedVersion.ExtendedVersion(attribute.InformationalVersion);
22 |
23 | return version;
24 | }
25 |
26 | public static void InitializeSettings()
27 | {
28 | Settings.Default.Upgrade();
29 | var provider = new PortableSettingsProvider();
30 | Settings.Default.Providers.Add(provider);
31 | foreach (SettingsProperty property in Settings.Default.Properties)
32 | {
33 | property.Provider = provider;
34 | }
35 | }
36 |
37 | public static bool IsAdministrator()
38 | {
39 | return new WindowsPrincipal(WindowsIdentity.GetCurrent())
40 | .IsInRole(WindowsBuiltInRole.Administrator);
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Utilities/GeforceUtilities.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using Microsoft.Win32;
4 |
5 | namespace DisableNvidiaTelemetry.Utilities
6 | {
7 | internal class GeforceUtilities
8 | {
9 | public static string GetGeforceExperiencePath()
10 | {
11 | using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
12 |
13 | using (var key = hklm.OpenSubKey(@"SOFTWARE\NVIDIA Corporation\Global\GFExperience"))
14 | {
15 | if (key != null)
16 | {
17 | var path = key.GetValue("FullPath");
18 |
19 | if (path != null)
20 | return path.ToString();
21 | }
22 | }
23 |
24 | return null;
25 | }
26 |
27 | public static ExtendedVersion.ExtendedVersion GetGeForceExperienceVersion()
28 | {
29 | return GetApplicationVersion("NVIDIA GeForce Experience");
30 | }
31 |
32 | public static ExtendedVersion.ExtendedVersion GetDriverVersion()
33 | {
34 | return GetApplicationVersion("NVIDIA Graphics Driver");
35 | }
36 |
37 | private static ExtendedVersion.ExtendedVersion GetApplicationVersion(string displayNamePrefix)
38 | {
39 | using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
40 |
41 | using (var key = hklm.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"))
42 | {
43 | foreach (var subkey_name in key.GetSubKeyNames())
44 | {
45 | using (var subkey = key.OpenSubKey(subkey_name))
46 | {
47 | var name = subkey.GetValue("DisplayName");
48 |
49 | if (name != null)
50 | {
51 | var nameStr = name.ToString();
52 |
53 | if (!string.IsNullOrEmpty(nameStr))
54 | if (nameStr.IndexOf(displayNamePrefix, StringComparison.InvariantCultureIgnoreCase) >= 0)
55 | {
56 | var split = nameStr.Split(' ');
57 | var versionStr = split.Last();
58 |
59 | return new ExtendedVersion.ExtendedVersion(versionStr);
60 | }
61 | }
62 | }
63 | }
64 | }
65 |
66 | return null;
67 | }
68 | }
69 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Utilities/Logging.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using DisableNvidiaTelemetry.Properties;
4 | using log4net;
5 | using log4net.Config;
6 | using log4net.Core;
7 |
8 | namespace DisableNvidiaTelemetry.Utilities
9 | {
10 | internal static class LogExtensions
11 | {
12 | public static event EventHandler LogEvent;
13 |
14 | public static void Log(this ILog log, Level level, object message, Exception ex = null, bool suppressEvents = false)
15 | {
16 | if (Logging.IsReadOnly)
17 | return;
18 |
19 | if (level == Level.Debug)
20 | log.Debug(message, ex);
21 | else if (level == Level.Error)
22 | if (ex == null)
23 | log.Error(message);
24 | else
25 | log.Error(message, ex);
26 | else if (level == Level.Info)
27 | log.Info(message);
28 | else if (level == Level.Warn)
29 | log.Warn(message, ex);
30 | else
31 | throw new ArgumentException("Log level not implemented", "level");
32 |
33 | if (!suppressEvents)
34 | LogEvent?.Invoke(log, new LogEventArgs(log, new Logging.LogEvent {Date = DateTime.Now, Message = message, Error = ex}));
35 | }
36 |
37 | public class LogEventArgs : EventArgs
38 | {
39 | public LogEventArgs(ILog log, Logging.LogEvent @event)
40 | {
41 | Log = log;
42 | Event = @event;
43 | }
44 |
45 | public ILog Log { get; }
46 |
47 | public Logging.LogEvent Event { get; set; }
48 | }
49 | }
50 |
51 | internal class Logging
52 | {
53 | private static ILog _fileLogger;
54 | private static ILog _eventLogger;
55 |
56 | private static string _logDirectory;
57 | private static bool _enabled;
58 | private static bool _configured;
59 |
60 | private static bool? _isReadOnly;
61 |
62 | public static bool IsReadOnly
63 | {
64 | get
65 | {
66 | if (!_isReadOnly.HasValue)
67 | {
68 | var cwd = Path.GetDirectoryName(_logDirectory);
69 |
70 | var di = new DirectoryInfo(cwd);
71 | _isReadOnly = di.Attributes.HasFlag(FileAttributes.ReadOnly);
72 | }
73 |
74 | return _isReadOnly.Value;
75 | }
76 | }
77 |
78 | public static bool Enabled
79 | {
80 | get => _enabled;
81 | set
82 | {
83 | if (value)
84 | {
85 | if (!_configured)
86 | {
87 | if (!Directory.Exists(_logDirectory))
88 | Directory.CreateDirectory(_logDirectory);
89 |
90 | GlobalContext.Properties["HeaderInfo"] = $"{Resources.Disable_Nvidia_Telemetry} v{AppUtils.GetVersion()}";
91 | GlobalContext.Properties["LogDirectory"] = _logDirectory;
92 |
93 | XmlConfigurator.Configure();
94 |
95 | _configured = true;
96 | }
97 |
98 | LogManager.GetRepository().Threshold = Level.All;
99 | }
100 |
101 | else
102 | {
103 | LogManager.GetRepository().Threshold = Level.Off;
104 | }
105 |
106 |
107 | _enabled = value;
108 | }
109 | }
110 |
111 | public static void Prepare(string logDirectory)
112 | {
113 | _logDirectory = logDirectory;
114 | }
115 |
116 | public static ILog GetFileLogger()
117 | {
118 | return _fileLogger ?? (_fileLogger = LogManager.GetLogger("FileLogger"));
119 | }
120 |
121 | public static ILog GetEventLogger()
122 | {
123 | return _eventLogger ?? (_eventLogger = LogManager.GetLogger("EventLogger"));
124 | }
125 |
126 | public class LogEvent
127 | {
128 | public DateTime Date { get; set; }
129 |
130 | public object Message { get; set; }
131 |
132 | public Exception Error { get; set; }
133 | }
134 | }
135 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Utilities/ServiceHelper.cs:
--------------------------------------------------------------------------------
1 | #region
2 |
3 | using System;
4 | using System.ComponentModel;
5 | using System.Runtime.InteropServices;
6 | using System.ServiceProcess;
7 |
8 | #endregion
9 |
10 | namespace DisableNvidiaTelemetry.Utilities
11 | {
12 | public static class ServiceHelper
13 | {
14 | private const uint SERVICE_NO_CHANGE = 0xFFFFFFFF;
15 | private const uint SERVICE_QUERY_CONFIG = 0x00000001;
16 | private const uint SERVICE_CHANGE_CONFIG = 0x00000002;
17 | private const uint SC_MANAGER_ALL_ACCESS = 0x000F003F;
18 |
19 | private const int ERROR_INSUFFICIENT_BUFFER = 122;
20 |
21 | [DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
22 | public static extern bool ChangeServiceConfig(
23 | IntPtr hService,
24 | uint nServiceType,
25 | uint nStartType,
26 | uint nErrorControl,
27 | string lpBinaryPathName,
28 | string lpLoadOrderGroup,
29 | IntPtr lpdwTagId,
30 | [In] char[] lpDependencies,
31 | string lpServiceStartName,
32 | string lpPassword,
33 | string lpDisplayName);
34 |
35 | [DllImport("advapi32.dll", EntryPoint = "QueryServiceConfigW", CharSet = CharSet.Auto, SetLastError = true)]
36 | private static extern bool QueryServiceConfig(SafeHandle hService, IntPtr lpServiceConfig, int cbBufSize, out int pcbBytesNeeded);
37 |
38 | [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
39 | private static extern IntPtr OpenService(IntPtr hSCManager, string lpServiceName, uint dwDesiredAccess);
40 |
41 | [DllImport("advapi32.dll", EntryPoint = "OpenSCManagerW", ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)]
42 | public static extern IntPtr OpenSCManager(string machineName, string databaseName, uint dwAccess);
43 |
44 | [DllImport("advapi32.dll", EntryPoint = "CloseServiceHandle")]
45 | public static extern int CloseServiceHandle(IntPtr hSCObject);
46 |
47 | public static void ChangeStartMode(ServiceController svc, ServiceStartMode mode)
48 | {
49 | var scManagerHandle = OpenSCManager(null, null, SC_MANAGER_ALL_ACCESS);
50 | if (scManagerHandle == IntPtr.Zero)
51 | throw new ExternalException("Open Service Manager Error");
52 |
53 | var serviceHandle = OpenService(scManagerHandle, svc.ServiceName, SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG);
54 |
55 | if (serviceHandle == IntPtr.Zero)
56 | throw new ExternalException("Open Service Error");
57 |
58 | var result = ChangeServiceConfig(
59 | serviceHandle,
60 | SERVICE_NO_CHANGE,
61 | (uint) mode,
62 | SERVICE_NO_CHANGE,
63 | null,
64 | null,
65 | IntPtr.Zero,
66 | null,
67 | null,
68 | null,
69 | null);
70 |
71 | if (result == false)
72 | {
73 | var nError = Marshal.GetLastWin32Error();
74 | var win32Exception = new Win32Exception(nError);
75 | throw new ExternalException($"Could not change service start type: {win32Exception.Message}");
76 | }
77 |
78 | CloseServiceHandle(serviceHandle);
79 | CloseServiceHandle(scManagerHandle);
80 | }
81 |
82 | internal static ServiceStartMode GetServiceStartMode(ServiceController svc)
83 | {
84 | var neededBytes = 0;
85 |
86 | var result = QueryServiceConfig(svc.ServiceHandle, IntPtr.Zero, 0, out neededBytes);
87 | var win32err = Marshal.GetLastWin32Error();
88 | if (win32err == ERROR_INSUFFICIENT_BUFFER) //122
89 | {
90 | var ptr = IntPtr.Zero;
91 | try
92 | {
93 | ptr = Marshal.AllocCoTaskMem(neededBytes);
94 | result = QueryServiceConfig(svc.ServiceHandle, ptr, neededBytes, out neededBytes);
95 | if (result)
96 | {
97 | var config = (QUERY_SERVICE_CONFIG) Marshal.PtrToStructure(ptr, typeof(QUERY_SERVICE_CONFIG));
98 | return config.dwStartType;
99 | }
100 | else
101 | {
102 | win32err = Marshal.GetLastWin32Error();
103 | throw new Win32Exception(win32err, "QueryServiceConfig failed");
104 | }
105 | }
106 | finally
107 | {
108 | Marshal.FreeCoTaskMem(ptr);
109 | }
110 | }
111 | throw new Win32Exception(win32err, "QueryServiceConfig failed");
112 | }
113 |
114 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
115 | private struct QUERY_SERVICE_CONFIG
116 | {
117 | [MarshalAs(UnmanagedType.U4)] private readonly ServiceType dwServiceType;
118 | [MarshalAs(UnmanagedType.U4)] internal readonly ServiceStartMode dwStartType;
119 | private readonly int dwErrorControl;
120 | [MarshalAs(UnmanagedType.LPWStr)] private readonly string lpBinaryPathName;
121 | [MarshalAs(UnmanagedType.LPWStr)] private readonly string lpLoadOrderGroup;
122 | private readonly int dwTagId;
123 | [MarshalAs(UnmanagedType.LPWStr)] private readonly string lpDependencies;
124 | [MarshalAs(UnmanagedType.LPWStr)] private readonly string lpServiceStartName;
125 | [MarshalAs(UnmanagedType.LPWStr)] private readonly string lpDisplayName;
126 | }
127 | }
128 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Utilities/TaskSchedulerUtilities.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using System.Security.Principal;
4 | using DisableNvidiaTelemetry.Properties;
5 | using Microsoft.Win32.TaskScheduler;
6 |
7 | namespace DisableNvidiaTelemetry.Utilities
8 | {
9 | internal class TaskSchedulerUtilities
10 | {
11 | public enum TaskTrigger
12 | {
13 | WindowsLogin = 0,
14 | Daily = 1
15 | }
16 |
17 | public static Task GetTask()
18 | {
19 | return TaskService.Instance.FindTask(Resources.Disable_Nvidia_Telemetry);
20 | }
21 |
22 | public static void Create(TaskTrigger trigger)
23 | {
24 | var user = WindowsIdentity.GetCurrent().Name;
25 |
26 | using (var ts = new TaskService())
27 | {
28 | var td = ts.NewTask();
29 | td.RegistrationInfo.Description = Resources.Task_scheduler_description;
30 | td.Principal.UserId = user;
31 | td.Principal.LogonType = TaskLogonType.InteractiveToken;
32 | td.Principal.RunLevel = TaskRunLevel.Highest;
33 | if (trigger == TaskTrigger.WindowsLogin)
34 | td.Triggers.Add(new LogonTrigger());
35 | if (trigger == TaskTrigger.Daily)
36 | {
37 | var now = DateTime.Today;
38 | var startDateTime = new DateTime(now.Year, now.Month, now.Day, 12, 0, 0);
39 | var dt = new DailyTrigger
40 | {
41 | StartBoundary = startDateTime,
42 | Enabled = true,
43 | DaysInterval = 1,
44 | Repetition = {Interval = TimeSpan.FromHours(24)}
45 | };
46 |
47 | td.Triggers.Add(dt);
48 | }
49 | td.Actions.Add(new ExecAction(Assembly.GetExecutingAssembly().Location, AppUtils.StartupParamSilent));
50 | ts.RootFolder.RegisterTaskDefinition(Resources.Disable_Nvidia_Telemetry, td);
51 | }
52 | }
53 |
54 | public static void Remove()
55 | {
56 | using (var ts = new TaskService())
57 | {
58 | ts.RootFolder.DeleteTask(Resources.Disable_Nvidia_Telemetry, false);
59 | }
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Utilities/UpdaterUtilities.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using Newtonsoft.Json.Linq;
4 |
5 | namespace DisableNvidiaTelemetry.Utilities
6 | {
7 | internal class UpdaterUtilities
8 | {
9 | public static event EventHandler UpdateResponse;
10 |
11 | public static void UpdateCheck(object userToken)
12 | {
13 | var releasesUrl = new Uri("https://api.github.com/repos/NateShoffner/Disable-Nvidia-Telemetry/releases");
14 |
15 | ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
16 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
17 |
18 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
19 |
20 | using (var client = new WebClient {Proxy = null})
21 | {
22 | client.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 10.0.15063; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2950.0 Safari/537.36");
23 | client.DownloadStringCompleted += Client_DownloadStringCompleted;
24 | client.DownloadStringAsync(releasesUrl, userToken);
25 | }
26 | }
27 |
28 | private static void Client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
29 | {
30 | if (e.Error == null)
31 | try
32 | {
33 | var j = JArray.Parse(e.Result);
34 | var latestVersion = j[0]["tag_name"].ToString();
35 | var url = j[0]["html_url"].ToString();
36 |
37 | UpdateResponse?.Invoke(null, new UpdateResponseEventArgs(new Version(latestVersion), new Uri(url), e.UserState));
38 | }
39 |
40 | catch (Exception ex)
41 | {
42 | UpdateResponse?.Invoke(null, new UpdateResponseEventArgs(ex, e.UserState));
43 | }
44 |
45 | else
46 | UpdateResponse?.Invoke(null, new UpdateResponseEventArgs(e.Error, e.UserState));
47 | }
48 |
49 | public class UpdateCheckException : Exception
50 | {
51 | public UpdateCheckException(string message) : base(message)
52 | {
53 | }
54 | }
55 |
56 | public class UpdateResponseEventArgs : EventArgs
57 | {
58 | public UpdateResponseEventArgs(Version latestVersion, Uri url, object userToken = null)
59 | {
60 | LatestVersion = latestVersion;
61 | Url = url;
62 | UserToken = userToken;
63 | }
64 |
65 | public UpdateResponseEventArgs(Exception error, object userToken = null)
66 | {
67 | Error = error;
68 | UserToken = userToken;
69 | }
70 |
71 | public Version LatestVersion { get; }
72 |
73 | public Exception Error { get; }
74 |
75 | public object UserToken { get; }
76 |
77 | public Uri Url { get; }
78 | }
79 | }
80 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/Utilities/WindowsUtils.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 |
3 | namespace DisableNvidiaTelemetry.Utilities
4 | {
5 | internal class WindowsUtils
6 | {
7 | public static void Restart()
8 | {
9 | StartShutDown("-f -r -t 5");
10 | }
11 |
12 | private static void StartShutDown(string param)
13 | {
14 | var proc = new ProcessStartInfo
15 | {
16 | FileName = "cmd",
17 | WindowStyle = ProcessWindowStyle.Hidden,
18 | Arguments = "/C shutdown " + param
19 | };
20 |
21 | Process.Start(proc);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/View/TelemetryControl.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
16 |
17 |
19 |
20 |
23 |
24 |
25 |
27 |
28 |
31 |
32 |
34 |
35 |
37 |
38 |
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/View/TelemetryControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Collections.ObjectModel;
4 | using System.Linq;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Controls.Primitives;
8 | using DisableNvidiaTelemetry.Model;
9 |
10 | namespace DisableNvidiaTelemetry.View
11 | {
12 | public partial class TelemetryControl : UserControl
13 | {
14 | public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(TelemetryControl));
15 | private readonly List _telemetryItems = new List();
16 | private bool _suppressEvents;
17 |
18 |
19 | public TelemetryControl()
20 | {
21 | InitializeComponent();
22 | containerPanel.Loaded += (sender, e) => { MarginSetter.CreateThicknesForChildren(sender, new DependencyPropertyChangedEventArgs()); };
23 |
24 | Loaded += TelemetryControl_Loaded;
25 |
26 | lblRefresh.MouseLeftButtonDown += (sender, e) => { RefreshClicked?.Invoke(sender, e); };
27 | btnRefresh.MouseLeftButtonDown += (sender, e) => { RefreshClicked?.Invoke(sender, e); };
28 | lblDefault.MouseLeftButtonDown += (sender, e) => { DefaultClicked?.Invoke(sender, e); };
29 | }
30 |
31 | public string Text
32 | {
33 | get => (string) GetValue(TextProperty);
34 | set
35 | {
36 | SetValue(TextProperty, value);
37 | lblName.Content = value;
38 | }
39 | }
40 |
41 | public ReadOnlyCollection TelemetryItems => _telemetryItems.AsReadOnly();
42 |
43 | private void TelemetryControl_Loaded(object sender, RoutedEventArgs e)
44 | {
45 | lblName.Content = Text;
46 | UpdateStatus();
47 | }
48 |
49 | public event EventHandler RefreshClicked;
50 | public event EventHandler DefaultClicked;
51 |
52 | public event EventHandler TelemetryChanged;
53 | public event EventHandler TelemetryChanging;
54 |
55 | public void AddTelemetryItem(ITelemetry telemetry, string displayText)
56 | {
57 | lblPlaceholder.Visibility = Visibility.Collapsed;
58 | btnDefault.Visibility = Visibility.Visible;
59 | lblDefault.Visibility = Visibility.Visible;
60 |
61 | _telemetryItems.Add(telemetry);
62 |
63 | var cb = new CheckBox
64 | {
65 | Content = new TextBlock
66 | {
67 | Text = displayText
68 | },
69 | IsChecked = telemetry.IsActive(),
70 | Style = (Style) FindResource("SwitchCheckBox")
71 | };
72 |
73 | containerPanel.Children.Add(cb);
74 |
75 | cb.Checked += (s, e) => { ProcessCheckChange(telemetry, cb, true); };
76 | cb.Unchecked += (s, e) => { ProcessCheckChange(telemetry, cb, false); };
77 |
78 | UpdateStatus();
79 |
80 | MarginSetter.CreateThicknesForChildren(containerPanel, new DependencyPropertyChangedEventArgs());
81 | }
82 |
83 | private void ProcessCheckChange(ITelemetry telemetry, ToggleButton cb, bool isChecked)
84 | {
85 | if (_suppressEvents)
86 | return;
87 |
88 | var eventArgs = new TelemetryEventArgs(telemetry, isChecked);
89 |
90 | var cancelled = false;
91 |
92 | if (TelemetryChanging != null)
93 | {
94 | TelemetryChanging(this, eventArgs);
95 | cancelled = eventArgs.Cancel;
96 | }
97 |
98 | if (cancelled)
99 | {
100 | _suppressEvents = true;
101 | cb.IsChecked = !isChecked;
102 | _suppressEvents = false;
103 | }
104 |
105 | else
106 | {
107 | TelemetryChanged?.Invoke(this, eventArgs);
108 | }
109 |
110 | UpdateStatus();
111 | }
112 |
113 | private void UpdateStatus()
114 | {
115 | var disabledCount = _telemetryItems.Count(x => !x.IsActive());
116 |
117 | if (lblName.Visibility == Visibility.Hidden)
118 | lblName.Visibility = Visibility.Visible;
119 |
120 | var allDisabled = disabledCount == _telemetryItems.Count;
121 |
122 | if (_telemetryItems.Count > 0)
123 | lblName.Content = $"{Text} - ({(allDisabled ? Properties.Resources.All_Disabled : $"{disabledCount} / {_telemetryItems.Count} {Properties.Resources.Disabled}")})";
124 | }
125 |
126 | public void Reset()
127 | {
128 | _suppressEvents = true;
129 |
130 | _telemetryItems.Clear();
131 | containerPanel.Children.Clear();
132 | lblPlaceholder.Visibility = Visibility.Visible;
133 | btnDefault.Visibility = Visibility.Collapsed;
134 | lblDefault.Visibility = Visibility.Collapsed;
135 |
136 | _suppressEvents = false;
137 | }
138 |
139 | public class TelemetryEventArgs : EventArgs
140 | {
141 | public TelemetryEventArgs(ITelemetry telemetry, bool enabled)
142 | {
143 | Telemetry = telemetry;
144 | Enabled = enabled;
145 | }
146 |
147 | public bool Cancel { get; set; }
148 |
149 | public bool Enabled { get; }
150 |
151 | public ITelemetry Telemetry { get; }
152 | }
153 | }
154 | }
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
53 |
60 |
61 |
62 |
76 |
77 |
--------------------------------------------------------------------------------
/DisableNvidiaTelemetry/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Disable Nvidia Telemetry
2 | ====================
3 |
4 | [](https://ci.appveyor.com/project/NateShoffner/disable-nvidia-telemetry/branch/master)
5 |
6 | Disable Nvidia Telemetry is a utility that allows you to disable the telemetry services Nvidia bundles with their drivers.
7 |
8 | ### Download ###
9 |
10 | 
11 |
12 | [Click here to download v1.2 Installer / Portable Versions](https://github.com/NateShoffner/Disable-Nvidia-Telemetry/releases/1.2)
13 |
14 | 
15 |
16 | ### License ###
17 |
18 | Copyright 2018 Nate Shoffner
19 |
20 | Licensed under the Apache License, Version 2.0 (the "License");
21 | you may not use this file except in compliance with the License.
22 | You may obtain a copy of the License at
23 |
24 | http://www.apache.org/licenses/LICENSE-2.0
25 |
26 | Unless required by applicable law or agreed to in writing, software
27 | distributed under the License is distributed on an "AS IS" BASIS,
28 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 | See the License for the specific language governing permissions and
30 | limitations under the License.
31 |
32 | Icon originally made by freepik from www.flaticon.com
33 |
34 | [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RGQ8NSYPA59FL)
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: 1.2.0.{build}
2 | os: Visual Studio 2017
3 | configuration: Release
4 | platform: Any CPU
5 | install:
6 | - choco install nsis -y --ignore-checksums
7 | assembly_info:
8 | patch: true
9 | file: AssemblyInfo.*
10 | assembly_version: "{version}"
11 | assembly_file_version: "{version}"
12 | assembly_informational_version: "{version}-$(APPVEYOR_REPO_COMMIT)"
13 | before_build:
14 | - ps: nuget restore
15 | build:
16 | project: DisableNvidiaTelemetry.sln
17 | after_build:
18 | - ps: >-
19 | .\Deploy\Installer\nsis.ps1
20 | - ps: >-
21 | .\Deploy\Portable\portable.ps1
22 | artifacts:
23 | - path: "*Setup.exe"
24 | name: installer
25 | - path: "*Portable.exe"
26 | name: portable
--------------------------------------------------------------------------------