This commit is contained in:
Michael H.G. Schmidt 2021-01-12 17:01:34 +01:00
parent 9cd831d39f
commit a9af282683
11 changed files with 243 additions and 202 deletions

View File

@ -1,15 +1,12 @@
@echo off
set T=c:\TEMP
rem this script puts everything in place ...
set TOOLS=c:\tools
set SCRIPTS=%TOOLS%\scripts
echo ####### %0 #######
rem echo DISABLE firewall ...
rem netsh advfirewall set allprofiles state off
echo creating TEMP directory ...
mkdir %T% 1>nul 2>nul
echo killing ssh agent ...
taskkill /F /IM ssh-agent.exe
taskkill /F /IM ssh.exe
@ -20,12 +17,9 @@ taskkill /F /IM explorer.exe & start explorer.exe
echo deleting %TOOLS% ...
rd /S /Q %TOOLS%
echo copying folder tools to %TOOLS% ...
echo copying folder %TOOLS% ...
robocopy tools %TOOLS% /MIR /256 /NJH /NFL /NDL
rem cd to scripts folder ...
cd scripts
echo unpacking BGInfo ...
%TOOLS%\7z x -aoa -o%TOOLS% %TOOLS%\BGInfo.zip
del /F %TOOLS%\BGInfo.zip 1>nul 2>nul
@ -46,96 +40,8 @@ echo unpacking MediaCreationTool ...
%TOOLS%\7z x -aoa -o%TOOLS% %TOOLS%\MediaCreationTool20H2.zip
del /F %TOOLS%\MediaCreationTool20H2.zip 1>nul 2>nul
echo installing GIT ...
call install-git.cmd
echo setting GIT_EDITOR variable (all users) ...
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" ^
/v GIT_EDITOR ^
/t REG_EXPAND_SZ ^
/d "%TOOLS%\vim.exe" ^
/f
echo setting GIT_SSH variable (all users) ...
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" ^
/v GIT_SSH ^
/t REG_EXPAND_SZ ^
/d "%TOOLS%\usr\bin\ssh.exe" ^
/f
rem copy files in deploy folder to tools directory ...
copy /Y deploy\* %TOOLS%
rem create directories for current user ...
mkdir %USERPROFILE%\workspace 1>nul 2>nul
mkdir %USERPROFILE%\.ssh 1>nul 2>nul
copy /Y %TOOLS%\ssh_config %USERPROFILE%\.ssh\config
rem installing startup links ...
call install-logonscript.cmd
rem installing desktop icons ...
call install-desktopicons.cmd
rem installing tweaks ...
call install-tweaks.cmd
rem changing power configuration ...
call install-powertweaks.cmd
rem uninstall OneDrive completely ...
call uninstall-onedrive.cmd
rem uninstall Edge completely ...
call uninstall-edge.cmd
rem allow execution of any powershell script ...
powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine"
powershell -Command ^
"$T=Get-ExecutionPolicy ; if ($T -eq 'Bypass') { ^
write-host 'POWERSHELL: Execution Policy was set to BYPASS' ^
} ^
else { ^
write-host 'ERROR: CANNOT SET Execution Policy to BYPASS !' ^
}"
echo.
rem uninstall some Apps (but keep the store) ...
powershell -Command .\uninstall-apps.ps1
echo setting PATH variable (all users) ...
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" ^
/v PATH ^
/t REG_EXPAND_SZ ^
/d "%SYSTEMROOT%;%SYSTEMROOT%\system32;%SYSTEMROOT%\system32\wbem;%SYSTEMROOT%\system32\WindowsPowerShell\v1.0;%TOOLS%;%TOOLS%\git\bin;%TOOLS%\git\usr\bin;%TOOLS%\notepad++" ^
/f
rem install openshell (fuck you microsoft) ...
call install-openshell.cmd
rem install Mozilla Firefox (fuck you google) ...
call install-firefox.cmd
rem install F-Secure Antivirus ...
call install-antivir.cmd
rem disable autologon for support user ...
call disable-autologon.cmd
rem disable logon screen background ...
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System" ^
/v DisableLogonBackgroundImage ^
/t REG_DWORD /d 1 /f
rem this must be done as late as possible ... stupid os problem
echo cleanup startmenu and tiles ...
powershell -Command .\cleanup-tiles.ps1
call cleanup-startmenu.cmd
rem echo ENABLE firewall ...
rem netsh advfirewall set allprofiles state on
echo ####### %0 #######
echo READY.
pause
echo.
call %SCRIPTS%\CustomSetup2.cmd

