SilentOps.cs 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005
  1. using Newtonsoft.Json;
  2. using System;
  3. using System.IO;
  4. using System.Threading.Tasks;
  5. namespace Optimizer
  6. {
  7. internal static class SilentOps
  8. {
  9. internal static SilentConfig CurrentSilentConfig;
  10. internal static SilentConfig GetSilentConfig(string path)
  11. {
  12. try
  13. {
  14. CurrentSilentConfig = JsonConvert.DeserializeObject<SilentConfig>(File.ReadAllText(path));
  15. }
  16. catch (Exception ex)
  17. {
  18. ErrorLogger.LogError("SilentOps.GetSilentConfig", ex.Message, ex.StackTrace);
  19. CurrentSilentConfig = null;
  20. }
  21. return CurrentSilentConfig;
  22. }
  23. // silent config processing for universal tweaks
  24. internal static void ProcessSilentConfigGeneral()
  25. {
  26. if (CurrentSilentConfig.EnablePerformanceTweaks.HasValue)
  27. {
  28. if (CurrentSilentConfig.EnablePerformanceTweaks.Value)
  29. {
  30. OptimizeHelper.EnablePerformanceTweaks();
  31. }
  32. else
  33. {
  34. OptimizeHelper.DisablePerformanceTweaks();
  35. }
  36. }
  37. if (CurrentSilentConfig.DisableNetworkThrottling.HasValue)
  38. {
  39. if (CurrentSilentConfig.DisableNetworkThrottling.Value)
  40. {
  41. OptimizeHelper.DisableNetworkThrottling();
  42. }
  43. else
  44. {
  45. OptimizeHelper.EnableNetworkThrottling();
  46. }
  47. }
  48. if (CurrentSilentConfig.DisableWindowsDefender.HasValue)
  49. {
  50. if (CurrentSilentConfig.DisableWindowsDefender.Value)
  51. {
  52. OptimizeHelper.DisableDefender();
  53. }
  54. else
  55. {
  56. OptimizeHelper.EnableDefender();
  57. }
  58. }
  59. if (CurrentSilentConfig.DisableSystemRestore.HasValue)
  60. {
  61. if (CurrentSilentConfig.DisableSystemRestore.Value)
  62. {
  63. OptimizeHelper.DisableSystemRestore();
  64. }
  65. else
  66. {
  67. OptimizeHelper.EnableSystemRestore();
  68. }
  69. }
  70. if (CurrentSilentConfig.DisablePrintService.HasValue)
  71. {
  72. if (CurrentSilentConfig.DisablePrintService.Value)
  73. {
  74. OptimizeHelper.DisablePrintService();
  75. }
  76. else
  77. {
  78. OptimizeHelper.EnablePrintService();
  79. }
  80. }
  81. if (CurrentSilentConfig.DisableMediaPlayerSharing.HasValue)
  82. {
  83. if (CurrentSilentConfig.DisableMediaPlayerSharing.Value)
  84. {
  85. OptimizeHelper.DisableMediaPlayerSharing();
  86. }
  87. else
  88. {
  89. OptimizeHelper.EnableMediaPlayerSharing();
  90. }
  91. }
  92. if (CurrentSilentConfig.DisableErrorReporting.HasValue)
  93. {
  94. if (CurrentSilentConfig.DisableErrorReporting.Value)
  95. {
  96. OptimizeHelper.DisableErrorReporting();
  97. }
  98. else
  99. {
  100. OptimizeHelper.EnableErrorReporting();
  101. }
  102. }
  103. if (CurrentSilentConfig.DisableHomeGroup.HasValue)
  104. {
  105. if (CurrentSilentConfig.DisableHomeGroup.Value)
  106. {
  107. OptimizeHelper.DisableHomeGroup();
  108. }
  109. else
  110. {
  111. OptimizeHelper.EnableHomeGroup();
  112. }
  113. }
  114. if (CurrentSilentConfig.DisableSuperfetch.HasValue)
  115. {
  116. if (CurrentSilentConfig.DisableSuperfetch.Value)
  117. {
  118. OptimizeHelper.DisableSuperfetch();
  119. }
  120. else
  121. {
  122. OptimizeHelper.EnableSuperfetch();
  123. }
  124. }
  125. if (CurrentSilentConfig.DisableTelemetryTasks.HasValue)
  126. {
  127. if (CurrentSilentConfig.DisableTelemetryTasks.Value)
  128. {
  129. OptimizeHelper.DisableTelemetryTasks();
  130. }
  131. else
  132. {
  133. OptimizeHelper.EnableTelemetryTasks();
  134. }
  135. }
  136. if (CurrentSilentConfig.DisableOffice2016Telemetry.HasValue)
  137. {
  138. if (CurrentSilentConfig.DisableOffice2016Telemetry.Value)
  139. {
  140. OptimizeHelper.DisableOffice2016Telemetry();
  141. }
  142. else
  143. {
  144. OptimizeHelper.EnableOffice2016Telemetry();
  145. }
  146. }
  147. if (CurrentSilentConfig.DisableCompatibilityAssistant.HasValue)
  148. {
  149. if (CurrentSilentConfig.DisableCompatibilityAssistant.Value)
  150. {
  151. OptimizeHelper.DisableCompatibilityAssistant();
  152. }
  153. else
  154. {
  155. OptimizeHelper.EnableCompatibilityAssistant();
  156. }
  157. }
  158. if (CurrentSilentConfig.DisableFaxService.HasValue)
  159. {
  160. if (CurrentSilentConfig.DisableFaxService.Value)
  161. {
  162. OptimizeHelper.DisableFaxService();
  163. }
  164. else
  165. {
  166. OptimizeHelper.EnableFaxService();
  167. }
  168. }
  169. if (CurrentSilentConfig.DisableSmartScreen.HasValue)
  170. {
  171. if (CurrentSilentConfig.DisableSmartScreen.Value)
  172. {
  173. OptimizeHelper.DisableSmartScreen();
  174. }
  175. else
  176. {
  177. OptimizeHelper.EnableSmartScreen();
  178. }
  179. }
  180. if (CurrentSilentConfig.DisableStickyKeys.HasValue)
  181. {
  182. if (CurrentSilentConfig.DisableStickyKeys.Value)
  183. {
  184. OptimizeHelper.DisableStickyKeys();
  185. }
  186. else
  187. {
  188. OptimizeHelper.EnableStickyKeys();
  189. }
  190. }
  191. if (CurrentSilentConfig.DisableHibernation.HasValue)
  192. {
  193. if (CurrentSilentConfig.DisableHibernation.Value)
  194. {
  195. Utilities.DisableHibernation();
  196. }
  197. else
  198. {
  199. Utilities.EnableHibernation();
  200. }
  201. }
  202. if (CurrentSilentConfig.DisableSMB1.HasValue)
  203. {
  204. if (CurrentSilentConfig.DisableSMB1.Value)
  205. {
  206. OptimizeHelper.DisableSMB("1");
  207. }
  208. else
  209. {
  210. OptimizeHelper.EnableSMB("1");
  211. }
  212. }
  213. if (CurrentSilentConfig.DisableSMB2.HasValue)
  214. {
  215. if (CurrentSilentConfig.DisableSMB2.Value)
  216. {
  217. OptimizeHelper.DisableSMB("2");
  218. }
  219. else
  220. {
  221. OptimizeHelper.EnableSMB("2");
  222. }
  223. }
  224. if (CurrentSilentConfig.DisableNTFSTimeStamp.HasValue)
  225. {
  226. if (CurrentSilentConfig.DisableNTFSTimeStamp.Value)
  227. {
  228. OptimizeHelper.DisableNTFSTimeStamp();
  229. }
  230. else
  231. {
  232. OptimizeHelper.EnableNTFSTimeStamp();
  233. }
  234. }
  235. if (CurrentSilentConfig.DisableSearch.HasValue)
  236. {
  237. if (CurrentSilentConfig.DisableSearch.Value)
  238. {
  239. OptimizeHelper.DisableSearch();
  240. }
  241. else
  242. {
  243. OptimizeHelper.EnableSearch();
  244. }
  245. }
  246. if (CurrentSilentConfig.DisableChromeTelemetry.HasValue)
  247. {
  248. if (CurrentSilentConfig.DisableChromeTelemetry.Value)
  249. {
  250. OptimizeHelper.DisableChromeTelemetry();
  251. }
  252. else
  253. {
  254. OptimizeHelper.EnableChromeTelemetry();
  255. }
  256. }
  257. if (CurrentSilentConfig.DisableFirefoxTemeletry.HasValue)
  258. {
  259. if (CurrentSilentConfig.DisableFirefoxTemeletry.Value)
  260. {
  261. OptimizeHelper.DisableFirefoxTelemetry();
  262. }
  263. else
  264. {
  265. OptimizeHelper.EnableFirefoxTelemetry();
  266. }
  267. }
  268. if (CurrentSilentConfig.DisableVisualStudioTelemetry.HasValue)
  269. {
  270. if (CurrentSilentConfig.DisableVisualStudioTelemetry.Value)
  271. {
  272. OptimizeHelper.DisableVisualStudioTelemetry();
  273. }
  274. else
  275. {
  276. OptimizeHelper.EnableVisualStudioTelemetry();
  277. }
  278. }
  279. if (CurrentSilentConfig.DisableNVIDIATelemetry.HasValue)
  280. {
  281. if (CurrentSilentConfig.DisableNVIDIATelemetry.Value)
  282. {
  283. OptimizeHelper.DisableNvidiaTelemetry();
  284. }
  285. else
  286. {
  287. OptimizeHelper.EnableNvidiaTelemetry();
  288. }
  289. }
  290. if (CurrentSilentConfig.DisableHPET.HasValue)
  291. {
  292. if (CurrentSilentConfig.DisableHPET.Value)
  293. {
  294. Utilities.DisableHPET();
  295. }
  296. else
  297. {
  298. Utilities.EnableHPET();
  299. }
  300. }
  301. if (CurrentSilentConfig.EnableLoginVerbose.HasValue)
  302. {
  303. if (CurrentSilentConfig.EnableLoginVerbose.Value)
  304. {
  305. Utilities.EnableLoginVerbose();
  306. }
  307. else
  308. {
  309. Utilities.DisableLoginVerbose();
  310. }
  311. }
  312. }
  313. // silent config processing for Windows 8 tweaks
  314. internal static void ProcessSilentConfigWindows8()
  315. {
  316. if (CurrentSilentConfig.DisableOneDrive.HasValue)
  317. {
  318. if (CurrentSilentConfig.DisableOneDrive.Value)
  319. {
  320. OptimizeHelper.DisableOneDrive();
  321. }
  322. else
  323. {
  324. OptimizeHelper.EnableOneDrive();
  325. }
  326. }
  327. }
  328. // silent config processing for Windows 10 tweaks
  329. internal static void ProcessSilentConfigWindows10()
  330. {
  331. if (CurrentSilentConfig.EnableGamingMode.HasValue)
  332. {
  333. if (CurrentSilentConfig.EnableGamingMode.Value)
  334. {
  335. OptimizeHelper.EnableGamingMode();
  336. }
  337. else
  338. {
  339. OptimizeHelper.DisableGamingMode();
  340. }
  341. }
  342. if (CurrentSilentConfig.EnableLegacyVolumeSlider.HasValue)
  343. {
  344. if (CurrentSilentConfig.EnableLegacyVolumeSlider.Value)
  345. {
  346. OptimizeHelper.EnableLegacyVolumeSlider();
  347. }
  348. else
  349. {
  350. OptimizeHelper.DisableLegacyVolumeSlider();
  351. }
  352. }
  353. if (CurrentSilentConfig.DisableQuickAccessHistory.HasValue)
  354. {
  355. if (CurrentSilentConfig.DisableQuickAccessHistory.Value)
  356. {
  357. OptimizeHelper.DisableQuickAccessHistory();
  358. }
  359. else
  360. {
  361. OptimizeHelper.EnableQuickAccessHistory();
  362. }
  363. }
  364. if (CurrentSilentConfig.DisableStartMenuAds.HasValue)
  365. {
  366. if (CurrentSilentConfig.DisableStartMenuAds.Value)
  367. {
  368. OptimizeHelper.DisableStartMenuAds();
  369. }
  370. else
  371. {
  372. OptimizeHelper.EnableStartMenuAds();
  373. }
  374. }
  375. if (CurrentSilentConfig.UninstallOneDrive.HasValue)
  376. {
  377. if (CurrentSilentConfig.UninstallOneDrive.Value)
  378. {
  379. Task t = new Task(() => OptimizeHelper.UninstallOneDrive());
  380. t.Start();
  381. }
  382. else
  383. {
  384. Task t = new Task(() => OptimizeHelper.InstallOneDrive());
  385. t.Start();
  386. }
  387. }
  388. if (CurrentSilentConfig.DisableMyPeople.HasValue)
  389. {
  390. if (CurrentSilentConfig.DisableMyPeople.Value)
  391. {
  392. OptimizeHelper.DisableMyPeople();
  393. }
  394. else
  395. {
  396. OptimizeHelper.EnableMyPeople();
  397. }
  398. }
  399. if (CurrentSilentConfig.EnableLongPaths.HasValue)
  400. {
  401. if (CurrentSilentConfig.EnableLongPaths.Value)
  402. {
  403. OptimizeHelper.EnableLongPaths();
  404. }
  405. else
  406. {
  407. OptimizeHelper.DisableLongPaths();
  408. }
  409. }
  410. if (CurrentSilentConfig.DisableAutomaticUpdates.HasValue)
  411. {
  412. if (CurrentSilentConfig.DisableAutomaticUpdates.Value)
  413. {
  414. OptimizeHelper.DisableAutomaticUpdates();
  415. }
  416. else
  417. {
  418. OptimizeHelper.EnableAutomaticUpdates();
  419. }
  420. }
  421. if (CurrentSilentConfig.ExcludeDrivers.HasValue)
  422. {
  423. if (CurrentSilentConfig.ExcludeDrivers.Value)
  424. {
  425. OptimizeHelper.ExcludeDrivers();
  426. }
  427. else
  428. {
  429. OptimizeHelper.IncludeDrivers();
  430. }
  431. }
  432. if (CurrentSilentConfig.DisableTelemetryServices.HasValue)
  433. {
  434. if (CurrentSilentConfig.DisableTelemetryServices.Value)
  435. {
  436. OptimizeHelper.DisableTelemetryServices();
  437. }
  438. else
  439. {
  440. OptimizeHelper.EnableTelemetryServices();
  441. }
  442. }
  443. if (CurrentSilentConfig.DisablePrivacyOptions.HasValue)
  444. {
  445. if (CurrentSilentConfig.DisablePrivacyOptions.Value)
  446. {
  447. OptimizeHelper.EnhancePrivacy();
  448. }
  449. else
  450. {
  451. OptimizeHelper.CompromisePrivacy();
  452. }
  453. }
  454. if (CurrentSilentConfig.DisableCortana.HasValue)
  455. {
  456. if (CurrentSilentConfig.DisableCortana.Value)
  457. {
  458. OptimizeHelper.DisableCortana();
  459. }
  460. else
  461. {
  462. OptimizeHelper.EnableCortana();
  463. }
  464. }
  465. if (CurrentSilentConfig.DisableSensorServices.HasValue)
  466. {
  467. if (CurrentSilentConfig.DisableSensorServices.Value)
  468. {
  469. OptimizeHelper.DisableSensorServices();
  470. }
  471. else
  472. {
  473. OptimizeHelper.EnableSensorServices();
  474. }
  475. }
  476. if (CurrentSilentConfig.DisableWindowsInk.HasValue)
  477. {
  478. if (CurrentSilentConfig.DisableWindowsInk.Value)
  479. {
  480. OptimizeHelper.DisableWindowsInk();
  481. }
  482. else
  483. {
  484. OptimizeHelper.EnableWindowsInk();
  485. }
  486. }
  487. if (CurrentSilentConfig.DisableSpellingTyping.HasValue)
  488. {
  489. if (CurrentSilentConfig.DisableSpellingTyping.Value)
  490. {
  491. OptimizeHelper.DisableSpellingAndTypingFeatures();
  492. }
  493. else
  494. {
  495. OptimizeHelper.EnableSpellingAndTypingFeatures();
  496. }
  497. }
  498. if (CurrentSilentConfig.DisableXboxLive.HasValue)
  499. {
  500. if (CurrentSilentConfig.DisableXboxLive.Value)
  501. {
  502. OptimizeHelper.DisableXboxLive();
  503. }
  504. else
  505. {
  506. OptimizeHelper.EnableXboxLive();
  507. }
  508. }
  509. if (CurrentSilentConfig.DisableGameBar.HasValue)
  510. {
  511. if (CurrentSilentConfig.DisableGameBar.Value)
  512. {
  513. OptimizeHelper.DisableGameBar();
  514. }
  515. else
  516. {
  517. OptimizeHelper.EnableGameBar();
  518. }
  519. }
  520. if (CurrentSilentConfig.DisableInsiderService.HasValue)
  521. {
  522. if (CurrentSilentConfig.DisableInsiderService.Value)
  523. {
  524. OptimizeHelper.DisableInsiderService();
  525. }
  526. else
  527. {
  528. OptimizeHelper.EnableInsiderService();
  529. }
  530. }
  531. if (CurrentSilentConfig.DisableStoreUpdates.HasValue)
  532. {
  533. if (CurrentSilentConfig.DisableStoreUpdates.Value)
  534. {
  535. OptimizeHelper.DisableStoreUpdates();
  536. }
  537. else
  538. {
  539. OptimizeHelper.EnableStoreUpdates();
  540. }
  541. }
  542. if (CurrentSilentConfig.DisableCloudClipboard.HasValue)
  543. {
  544. if (CurrentSilentConfig.DisableCloudClipboard.Value)
  545. {
  546. OptimizeHelper.DisableCloudClipboard();
  547. }
  548. else
  549. {
  550. OptimizeHelper.EnableCloudClipboard();
  551. }
  552. }
  553. if (CurrentSilentConfig.RemoveCastToDevice.HasValue)
  554. {
  555. if (CurrentSilentConfig.RemoveCastToDevice.Value)
  556. {
  557. OptimizeHelper.RemoveCastToDevice();
  558. }
  559. else
  560. {
  561. OptimizeHelper.AddCastToDevice();
  562. }
  563. }
  564. if (CurrentSilentConfig.DisableEdgeTelemetry.HasValue)
  565. {
  566. if (CurrentSilentConfig.DisableEdgeTelemetry.Value)
  567. {
  568. OptimizeHelper.DisableEdgeTelemetry();
  569. }
  570. else
  571. {
  572. OptimizeHelper.EnableEdgeTelemetry();
  573. }
  574. }
  575. if (CurrentSilentConfig.DisableEdgeDiscoverBar.HasValue)
  576. {
  577. if (CurrentSilentConfig.DisableEdgeDiscoverBar.Value)
  578. {
  579. OptimizeHelper.DisableEdgeDiscoverBar();
  580. }
  581. else
  582. {
  583. OptimizeHelper.EnableEdgeDiscoverBar();
  584. }
  585. }
  586. }
  587. // silent config processing for Windows 11 tweaks
  588. internal static void ProcessSilentConfigWindows11()
  589. {
  590. if (CurrentSilentConfig.TaskbarToLeft.HasValue)
  591. {
  592. if (CurrentSilentConfig.TaskbarToLeft.Value)
  593. {
  594. OptimizeHelper.AlignTaskbarToLeft();
  595. }
  596. else
  597. {
  598. OptimizeHelper.AlignTaskbarToCenter();
  599. }
  600. }
  601. if (CurrentSilentConfig.DisableStickers.HasValue)
  602. {
  603. if (CurrentSilentConfig.DisableStickers.Value)
  604. {
  605. OptimizeHelper.DisableStickers();
  606. }
  607. else
  608. {
  609. OptimizeHelper.EnableStickers();
  610. }
  611. }
  612. if (CurrentSilentConfig.CompactMode.HasValue)
  613. {
  614. if (CurrentSilentConfig.CompactMode.Value)
  615. {
  616. OptimizeHelper.EnableFilesCompactMode();
  617. }
  618. else
  619. {
  620. OptimizeHelper.DisableFilesCompactMode();
  621. }
  622. }
  623. if (CurrentSilentConfig.DisableSnapAssist.HasValue)
  624. {
  625. if (CurrentSilentConfig.DisableSnapAssist.Value)
  626. {
  627. OptimizeHelper.DisableSnapAssist();
  628. }
  629. else
  630. {
  631. OptimizeHelper.EnableSnapAssist();
  632. }
  633. }
  634. if (CurrentSilentConfig.DisableWidgets.HasValue)
  635. {
  636. if (CurrentSilentConfig.DisableWidgets.Value)
  637. {
  638. OptimizeHelper.DisableWidgets();
  639. }
  640. else
  641. {
  642. OptimizeHelper.EnableWidgets();
  643. }
  644. }
  645. if (CurrentSilentConfig.DisableChat.HasValue)
  646. {
  647. if (CurrentSilentConfig.DisableChat.Value)
  648. {
  649. OptimizeHelper.DisableChat();
  650. }
  651. else
  652. {
  653. OptimizeHelper.EnableChat();
  654. }
  655. }
  656. if (CurrentSilentConfig.DisableVBS.HasValue)
  657. {
  658. if (CurrentSilentConfig.DisableVBS.Value)
  659. {
  660. OptimizeHelper.DisableVirtualizationBasedSecurity();
  661. }
  662. else
  663. {
  664. OptimizeHelper.EnableVirtualizationBasedSecurity();
  665. }
  666. }
  667. if (CurrentSilentConfig.ClassicMenu.HasValue)
  668. {
  669. if (CurrentSilentConfig.ClassicMenu.Value)
  670. {
  671. OptimizeHelper.DisableShowMoreOptions();
  672. }
  673. else
  674. {
  675. OptimizeHelper.EnableShowMoreOptions();
  676. }
  677. }
  678. if (CurrentSilentConfig.DisableTPMCheck.HasValue)
  679. {
  680. if (CurrentSilentConfig.DisableTPMCheck.Value)
  681. {
  682. OptimizeHelper.DisableTPMCheck();
  683. }
  684. else
  685. {
  686. OptimizeHelper.EnableTPMCheck();
  687. }
  688. }
  689. }
  690. // updating options using silent config
  691. internal static void SilentUpdateOptionsGeneral()
  692. {
  693. if (CurrentSilentConfig.EnablePerformanceTweaks.HasValue)
  694. {
  695. Options.CurrentOptions.EnablePerformanceTweaks = CurrentSilentConfig.EnablePerformanceTweaks.Value;
  696. }
  697. if (CurrentSilentConfig.DisableNetworkThrottling.HasValue)
  698. {
  699. Options.CurrentOptions.DisableNetworkThrottling = CurrentSilentConfig.DisableNetworkThrottling.Value;
  700. }
  701. if (CurrentSilentConfig.DisableWindowsDefender.HasValue)
  702. {
  703. Options.CurrentOptions.DisableWindowsDefender = CurrentSilentConfig.DisableWindowsDefender.Value;
  704. }
  705. if (CurrentSilentConfig.DisableSystemRestore.HasValue)
  706. {
  707. Options.CurrentOptions.DisableSystemRestore = CurrentSilentConfig.DisableSystemRestore.Value;
  708. }
  709. if (CurrentSilentConfig.DisablePrintService.HasValue)
  710. {
  711. Options.CurrentOptions.DisablePrintService = CurrentSilentConfig.DisablePrintService.Value;
  712. }
  713. if (CurrentSilentConfig.DisableMediaPlayerSharing.HasValue)
  714. {
  715. Options.CurrentOptions.DisableMediaPlayerSharing = CurrentSilentConfig.DisableMediaPlayerSharing.Value;
  716. }
  717. if (CurrentSilentConfig.DisableErrorReporting.HasValue)
  718. {
  719. Options.CurrentOptions.DisableErrorReporting = CurrentSilentConfig.DisableErrorReporting.Value;
  720. }
  721. if (CurrentSilentConfig.DisableHomeGroup.HasValue)
  722. {
  723. Options.CurrentOptions.DisableHomeGroup = CurrentSilentConfig.DisableHomeGroup.Value;
  724. }
  725. if (CurrentSilentConfig.DisableSuperfetch.HasValue)
  726. {
  727. Options.CurrentOptions.DisableSuperfetch = CurrentSilentConfig.DisableSuperfetch.Value;
  728. }
  729. if (CurrentSilentConfig.DisableSearch.HasValue)
  730. {
  731. Options.CurrentOptions.DisableSearch = CurrentSilentConfig.DisableSearch.Value;
  732. }
  733. if (CurrentSilentConfig.DisableTelemetryTasks.HasValue)
  734. {
  735. Options.CurrentOptions.DisableTelemetryTasks = CurrentSilentConfig.DisableTelemetryTasks.Value;
  736. }
  737. if (CurrentSilentConfig.DisableOffice2016Telemetry.HasValue)
  738. {
  739. Options.CurrentOptions.DisableOffice2016Telemetry = CurrentSilentConfig.DisableOffice2016Telemetry.Value;
  740. }
  741. if (CurrentSilentConfig.DisableCompatibilityAssistant.HasValue)
  742. {
  743. Options.CurrentOptions.DisableCompatibilityAssistant = CurrentSilentConfig.DisableCompatibilityAssistant.Value;
  744. }
  745. if (CurrentSilentConfig.DisableFaxService.HasValue)
  746. {
  747. Options.CurrentOptions.DisableFaxService = CurrentSilentConfig.DisableFaxService.Value;
  748. }
  749. if (CurrentSilentConfig.DisableHibernation.HasValue)
  750. {
  751. Options.CurrentOptions.DisableHibernation = CurrentSilentConfig.DisableHibernation.Value;
  752. }
  753. if (CurrentSilentConfig.DisableSMB1.HasValue)
  754. {
  755. Options.CurrentOptions.DisableSMB1 = CurrentSilentConfig.DisableSMB1.Value;
  756. }
  757. if (CurrentSilentConfig.DisableSMB2.HasValue)
  758. {
  759. Options.CurrentOptions.DisableSMB2 = CurrentSilentConfig.DisableSMB2.Value;
  760. }
  761. if (CurrentSilentConfig.DisableNTFSTimeStamp.HasValue)
  762. {
  763. Options.CurrentOptions.DisableNTFSTimeStamp = CurrentSilentConfig.DisableNTFSTimeStamp.Value;
  764. }
  765. if (CurrentSilentConfig.DisableSmartScreen.HasValue)
  766. {
  767. Options.CurrentOptions.DisableSmartScreen = CurrentSilentConfig.DisableSmartScreen.Value;
  768. }
  769. if (CurrentSilentConfig.DisableStickyKeys.HasValue)
  770. {
  771. Options.CurrentOptions.DisableStickyKeys = CurrentSilentConfig.DisableStickyKeys.Value;
  772. }
  773. if (CurrentSilentConfig.DisableVisualStudioTelemetry.HasValue)
  774. {
  775. Options.CurrentOptions.DisableVisualStudioTelemetry = CurrentSilentConfig.DisableVisualStudioTelemetry.Value;
  776. }
  777. if (CurrentSilentConfig.DisableFirefoxTemeletry.HasValue)
  778. {
  779. Options.CurrentOptions.DisableFirefoxTemeletry = CurrentSilentConfig.DisableFirefoxTemeletry.Value;
  780. }
  781. if (CurrentSilentConfig.DisableChromeTelemetry.HasValue)
  782. {
  783. Options.CurrentOptions.DisableChromeTelemetry = CurrentSilentConfig.DisableChromeTelemetry.Value;
  784. }
  785. if (CurrentSilentConfig.DisableNVIDIATelemetry.HasValue)
  786. {
  787. Options.CurrentOptions.DisableNVIDIATelemetry = CurrentSilentConfig.DisableNVIDIATelemetry.Value;
  788. }
  789. if (CurrentSilentConfig.DisableHPET.HasValue)
  790. {
  791. Options.CurrentOptions.DisableHPET = CurrentSilentConfig.DisableHPET.Value;
  792. }
  793. if (CurrentSilentConfig.EnableLoginVerbose.HasValue)
  794. {
  795. Options.CurrentOptions.EnableLoginVerbose = CurrentSilentConfig.EnableLoginVerbose.Value;
  796. }
  797. }
  798. internal static void SilentUpdateOptions8()
  799. {
  800. if (CurrentSilentConfig.DisableOneDrive.HasValue)
  801. {
  802. Options.CurrentOptions.DisableOneDrive = CurrentSilentConfig.DisableOneDrive.Value;
  803. }
  804. }
  805. internal static void SilentUpdateOptions11()
  806. {
  807. if (CurrentSilentConfig.DisableStickers.HasValue)
  808. {
  809. Options.CurrentOptions.DisableStickers = CurrentSilentConfig.DisableStickers.Value;
  810. }
  811. if (CurrentSilentConfig.TaskbarToLeft.HasValue)
  812. {
  813. Options.CurrentOptions.TaskbarToLeft = CurrentSilentConfig.TaskbarToLeft.Value;
  814. }
  815. if (CurrentSilentConfig.CompactMode.HasValue)
  816. {
  817. Options.CurrentOptions.CompactMode = CurrentSilentConfig.CompactMode.Value;
  818. }
  819. if (CurrentSilentConfig.DisableSnapAssist.HasValue)
  820. {
  821. Options.CurrentOptions.DisableSnapAssist = CurrentSilentConfig.DisableSnapAssist.Value;
  822. }
  823. if (CurrentSilentConfig.DisableWidgets.HasValue)
  824. {
  825. Options.CurrentOptions.DisableWidgets = CurrentSilentConfig.DisableWidgets.Value;
  826. }
  827. if (CurrentSilentConfig.DisableChat.HasValue)
  828. {
  829. Options.CurrentOptions.DisableChat = CurrentSilentConfig.DisableChat.Value;
  830. }
  831. if (CurrentSilentConfig.ClassicMenu.HasValue)
  832. {
  833. Options.CurrentOptions.ClassicMenu = CurrentSilentConfig.ClassicMenu.Value;
  834. }
  835. if (CurrentSilentConfig.DisableTPMCheck.HasValue)
  836. {
  837. Options.CurrentOptions.DisableTPMCheck = CurrentSilentConfig.DisableTPMCheck.Value;
  838. }
  839. if (CurrentSilentConfig.DisableVBS.HasValue)
  840. {
  841. Options.CurrentOptions.DisableVBS = CurrentSilentConfig.DisableVBS.Value;
  842. }
  843. }
  844. internal static void SilentUpdateOptions10()
  845. {
  846. if (CurrentSilentConfig.EnableLegacyVolumeSlider.HasValue)
  847. {
  848. Options.CurrentOptions.EnableLegacyVolumeSlider = CurrentSilentConfig.EnableLegacyVolumeSlider.Value;
  849. }
  850. if (CurrentSilentConfig.EnableGamingMode.HasValue)
  851. {
  852. Options.CurrentOptions.EnableGamingMode = CurrentSilentConfig.EnableGamingMode.Value;
  853. }
  854. if (CurrentSilentConfig.DisableQuickAccessHistory.HasValue)
  855. {
  856. Options.CurrentOptions.DisableQuickAccessHistory = CurrentSilentConfig.DisableQuickAccessHistory.Value;
  857. }
  858. if (CurrentSilentConfig.DisableStartMenuAds.HasValue)
  859. {
  860. Options.CurrentOptions.DisableStartMenuAds = CurrentSilentConfig.DisableStartMenuAds.Value;
  861. }
  862. if (CurrentSilentConfig.UninstallOneDrive.HasValue)
  863. {
  864. Options.CurrentOptions.UninstallOneDrive = CurrentSilentConfig.UninstallOneDrive.Value;
  865. }
  866. if (CurrentSilentConfig.DisableMyPeople.HasValue)
  867. {
  868. Options.CurrentOptions.DisableMyPeople = CurrentSilentConfig.DisableMyPeople.Value;
  869. }
  870. if (CurrentSilentConfig.EnableLongPaths.HasValue)
  871. {
  872. Options.CurrentOptions.EnableLongPaths = CurrentSilentConfig.EnableLongPaths.Value;
  873. }
  874. if (CurrentSilentConfig.DisableAutomaticUpdates.HasValue)
  875. {
  876. Options.CurrentOptions.DisableAutomaticUpdates = CurrentSilentConfig.DisableAutomaticUpdates.Value;
  877. }
  878. if (CurrentSilentConfig.ExcludeDrivers.HasValue)
  879. {
  880. Options.CurrentOptions.ExcludeDrivers = CurrentSilentConfig.ExcludeDrivers.Value;
  881. }
  882. if (CurrentSilentConfig.DisableTelemetryServices.HasValue)
  883. {
  884. Options.CurrentOptions.DisableTelemetryServices = CurrentSilentConfig.DisableTelemetryServices.Value;
  885. }
  886. if (CurrentSilentConfig.DisablePrivacyOptions.HasValue)
  887. {
  888. Options.CurrentOptions.DisablePrivacyOptions = CurrentSilentConfig.DisablePrivacyOptions.Value;
  889. }
  890. if (CurrentSilentConfig.DisableCortana.HasValue)
  891. {
  892. Options.CurrentOptions.DisableCortana = CurrentSilentConfig.DisableCortana.Value;
  893. }
  894. if (CurrentSilentConfig.DisableSensorServices.HasValue)
  895. {
  896. Options.CurrentOptions.DisableSensorServices = CurrentSilentConfig.DisableSensorServices.Value;
  897. }
  898. if (CurrentSilentConfig.DisableWindowsInk.HasValue)
  899. {
  900. Options.CurrentOptions.DisableWindowsInk = CurrentSilentConfig.DisableWindowsInk.Value;
  901. }
  902. if (CurrentSilentConfig.DisableSpellingTyping.HasValue)
  903. {
  904. Options.CurrentOptions.DisableSpellingTyping = CurrentSilentConfig.DisableSpellingTyping.Value;
  905. }
  906. if (CurrentSilentConfig.DisableXboxLive.HasValue)
  907. {
  908. Options.CurrentOptions.DisableXboxLive = CurrentSilentConfig.DisableXboxLive.Value;
  909. }
  910. if (CurrentSilentConfig.DisableGameBar.HasValue)
  911. {
  912. Options.CurrentOptions.DisableGameBar = CurrentSilentConfig.DisableGameBar.Value;
  913. }
  914. if (CurrentSilentConfig.DisableInsiderService.HasValue)
  915. {
  916. Options.CurrentOptions.DisableInsiderService = CurrentSilentConfig.DisableInsiderService.Value;
  917. }
  918. if (CurrentSilentConfig.DisableStoreUpdates.HasValue)
  919. {
  920. Options.CurrentOptions.DisableStoreUpdates = CurrentSilentConfig.DisableStoreUpdates.Value;
  921. }
  922. if (CurrentSilentConfig.DisableCloudClipboard.HasValue)
  923. {
  924. Options.CurrentOptions.DisableCloudClipboard = CurrentSilentConfig.DisableCloudClipboard.Value;
  925. }
  926. if (CurrentSilentConfig.RemoveCastToDevice.HasValue)
  927. {
  928. Options.CurrentOptions.RemoveCastToDevice = CurrentSilentConfig.RemoveCastToDevice.Value;
  929. }
  930. if (CurrentSilentConfig.DisableEdgeDiscoverBar.HasValue)
  931. {
  932. Options.CurrentOptions.DisableEdgeDiscoverBar = CurrentSilentConfig.DisableEdgeDiscoverBar.Value;
  933. }
  934. if (CurrentSilentConfig.DisableEdgeTelemetry.HasValue)
  935. {
  936. Options.CurrentOptions.DisableEdgeTelemetry = CurrentSilentConfig.DisableEdgeTelemetry.Value;
  937. }
  938. }
  939. }
  940. }