Skip to content

Commit 3cca683

Browse files
committed
feat: Add Win10-Initial-Setup-Script action
1 parent a978252 commit 3cca683

17 files changed

+639
-112
lines changed

resources/setup.exe

216 KB
Binary file not shown.

src/config/chocolatey.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="ccleaner" />
4+
</packages>

src/config/desktop-folders.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Name,Icon
2+
Browsers,14

src/config/initial-setup.config

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
##########
2+
# Win 10 / Server 2016 / Server 2019 Initial Setup Script - Default preset
3+
# Author: Disassembler <disassembler@dasm.cz>
4+
# Version: v3.8, 2019-09-11
5+
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
6+
##########
7+
8+
### Require administrator privileges ###
9+
RequireAdmin
10+
11+
### Privacy Tweaks ###
12+
DisableTelemetry # EnableTelemetry
13+
DisableWiFiSense # EnableWiFiSense
14+
DisableSmartScreen # EnableSmartScreen
15+
# DisableWebSearch # EnableWebSearch
16+
DisableAppSuggestions # EnableAppSuggestions
17+
DisableActivityHistory # EnableActivityHistory
18+
DisableBackgroundApps # EnableBackgroundApps
19+
# DisableSensors # EnableSensors
20+
DisableLocation # EnableLocation
21+
DisableMapUpdates # EnableMapUpdates
22+
DisableFeedback # EnableFeedback
23+
DisableTailoredExperiences # EnableTailoredExperiences
24+
DisableAdvertisingID # EnableAdvertisingID
25+
DisableWebLangList # EnableWebLangList
26+
DisableCortana # EnableCortana
27+
# DisableBiometrics # EnableBiometrics
28+
# DisableCamera # EnableCamera
29+
# DisableMicrophone # EnableMicrophone
30+
DisableErrorReporting # EnableErrorReporting
31+
# SetP2PUpdateLocal # SetP2PUpdateInternet # SetP2PUpdateDisable
32+
DisableDiagTrack # EnableDiagTrack
33+
DisableWAPPush # EnableWAPPush
34+
# EnableClearRecentFiles # DisableClearRecentFiles
35+
# DisableRecentFiles # EnableRecentFiles
36+
37+
### Security Tweaks ###
38+
# SetUACLow # SetUACHigh
39+
# EnableSharingMappedDrives # DisableSharingMappedDrives
40+
DisableAdminShares # EnableAdminShares
41+
# DisableFirewall # EnableFirewall
42+
# HideDefenderTrayIcon # ShowDefenderTrayIcon
43+
# DisableDefender # EnableDefender
44+
# DisableDefenderCloud # EnableDefenderCloud
45+
# EnableCtrldFolderAccess # DisableCtrldFolderAccess
46+
# EnableCIMemoryIntegrity # DisableCIMemoryIntegrity
47+
# EnableDefenderAppGuard # DisableDefenderAppGuard
48+
HideAccountProtectionWarn # ShowAccountProtectionWarn
49+
# DisableDownloadBlocking # EnableDownloadBlocking
50+
DisableScriptHost # EnableScriptHost
51+
EnableDotNetStrongCrypto # DisableDotNetStrongCrypto
52+
# EnableMeltdownCompatFlag # DisableMeltdownCompatFlag
53+
EnableF8BootMenu # DisableF8BootMenu
54+
# DisableBootRecovery # EnableBootRecovery
55+
# DisableRecoveryAndReset # EnableRecoveryAndReset
56+
SetDEPOptOut # SetDEPOptIn
57+
58+
### Network Tweaks ###
59+
SetCurrentNetworkPrivate # SetCurrentNetworkPublic
60+
# SetUnknownNetworksPrivate # SetUnknownNetworksPublic
61+
# DisableNetDevicesAutoInst # EnableNetDevicesAutoInst
62+
# DisableHomeGroups # EnableHomeGroups
63+
# DisableSMB1 # EnableSMB1
64+
# DisableSMBServer # EnableSMBServer
65+
# DisableNetBIOS # EnableNetBIOS
66+
# DisableLLMNR # EnableLLMNR
67+
# DisableLLDP # EnableLLDP
68+
# DisableLLTD # EnableLLTD
69+
# DisableMSNetClient # EnableMSNetClient
70+
# DisableQoS # EnableQoS
71+
# DisableIPv4 # EnableIPv4
72+
# DisableIPv6 # EnableIPv6
73+
# DisableNCSIProbe # EnableNCSIProbe
74+
# DisableConnectionSharing # EnableConnectionSharing
75+
DisableRemoteAssistance # EnableRemoteAssistance
76+
# EnableRemoteDesktop # DisableRemoteDesktop
77+
78+
### Service Tweaks ###
79+
# DisableUpdateMSRT # EnableUpdateMSRT
80+
# DisableUpdateDriver # EnableUpdateDriver
81+
EnableUpdateMSProducts # DisableUpdateMSProducts
82+
# DisableUpdateAutoDownload # EnableUpdateAutoDownload
83+
DisableUpdateRestart # EnableUpdateRestart
84+
DisableMaintenanceWakeUp # EnableMaintenanceWakeUp
85+
DisableSharedExperiences # EnableSharedExperiences
86+
# EnableClipboardHistory # DisableClipboardHistory
87+
DisableAutoplay # EnableAutoplay
88+
DisableAutorun # EnableAutorun
89+
# DisableRestorePoints # EnableRestorePoints
90+
# EnableStorageSense # DisableStorageSense
91+
# DisableDefragmentation # EnableDefragmentation
92+
# DisableSuperfetch # EnableSuperfetch
93+
# DisableIndexing # EnableIndexing
94+
# DisableSwapFile # EnableSwapFile
95+
# DisableRecycleBin # EnableRecycleBin
96+
EnableNTFSLongPaths # DisableNTFSLongPaths
97+
# DisableNTFSLastAccess # EnableNTFSLastAccess
98+
# SetBIOSTimeUTC # SetBIOSTimeLocal
99+
# EnableHibernation # DisableHibernation
100+
# DisableSleepButton # EnableSleepButton
101+
# DisableSleepTimeout # EnableSleepTimeout
102+
# DisableFastStartup # EnableFastStartup
103+
# DisableAutoRebootOnCrash # EnableAutoRebootOnCrash
104+
105+
### UI Tweaks ###
106+
DisableActionCenter # EnableActionCenter
107+
DisableLockScreen # EnableLockScreen
108+
# DisableLockScreenRS1 # EnableLockScreenRS1
109+
HideNetworkFromLockScreen # ShowNetworkOnLockScreen
110+
HideShutdownFromLockScreen # ShowShutdownOnLockScreen
111+
DisableLockScreenBlur # EnableLockScreenBlur
112+
# DisableAeroShake # EnableAeroShake
113+
DisableAccessibilityKeys # EnableAccessibilityKeys
114+
ShowTaskManagerDetails # HideTaskManagerDetails
115+
# ShowFileOperationsDetails # HideFileOperationsDetails
116+
# EnableFileDeleteConfirm # DisableFileDeleteConfirm
117+
# HideTaskbarSearch # ShowTaskbarSearchIcon # ShowTaskbarSearchBox
118+
HideTaskView # ShowTaskView
119+
# ShowSmallTaskbarIcons # ShowLargeTaskbarIcons
120+
# SetTaskbarCombineWhenFull # SetTaskbarCombineNever # SetTaskbarCombineAlways
121+
HideTaskbarPeopleIcon # ShowTaskbarPeopleIcon
122+
ShowTrayIcons # HideTrayIcons
123+
# ShowSecondsInTaskbar # HideSecondsFromTaskbar
124+
DisableSearchAppInStore # EnableSearchAppInStore
125+
DisableNewAppPrompt # EnableNewAppPrompt
126+
# HideRecentlyAddedApps # ShowRecentlyAddedApps
127+
# HideMostUsedApps # ShowMostUsedApps
128+
# SetControlPanelSmallIcons # SetControlPanelLargeIcons # SetControlPanelCategories
129+
DisableShortcutInName # EnableShortcutInName
130+
# HideShortcutArrow # ShowShortcutArrow
131+
SetVisualFXPerformance # SetVisualFXAppearance
132+
# EnableTitleBarColor # DisableTitleBarColor
133+
EnableDarkTheme # DisableDarkTheme
134+
# AddENKeyboard # RemoveENKeyboard
135+
# EnableNumlock # DisableNumlock
136+
# DisableEnhPointerPrecision # EnableEnhPointerPrecision
137+
# SetSoundSchemeNone # SetSoundSchemeDefault
138+
# DisableStartupSound # EnableStartupSound
139+
# DisableChangingSoundScheme # EnableChangingSoundScheme
140+
# EnableVerboseStatus # DisableVerboseStatus
141+
DisableF1HelpKey # EnableF1HelpKey
142+
143+
### Explorer UI Tweaks ###
144+
# ShowExplorerTitleFullPath # HideExplorerTitleFullPath
145+
ShowKnownExtensions # HideKnownExtensions
146+
ShowHiddenFiles # HideHiddenFiles
147+
# ShowSuperHiddenFiles # HideSuperHiddenFiles
148+
# ShowEmptyDrives # HideEmptyDrives
149+
# ShowFolderMergeConflicts # HideFolderMergeConflicts
150+
EnableNavPaneExpand # DisableNavPaneExpand
151+
# ShowNavPaneAllFolders # HideNavPaneAllFolders
152+
# EnableFldrSeparateProcess # DisableFldrSeparateProcess
153+
# EnableRestoreFldrWindows # DisableRestoreFldrWindows
154+
# ShowEncCompFilesColor # HideEncCompFilesColor
155+
# DisableSharingWizard # EnableSharingWizard
156+
# HideSelectCheckboxes # ShowSelectCheckboxes
157+
HideSyncNotifications # ShowSyncNotifications
158+
HideRecentShortcuts # ShowRecentShortcuts
159+
# SetExplorerThisPC # SetExplorerQuickAccess
160+
HideQuickAccess # ShowQuickAccess
161+
# HideRecycleBinFromDesktop # ShowRecycleBinOnDesktop
162+
ShowThisPCOnDesktop # HideThisPCFromDesktop
163+
# ShowUserFolderOnDesktop # HideUserFolderFromDesktop
164+
# ShowControlPanelOnDesktop # HideControlPanelFromDesktop
165+
# ShowNetworkOnDesktop # HideNetworkFromDesktop
166+
# ShowBuildNumberOnDesktop # HideBuildNumberFromDesktop
167+
# HideDesktopFromThisPC # ShowDesktopInThisPC
168+
# HideDesktopFromExplorer # ShowDesktopInExplorer
169+
# HideDocumentsFromThisPC # ShowDocumentsInThisPC
170+
# HideDocumentsFromExplorer # ShowDocumentsInExplorer
171+
# HideDownloadsFromThisPC # ShowDownloadsInThisPC
172+
# HideDownloadsFromExplorer # ShowDownloadsInExplorer
173+
HideMusicFromThisPC # ShowMusicInThisPC
174+
# HideMusicFromExplorer # ShowMusicInExplorer
175+
HidePicturesFromThisPC # ShowPicturesInThisPC
176+
# HidePicturesFromExplorer # ShowPicturesInExplorer
177+
HideVideosFromThisPC # ShowVideosInThisPC
178+
# HideVideosFromExplorer # ShowVideosInExplorer
179+
Hide3DObjectsFromThisPC # Show3DObjectsInThisPC
180+
# Hide3DObjectsFromExplorer # Show3DObjectsInExplorer
181+
# HideIncludeInLibraryMenu # ShowIncludeInLibraryMenu
182+
# HideGiveAccessToMenu # ShowGiveAccessToMenu
183+
# HideShareMenu # ShowShareMenu
184+
# DisableThumbnails # EnableThumbnails
185+
DisableThumbnailCache # EnableThumbnailCache
186+
DisableThumbsDBOnNetwork # EnableThumbsDBOnNetwork
187+
188+
### Application Tweaks ###
189+
DisableOneDrive # EnableOneDrive
190+
UninstallOneDrive # InstallOneDrive
191+
UninstallMsftBloat # InstallMsftBloat
192+
UninstallThirdPartyBloat # InstallThirdPartyBloat
193+
# UninstallWindowsStore # InstallWindowsStore
194+
DisableXboxFeatures # EnableXboxFeatures
195+
# DisableFullscreenOptims # EnableFullscreenOptims
196+
# DisableAdobeFlash # EnableAdobeFlash
197+
DisableEdgePreload # EnableEdgePreload
198+
DisableEdgeShortcutCreation # EnableEdgeShortcutCreation
199+
DisableIEFirstRun # EnableIEFirstRun
200+
DisableFirstLogonAnimation # EnableFirstLogonAnimation
201+
DisableMediaSharing # EnableMediaSharing
202+
# UninstallMediaPlayer # InstallMediaPlayer
203+
# UninstallInternetExplorer # InstallInternetExplorer
204+
# UninstallWorkFolders # InstallWorkFolders
205+
# UninstallPowerShellV2 # InstallPowerShellV2
206+
# InstallLinuxSubsystem # UninstallLinuxSubsystem
207+
# InstallHyperV # UninstallHyperV
208+
# InstallNET23 # UninstallNET23
209+
SetPhotoViewerAssociation # UnsetPhotoViewerAssociation
210+
AddPhotoViewerOpenWith # RemovePhotoViewerOpenWith
211+
# UninstallPDFPrinter # InstallPDFPrinter
212+
UninstallXPSPrinter # InstallXPSPrinter
213+
RemoveFaxPrinter # AddFaxPrinter
214+
# UninstallFaxAndScan # InstallFaxAndScan
215+
216+
### Server Specific Tweaks ###
217+
# HideServerManagerOnLogin # ShowServerManagerOnLogin
218+
# DisableShutdownTracker # EnableShutdownTracker
219+
# DisablePasswordPolicy # EnablePasswordPolicy
220+
# DisableCtrlAltDelLogin # EnableCtrlAltDelLogin
221+
# DisableIEEnhancedSecurity # EnableIEEnhancedSecurity
222+
# EnableAudio # DisableAudio
223+
224+
### Unpinning ###
225+
# UnpinStartMenuTiles
226+
# UnpinTaskbarIcons
227+
228+
### Auxiliary Functions ###
229+
# WaitForKey
230+
# Restart