View File

@ -52,12 +52,17 @@ if EXIST %SOURCES%\install_FINAL.esd (
move /Y %SOURCES%\install_FINAL.esd %SOURCES%\install_FINAL_copy.esd
)
for %%P in (tools software scripts) do (
echo.
if EXIST tools (
echo copying folder tools to drive %USBDRIVE% ...
robocopy tools %USBDRIVE%\tools /COPY:DT /FFT /XO /MIR /256 /NJH /NJS /NDL /XF .gitignore
)
for %%P in (software scripts) do (
if EXIST %%P (
echo.
echo copying folder %%P to drive %USBDRIVE% ...
robocopy %%P %USBDRIVE%\%%P /COPY:DT /FFT /XO /MIR /256 /NJH /NJS /NDL /XF .gitignore
del /F %USBDRIVE%\%%P\.gitignore 1>nul 2>nul
echo copying folder %%P to drive %USBDRIVE%\tools ...
robocopy %%P %USBDRIVE%\tools\%%P /COPY:DT /FFT /XO /MIR /256 /NJH /NJS /NDL /XF .gitignore
)
)

116
scripts/CustomSetup2.cmd Normal file
View File

@ -0,0 +1,116 @@
@echo off
rem this script is doing most of the work ...
set T=c:\TEMP
set TOOLS=c:\tools
set SCRIPTS=%TOOLS%\scripts
echo ####### %0 #######
echo creating %T% ...
mkdir %T% 1>nul 2>nul
echo cd to %SCRIPTS% ...
cd /D %SCRIPTS%
echo moving files in deploy folder to %TOOLS% ...
move /Y deploy\* %TOOLS% 1>nul 2>nul
rmdir deploy 1>nul 2>nul
rem #######################
rem ### GLOBAL settings ###
rem #######################
rem echo DISABLE firewall ...
rem netsh advfirewall set allprofiles state off
rem allow execution of any powershell script ...
powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine"
powershell -Command ^
"$T=Get-ExecutionPolicy ; if ($T -eq 'Bypass') { ^
write-host 'POWERSHELL: Execution Policy was set to BYPASS' ^
} ^
else { ^
write-host 'ERROR: CANNOT SET Execution Policy to BYPASS !' ^
}"
echo.
echo setting PATH variable ( for all users) ...
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" ^
/v PATH ^
/t REG_EXPAND_SZ ^
/d "%SYSTEMROOT%;%SYSTEMROOT%\system32;%SYSTEMROOT%\system32\wbem;%SYSTEMROOT%\system32\WindowsPowerShell\v1.0;%TOOLS%;%TOOLS%\git\bin;%TOOLS%\git\usr\bin;%TOOLS%\notepad++" ^
/f
rem changing power configuration ...
call modify-powersettings.cmd
rem installing tweaks ...
call install-tweaks.cmd
rem #######################
rem ### UNINSTALL tasks ###
rem #######################
echo uninstall ALL Apps (but keep the store) ...
powershell -Command .\uninstall-apps.ps1
rem uninstall OneDrive completely ...
call uninstall-onedrive.cmd
rem uninstall Edge completely ...
call uninstall-edge.cmd
rem #####################
rem ### INSTALL tasks ###
rem #####################
rem install logon script ...
call install-logonscript.cmd
rem install desktop icons ...
call install-desktopicons.cmd
rem install GIT ...
call install-git.cmd
rem install openshell (fuck you microsoft) ...
call install-openshell.cmd
rem install Mozilla Firefox (fuck you google) ...
call install-firefox.cmd
rem install F-Secure Antivirus ...
call install-antivir.cmd
rem #####################
rem ### DISABLE tasks ###
rem #####################
echo disabling logon screen background ...
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System" ^
/v DisableLogonBackgroundImage ^
/t REG_DWORD /d 1 /f
rem disable autologon for support user ...
call disable-autologon.cmd
rem #####################
rem ### CLEANUP tasks ###
rem #####################
rem this must be done as late as possible ... stupid os problem
echo cleanup all the tiles ...
powershell -Command .\cleanup-tiles.ps1
rem this one cleans the startmenu and removes dead entries ... stupid os problem #2
call cleanup-startmenu.cmd
rem echo ENABLE firewall ...
rem netsh advfirewall set allprofiles state on
echo ####### %0 #######
echo READY.
pause

