# Automated Setup Script for Windows 11 # 1. Disable EdgeUI New-Item -Path "HKLM:\Software\Policies\Microsoft\Windows\EdgeUI" -Force New-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\EdgeUI" -Name "AllowEdgeSwipe" -Value 0 -PropertyType DWord Write-Host "EdgeUI Disabled." # 2. Setup Unity Apps - Create workspace directory New-Item -ItemType Directory -Path "C:\workspace" -Force Write-Host "Workspace folder created at C:\workspace. Please copy Unity project files into this directory." # 3. Disable 3-Finger Gestures New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PrecisionTouchPad" -Force Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PrecisionTouchPad" -Name "ThreeFingerTapEnabled" -Value 0 Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PrecisionTouchPad" -Name "ThreeFingerSlideEnabled" -Value 0 Write-Host "3-Finger gestures disabled." # 4. Disable Windows Updates Stop-Service -Name "wuauserv" -Force Set-Service -Name "wuauserv" -StartupType Disabled Write-Host "Windows Update service stopped and disabled." # 5. Enable Auto Login # Replace 'YourUsername' and 'YourPassword' with the actual username and password $Username = “borabora” $Password = “sunnybeach2020” $RegistryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" Set-ItemProperty -Path $RegistryPath -Name "AutoAdminLogon" -Value "1" Set-ItemProperty -Path $RegistryPath -Name "DefaultUsername" -Value $Username Set-ItemProperty -Path $RegistryPath -Name "DefaultPassword" -Value $Password Write-Host "Auto-login enabled for user $Username." # 6. Enable Auto Login with Username and Password Prompt $RegistryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" $attempts = 0 $maxAttempts = 3 $autoLoginSet = $false # Function to set registry keys for auto-login function Set-AutoLogin { param ( [string]$Username, [string]$Password ) try { Set-ItemProperty -Path $RegistryPath -Name "AutoAdminLogon" -Value "1" -Force Set-ItemProperty -Path $RegistryPath -Name "DefaultUsername" -Value $Username -Force Set-ItemProperty -Path $RegistryPath -Name "DefaultPassword" -Value $Password -Force return $true } catch { Write-Host "Error: Failed to set auto-login properties. Please try again." return $false } } # Prompt user for Username and Password with retry logic while ($attempts -lt $maxAttempts -and -not $autoLoginSet) { # Prompt for credentials $Username = Read-Host -Prompt "Enter the Username for Auto Login" $Password = Read-Host -Prompt "Enter the Password for Auto Login" -AsSecureString $PlainTextPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password)) # Attempt to set auto-login with provided credentials $autoLoginSet = Set-AutoLogin -Username $Username -Password $PlainTextPassword # Increment attempt counter if auto-login wasn't set if (-not $autoLoginSet) { $attempts++ Write-Host "Incorrect username or password. Attempts remaining: $($maxAttempts - $attempts)" } } # If auto-login couldn't be set, open netplwiz for manual setup if (-not $autoLoginSet) { Write-Host "Failed to set auto-login after $maxAttempts attempts. Opening netplwiz for manual setup." # Open netplwiz for manual configuration Start-Process "netplwiz" # Display instructions Write-Host "`nManual Auto-Login Instructions:" Write-Host "1. In the User Accounts window, select the username for auto-login." Write-Host "2. Uncheck 'Users must enter a username and password to use this computer.'" Write-Host "3. Click 'Apply' and enter the password when prompted." Write-Host "4. Click 'OK' to save and close the window." } Write-Host "Continuing with the rest of the setup..." # 7. Add BoraBora Background Invoke-WebRequest -Uri "https://drive.google.com/uc?id=1XOcUus13Nc1csqTAYd3TVf_EFWNN4f4f" -OutFile "C:\Users\Public\Pictures\BoraBora.jpg" $WallpaperPath = "C:\Users\Public\Pictures\BoraBora.jpg" Add-Type -TypeDefinition @" using System; using System.Runtime.InteropServices; public class Wallpaper { [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern int SystemParametersInfo (int uAction, int uParam, string lpvParam, int fuWinIni); } "@ [Wallpaper]::SystemParametersInfo(0x0014, 0, $WallpaperPath, 0x0001) Write-Host "Desktop background set to BoraBora image." # 8. Install TeamViewer $DownloadFolder = "C:\TeamViewer" $DownloadPath = "$DownloadFolder\TeamViewerSetup.exe" $TeamViewerUrl = "http://teamviewer.studioborabora.com/" # Function to create download folder and download the TeamViewer setup file function Download-TeamViewer { if (-not (Test-Path -Path $DownloadFolder)) { New-Item -ItemType Directory -Path $DownloadFolder -Force Write-Host "Created folder at $DownloadFolder for TeamViewer download." } try { # Start download and open the URL in the default browser Start-Process -FilePath $TeamViewerUrl Invoke-WebRequest -Uri $TeamViewerUrl -OutFile $DownloadPath -ErrorAction Stop Write-Host "TeamViewer setup started downloading to $DownloadPath." return $true } catch { Write-Host ("Failed to download TeamViewer to " + $DownloadPath + ": " + $_.Exception.Message) return $false } } # Function to check if file download is complete by monitoring file size stability function Wait-ForDownloadCompletion { param ( [string]$FilePath, [int]$TimeoutSeconds = 60 ) $isDownloaded = $false $timeout = (Get-Date).AddSeconds($TimeoutSeconds) $previousSize = -1 while ((Get-Date) -lt $timeout) { if (Test-Path -Path $FilePath) { $currentSize = (Get-Item $FilePath).Length if ($currentSize -eq $previousSize) { $isDownloaded = $true break } else { $previousSize = $currentSize Start-Sleep -Seconds 2 # Wait 2 seconds before checking size again } } else { Start-Sleep -Seconds 2 # Wait for the file to appear if it hasn't yet } } return $isDownloaded } # Download the TeamViewer setup file if (-not (Download-TeamViewer)) { Write-Host "Error: Download attempt failed. Please download manually from the opened browser window." } else { # Wait for download to complete if (Wait-ForDownloadCompletion -FilePath $DownloadPath) { try { # Install TeamViewer silently if download completed Start-Process -FilePath $DownloadPath -ArgumentList "/S" -Wait -ErrorAction Stop Write-Host "TeamViewer installed successfully." } catch { Write-Host ("Failed to install TeamViewer: " + $_.Exception.Message) } } else { Write-Host "Error: TeamViewer setup file not fully downloaded. Please download and install manually." } } Write-Host "Setup complete. Please review settings to confirm changes."