src/config/npm.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm-check

src/config/optimizer.config

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"WindowsVersion": 10,
3+
"DisableCloudClipboard": false,
4+
"EnableLegacyVolumeSlider": false,
5+
"EnableTaskbarColor": false,
6+
"DisableQuickAccessHistory": false,
7+
"DisableStartMenuAds": false,
8+
"EnableDarkTheme": true,
9+
"UninstallOneDrive": false,
10+
"DisableMyPeople": false,
11+
"DisableAutomaticUpdates": false,
12+
"ExcludeDrivers": false,
13+
"DisableTelemetryServices": true,
14+
"DisablePrivacyOptions": false,
15+
"DisableSilentAppInstall": false,
16+
"DisableCortana": false,
17+
"DisableSensorServices": false,
18+
"DisableWindowsInk": false,
19+
"DisableSpellingTyping": false,
20+
"DisableXboxLive": true,
21+
"DisableGameBar": true,
22+
"DisableInsiderService": false,
23+
"DisableFeatureUpdates": false,
24+
"EnableLongPaths": false
25+
}

src/lib/chocolatey.bat

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ rem Chocolatey action functions
44
set batdir=%~dp0
55
set batfile=%0
66
set cliCmd=%batdir%cli.bat
7+
set configCmd=%batdir%config.bat
78
set chocolateyInstallUrl=https://chocolatey.org/install.ps1
89