View File

@ -1,2 +1,2 @@
pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0);

View File

@ -1,75 +1,75 @@
// Mozilla GLOBAL Preferences
//
defaultPref("app.normandy.first_run", false);
defaultPref("app.shield.optoutstudies.enabled", false);
lockPref("app.update.service.enabled", false);
defaultPref("browser.bookmarks.restore_default_bookmarks", false);
defaultPref("browser.contentblocking.category", "standard");
defaultPref("browser.ctrlTab.recentlyUsedOrder", false);
lockPref("browser.download.useDownloadDir", false);
defaultPref("browser.download.viewableInternally.typeWasRegistered.svg", true);
defaultPref("browser.download.viewableInternally.typeWasRegistered.webp", true);
defaultPref("browser.download.viewableInternally.typeWasRegistered.xml", true);
lockPref("browser.formfill.enable", false);
defaultPref("browser.laterrun.enabled", true);
defaultPref("browser.launcherProcess.enabled", true);
defaultPref("browser.messaging-system.whatsNewPanel.enabled", false);
lockPref("browser.newtabpage.activity-stream.feeds.section.highlights", false);
lockPref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
lockPref("browser.newtabpage.activity-stream.feeds.snippets", false);
lockPref("browser.newtabpage.activity-stream.feeds.topsites", false);
lockPref("browser.newtabpage.activity-stream.section.highlights.includeBookmarks", false);
lockPref("browser.newtabpage.activity-stream.section.highlights.includeDownloads", false);
lockPref("browser.newtabpage.activity-stream.section.highlights.includePocket", false);
lockPref("browser.newtabpage.activity-stream.section.highlights.includeVisited", false);
defaultPref("browser.newtabpage.activity-stream.showSponsored", false);
defaultPref("browser.newtabpage.enabled", true);
defaultPref("browser.privatebrowsing.autostart", false);
defaultPref("browser.search.region", "DE");
lockPref("browser.search.suggest.enabled", false);
defaultPref("browser.shell.checkDefaultBrowser", false);
defaultPref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun", true);
lockPref("browser.startup.homepage", "exabyte.systems");
defaultPref("browser.tabs.warnOnClose", false);
lockPref("browser.urlbar.suggest.bookmark", false);
lockPref("browser.urlbar.suggest.history", false);
lockPref("browser.urlbar.suggest.openpage", false);
lockPref("browser.urlbar.suggest.searches", false);
lockPref("browser.urlbar.suggest.topsites", false);
defaultPref("datareporting.healthreport.uploadEnabled", false);
lockPref("extensions.update.autoUpdateDefault", false);
defaultPref("layout.spellcheckDefault", 0);
lockPref("network.cookie.lifetimePolicy", 0);
defaultPref("permissions.default.camera", 2);
defaultPref("permissions.default.desktop-notification", 2);
defaultPref("permissions.default.geo", 2);
defaultPref("permissions.default.microphone", 2);
defaultPref("permissions.default.xr", 2);
defaultPref("pref.general.disable_button.default_browser", false);
defaultPref("pref.privacy.disable_button.cookie_exceptions", false);
lockPref("places.history.enabled", false);
lockPref("privacy.clearOnShutdown.cache", true);
lockPref("privacy.clearOnShutdown.cookies", false);
lockPref("privacy.clearOnShutdown.downloads", true);
lockPref("privacy.clearOnShutdown.formdata", true);
lockPref("privacy.clearOnShutdown.history", true);
lockPref("privacy.clearOnShutdown.offlineApps", true);
lockPref("privacy.clearOnShutdown.sessions", true);
lockPref("privacy.clearOnShutdown.siteSettings", false);
lockPref("privacy.history.custom", true);
lockPref("privacy.sanitize.sanitizeOnShutdown", true);
lockPref("privacy.cpd.offlineApps", true);
lockPref("privacy.cpd.siteSettings", true);
defaultPref("sanity-test.advanced-layers", true);
defaultPref("sanity-test.running", false);
defaultPref("sanity-test.webrender.force-disabled", false);
lockPref("signon.autofillForms", false);
lockPref("signon.generation.enabled", false);
lockPref("signon.management.page.breach-alerts.enabled", false);
lockPref("signon.rememberSignons", false);
lockPref("signon.usage.hasEntry", false);
defaultPref("toolkit.telemetry.pioneer-new-studies-available", false);
defaultPref("toolkit.telemetry.reportingpolicy.firstRun", false);
defaultPref("trailhead.firstrun.didSeeAboutWelcome", true);
// Mozilla GLOBAL Preferences
//
defaultPref("app.normandy.first_run", false);
defaultPref("app.shield.optoutstudies.enabled", false);
lockPref("app.update.service.enabled", false);
defaultPref("browser.bookmarks.restore_default_bookmarks", false);
defaultPref("browser.contentblocking.category", "standard");
defaultPref("browser.ctrlTab.recentlyUsedOrder", false);
lockPref("browser.download.useDownloadDir", false);
defaultPref("browser.download.viewableInternally.typeWasRegistered.svg", true);
defaultPref("browser.download.viewableInternally.typeWasRegistered.webp", true);
defaultPref("browser.download.viewableInternally.typeWasRegistered.xml", true);
lockPref("browser.formfill.enable", false);
defaultPref("browser.laterrun.enabled", true);
defaultPref("browser.launcherProcess.enabled", true);
defaultPref("browser.messaging-system.whatsNewPanel.enabled", false);
lockPref("browser.newtabpage.activity-stream.feeds.section.highlights", false);
lockPref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
lockPref("browser.newtabpage.activity-stream.feeds.snippets", false);
lockPref("browser.newtabpage.activity-stream.feeds.topsites", false);
lockPref("browser.newtabpage.activity-stream.section.highlights.includeBookmarks", false);
lockPref("browser.newtabpage.activity-stream.section.highlights.includeDownloads", false);
lockPref("browser.newtabpage.activity-stream.section.highlights.includePocket", false);
lockPref("browser.newtabpage.activity-stream.section.highlights.includeVisited", false);
defaultPref("browser.newtabpage.activity-stream.showSponsored", false);
defaultPref("browser.newtabpage.enabled", true);
defaultPref("browser.privatebrowsing.autostart", false);
defaultPref("browser.search.region", "DE");
lockPref("browser.search.suggest.enabled", false);
defaultPref("browser.shell.checkDefaultBrowser", false);
defaultPref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun", true);
lockPref("browser.startup.homepage", "exabyte.systems");
defaultPref("browser.tabs.warnOnClose", false);
lockPref("browser.urlbar.suggest.bookmark", false);
lockPref("browser.urlbar.suggest.history", false);
lockPref("browser.urlbar.suggest.openpage", false);
lockPref("browser.urlbar.suggest.searches", false);
lockPref("browser.urlbar.suggest.topsites", false);
defaultPref("datareporting.healthreport.uploadEnabled", false);
lockPref("extensions.update.autoUpdateDefault", false);
defaultPref("layout.spellcheckDefault", 0);
lockPref("network.cookie.lifetimePolicy", 0);
defaultPref("permissions.default.camera", 2);
defaultPref("permissions.default.desktop-notification", 2);
defaultPref("permissions.default.geo", 2);
defaultPref("permissions.default.microphone", 2);
defaultPref("permissions.default.xr", 2);
defaultPref("pref.general.disable_button.default_browser", false);
defaultPref("pref.privacy.disable_button.cookie_exceptions", false);
lockPref("places.history.enabled", false);
lockPref("privacy.clearOnShutdown.cache", true);
lockPref("privacy.clearOnShutdown.cookies", false);
lockPref("privacy.clearOnShutdown.downloads", true);
lockPref("privacy.clearOnShutdown.formdata", true);
lockPref("privacy.clearOnShutdown.history", true);
lockPref("privacy.clearOnShutdown.offlineApps", true);
lockPref("privacy.clearOnShutdown.sessions", true);
lockPref("privacy.clearOnShutdown.siteSettings", false);
lockPref("privacy.history.custom", true);
lockPref("privacy.sanitize.sanitizeOnShutdown", true);
lockPref("privacy.cpd.offlineApps", true);
lockPref("privacy.cpd.siteSettings", true);
defaultPref("sanity-test.advanced-layers", true);
defaultPref("sanity-test.running", false);
defaultPref("sanity-test.webrender.force-disabled", false);
lockPref("signon.autofillForms", false);
lockPref("signon.generation.enabled", false);
lockPref("signon.management.page.breach-alerts.enabled", false);
lockPref("signon.rememberSignons", false);
lockPref("signon.usage.hasEntry", false);
defaultPref("toolkit.telemetry.pioneer-new-studies-available", false);
defaultPref("toolkit.telemetry.reportingpolicy.firstRun", false);
defaultPref("trailhead.firstrun.didSeeAboutWelcome", true);

View File

@ -1,9 +1,9 @@
ControlMaster=auto
ControlPersist=60s
ServerAliveInterval=30
StrictHostKeyChecking=no
UpdateHostKeys=no
CheckHostIP=no
UserKnownHostsFile=/dev/null
LogLevel=ERROR
ControlMaster=auto
ControlPersist=60s
ServerAliveInterval=30
StrictHostKeyChecking=no
UpdateHostKeys=no
CheckHostIP=no
UserKnownHostsFile=/dev/null
LogLevel=ERROR

View File

@ -1,5 +1,4 @@
@echo off
set TOOLS=c:\tools
echo ####### %0 #######
@ -20,7 +19,7 @@ reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Hi
rem refresh desktop (W10 style)
ie4uinit.exe -show
echo remove wallpaper ...
echo removing wallpaper ...
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallPaper /t REG_SZ /d " " /f
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
@ -30,6 +29,11 @@ echo set desktop colour ...
echo starting BGInfo ...
%TOOLS%\bginfo\bginfo64.exe %TOOLS%\bginfo\config.bgi /NOLICPROMPT /silent /timer:0
echo creating some directories and files for current user ...
mkdir %USERPROFILE%\workspace 1>nul 2>nul
mkdir %USERPROFILE%\.ssh 1>nul 2>nul
copy /Y %TOOLS%\scripts\config\ssh_config.txt %USERPROFILE%\.ssh\config
echo start workstation service ...
net start workstation 1>nul 2>nul
net config workstation