910
if "%~1" neq "" (
1011
2>nul >nul findstr /rc:"^ *:%~1\>" "%~f0" && (
1112
shift /1
1213
goto %1
1314
) || (
14-
>&2 call %cliCmd% error "Function %~1 not found in %batfile%"
15+
>&2 call %cliCmd% fatalError "Function %~1 not found in %batfile%"
1516
)
16-
) else >&2 call %cliCmd% error "No function name was given to %batfile%"
17+
) else >&2 call %cliCmd% fatalError "No function name was given to %batfile%"
1718
exit /b
1819

1920
:executeChocolatey
@@ -30,21 +31,14 @@ exit /b
3031
call %cliCmd% success "Chocolatey has been installed"
3132
)
3233

34+
set configPath=
35+
call %configCmd% useConfig "chocolatey" %1
36+
3337
rem Install Chocolatey packages
34-
set userAnswer=
35-
call %cliCmd% prompt "If you want to install packages, please give the chocolatey config path: "
36-
if "%userAnswer%" == "" (
37-
call %cliCmd% success "No chocolatey config path given"
38-
) else (
39-
call %cliCmd% processing "Installing Chocolatey packages from config file ^!userAnswer^!"
40-
if exist !userAnswer! (
41-
call %cliCmd% execCmd "choco install --confirm --packages ^!userAnswer^!"
42-
echo .
43-
call %cliCmd% success "Installation of Chocolatey packages is done"
44-
) else (
45-
call %cliCmd% error "Config file ^!userAnswer^! does not exist"
46-
)
47-
)
38+
call %cliCmd% processing "Installing Chocolatey packages from config file ^!configPath^!"
39+
call %cliCmd% execCmd "choco install --confirm --packages ^!configPath^!"
40+
echo .
41+
call %cliCmd% success "Installation of Chocolatey packages is done"
4842