View File

@ -1,6 +1,6 @@
@echo off
set CONF=deploy\firefox
set CONF=config\firefox
set SCRIPTS=..\..\scripts
set SOFTWARE=..\software\firefox

View File

@ -1,7 +1,8 @@
@echo off
set CONFIG=install-git.txt
set CONFIG=config\install-git.txt
set EXE=..\software\Git-2.29.0-64-bit.exe
set TOOLS=c:\tools
echo ####### %0 #######
@ -12,5 +13,19 @@ taskkill /F /IM ssh.exe
echo installing GIT ...
%EXE% /LOADINF=%CONFIG% /NORESTART /NOCANCEL /SILENT /SUPPRESSMSGBOXES /CLOSEAPPLICATIONS
echo setting GIT_EDITOR variable (all users) ...
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" ^
/v GIT_EDITOR ^
/t REG_EXPAND_SZ ^
/d "%TOOLS%\vim.exe" ^
/f
echo setting GIT_SSH variable (all users) ...
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" ^
/v GIT_SSH ^
/t REG_EXPAND_SZ ^
/d "%TOOLS%\usr\bin\ssh.exe" ^
/f
echo ####### %0 #######

View File

@ -1,6 +1,4 @@
@echo off
set SOURCE=deploy/logon.cmd
set TOOLS=c:\tools
set TARGET="%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Startup"
@ -10,10 +8,7 @@ rem cleanup ...
del /Q /F %TARGET%\logon* 1>nul 2>nul
del /Q /F %TOOLS%\logon.cmd 1>nul 2>nul
echo copy logon.cmd to %TOOLS% ...
copy /Y %SOURCE% %TOOLS%
echo create link for logon script...
echo creating link for logon script...
mklink %TARGET%\logon.cmd %TOOLS%\logon.cmd
echo create link on desktop...