4943
endlocal
5044
exit /b

src/lib/cleaner.bat

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ rem Cleaner action functions
22
@echo off
33

44
set batdir=%~dp0
5+
set batfile=%0
56
set cliCmd=%batdir%cli.bat
67
set ccleanerExePath="%programfiles%\CCleaner\ccleaner.exe"
78

@@ -10,9 +11,9 @@ if "%~1" neq "" (
1011
shift /1
1112
goto %1
1213
) || (
13-
>&2 call %cliCmd% error "Function %~1 not found in %batfile%"
14+
>&2 call %cliCmd% fatalError "Function %~1 not found in %batfile%"
1415
)
15-
) else >&2 call %cliCmd% error "No function name was given to %batfile%"
16+
) else >&2 call %cliCmd% fatalError "No function name was given to %batfile%"
1617
exit /b
1718

1819
:uninstallSoftwares
@@ -22,8 +23,9 @@ exit /b
2223
for /F "skip=2 tokens=2-3 delims=," %%a in ('wmic product get name^,version /format:csv') do (
2324
set name=%%a
2425

26+
set errorlevel=
2527
call %cliCmd% confirmPrompt "Do you want to uninstall ^!name^!",n
26-
if !ERRORLEVEL!==0 (
28+
if !errorlevel!==0 (
2729
call :uninstallSoftware "^!name^!"
2830
)
2931
)
@@ -71,8 +73,9 @@ exit /b
7173
) else if not defined location (
7274
set shouldCall=
7375
) else (
76+
set errorlevel=
7477
call %cliCmd% confirmPrompt "Do you want to delete startup entry ^!caption^!",n
75-
if !ERRORLEVEL!==0 (
78+
if !errorlevel!==0 (
7679
call :deleteStartupEntry "^!caption^!", "^!command^!", "^!location^!"
7780
)
7881
set caption=

0 commit comments

Comments
 (0)