├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── powershell-analysis.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── SECURITY.md ├── Steps ├── GPUDownloaderTool.ps1 ├── step1.ps1 ├── step2.ps1 └── step3.ps1 ├── bin └── sunshine.ico ├── starthere.ps1 └── welcome.ps1 /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: If you encountered an error while using the script 4 | title: "[BUG]" 5 | labels: bug 6 | --- 7 | 8 | **Describe the bug** 9 | A clear and concise description of what the bug is. Include log files if you can. 10 | 11 | **How you got the bug** 12 | Write the steps to reproduce the behavior of the bug. 13 | Example: "During step three after choosing XYZ option..." 14 | 15 | **Add screenshots for more info** 16 | If applicable, add screenshots to help explain your problem. 17 | 18 | **Describe your cloud provider** 19 | This includes what version of Windows Server you are using and where it's hosted like GCP or AWS. 20 | 21 | **Additional context** 22 | Add any other context/info about the problem here. 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Suggestion 3 | about: If you want to suggest something to improve the script 4 | title: "[SUGGESTION]" 5 | labels: suggestion 6 | --- 7 | 8 | **Describe your suggestion** 9 | What do you want to see? 10 | 11 | **Why do you want to see it?** 12 | Does this help the average user? Is it a cosmetic change? 13 | 14 | **What step should it take place?** 15 | Your suggestion has to be ran when it makes sense to run it. 16 | 17 | **What cloud platforms does it work on?** 18 | If it's for a specific cloud platform, please write which one, or if it's all of them. 19 | 20 | **Additional context** 21 | Add any other context/info about the suggestion here. 22 | -------------------------------------------------------------------------------- /.github/workflows/powershell-analysis.yml: -------------------------------------------------------------------------------- 1 | # This workflow uses actions that are not certified by GitHub. 2 | # They are provided by a third-party and are governed by 3 | # separate terms of service, privacy policy, and support 4 | # documentation. 5 | # 6 | # https://github.com/microsoft/action-psscriptanalyzer 7 | # For more information on PSScriptAnalyzer in general, see 8 | # https://github.com/PowerShell/PSScriptAnalyzer 9 | 10 | name: PSScriptAnalyzer 11 | 12 | on: 13 | push: 14 | branches: [ main ] 15 | pull_request: 16 | branches: [ main ] 17 | schedule: 18 | - cron: '22 7 * * 2' 19 | 20 | jobs: 21 | build: 22 | name: PSScriptAnalyzer 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: actions/checkout@v2 26 | 27 | - name: Run PSScriptAnalyzer 28 | uses: microsoft/psscriptanalyzer-action@v1.1 29 | with: 30 | # Check https://github.com/microsoft/action-psscriptanalyzer for more info about the options. 31 | # The below set up runs PSScriptAnalyzer to your entire repository and runs some basic security rules. 32 | path: .\ 33 | recurse: true 34 | # Include your own basic security rules. Removing this option will run all the rules 35 | includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"' 36 | output: results.sarif 37 | 38 | # Upload the SARIF file generated in the previous step 39 | - name: Upload SARIF results file 40 | uses: github/codeql-action/upload-sarif@v2 41 | with: 42 | sarif_file: results.sarif 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_STORE -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement by opening an issue on GitHub. 63 | All complaints will be reviewed and investigated promptly and fairly. 64 | 65 | All community leaders are obligated to respect the privacy and security of the 66 | reporter of any incident. 67 | 68 | ## Enforcement Guidelines 69 | 70 | Community leaders will follow these Community Impact Guidelines in determining 71 | the consequences for any action they deem in violation of this Code of Conduct: 72 | 73 | ### 1. Correction 74 | 75 | **Community Impact**: Use of inappropriate language or other behavior deemed 76 | unprofessional or unwelcome in the community. 77 | 78 | **Consequence**: A private, written warning from community leaders, providing 79 | clarity around the nature of the violation and an explanation of why the 80 | behavior was inappropriate. A public apology may be requested. 81 | 82 | ### 2. Warning 83 | 84 | **Community Impact**: A violation through a single incident or series 85 | of actions. 86 | 87 | **Consequence**: A warning with consequences for continued behavior. No 88 | interaction with the people involved, including unsolicited interaction with 89 | those enforcing the Code of Conduct, for a specified period of time. This 90 | includes avoiding interactions in community spaces as well as external channels 91 | like social media. Violating these terms may lead to a temporary or 92 | permanent ban. 93 | 94 | ### 3. Temporary Ban 95 | 96 | **Community Impact**: A serious violation of community standards, including 97 | sustained inappropriate behavior. 98 | 99 | **Consequence**: A temporary ban from any sort of interaction or public 100 | communication with the community for a specified period of time. No public or 101 | private interaction with the people involved, including unsolicited interaction 102 | with those enforcing the Code of Conduct, is allowed during this period. 103 | Violating these terms may lead to a permanent ban. 104 | 105 | ### 4. Permanent Ban 106 | 107 | **Community Impact**: Demonstrating a pattern of violation of community 108 | standards, including sustained inappropriate behavior, harassment of an 109 | individual, or aggression toward or disparagement of classes of individuals. 110 | 111 | **Consequence**: A permanent ban from any sort of public interaction within 112 | the community. 113 | 114 | ## Attribution 115 | 116 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 117 | version 2.0, available at 118 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 119 | 120 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 121 | enforcement ladder](https://github.com/mozilla/diversity). 122 | 123 | [homepage]: https://www.contributor-covenant.org 124 | 125 | For answers to common questions about this code of conduct, see the FAQ at 126 | https://www.contributor-covenant.org/faq. Translations are available at 127 | https://www.contributor-covenant.org/translations. 128 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 chocolatemoo53 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome 2 | 3 | Hello there, thanks for visiting. This is a GitHub repo containing PowerShell scripts acting as one large one which make Windows Server closer to Windows 10 plus automate and ease the first time setup of a cloud server made for streaming games or applications. To learn more about the script including how to use the script in specific use cases like running this on AWS, please visit the wiki located [here](https://github.com/chocolatemoo53/cloudstreaming/wiki). If you ever need help, please [submit an issue](https://github.com/chocolatemoo53/cloudstreaming/issues) to GitHub. If there is something you don't want to run, most functions are independent from each other. Just erase the line from the step or skip the step entirely. 4 | 5 | If you're ready to get started, start your cloud computer running Windows Server 2019/22 and paste the following code into PowerShell to download the script. 6 | 7 | ``` bash 8 | [Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls" 9 | $DownloadScript = "https://github.com/chocolatemoo53/cloudstreaming/archive/refs/heads/main.zip" 10 | $ArchivePath = "$ENV:UserProfile\Downloads\cloudstreaming" 11 | (New-Object System.Net.WebClient).DownloadFile($DownloadScript, "$ArchivePath.zip") 12 | Expand-Archive "$ArchivePath.zip" -DestinationPath $ArchivePath -Force 13 | CD $ArchivePath\cloudstreaming-main | powershell.exe .\welcome.ps1 14 | ``` 15 | 16 | ## A note on "streaming technology" 17 | 18 | Streaming technologies are what streams the cloud computer to your local devices. The wiki has a table of the different technologies you can choose with their pros and cons which you should check to decide for yourself what the best streaming technology is for you. 19 | 20 | ### Thank you to 21 | 22 | | Team or Person | GitHub | Project | 23 | |-----------------|------------------------------------|------------------------------------------------------------------------| 24 | | LizardByte | | | 25 | | The Parsec Team | | Parsec application, cloud preperation tool and cloud GPU updater tool | 26 | | Nice/AWS | | , AWS platform and drivers | 27 | | acceleration3 | | | 28 | | tomgrice | | | 29 | 30 | And anyone who makes issues or contributes words/code. 31 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting a Vulnerability 2 | If there is something wrong with the security of the script, 3 | feel free to open an issue and report it! Make sure to report 4 | which line the issue occurs, what the issue is (with docs) 5 | and why it's important to fix. 6 | -------------------------------------------------------------------------------- /Steps/GPUDownloaderTool.ps1: -------------------------------------------------------------------------------- 1 | $specialFolder = "c:\cloudstreaming" 2 | 3 | $GamingBucket = "nvidia-gaming" 4 | $GamingKeyPrefix = "windows/latest" 5 | 6 | $Bucket = "ec2-windows-nvidia-drivers" 7 | $KeyPrefix = "latest" 8 | 9 | $LocalPath = "$home\Desktop\NVIDIA" 10 | 11 | Write-Host "Welcome! This tool will install your GPU drivers." 12 | 13 | Write-Host "Choose your cloud provider" 14 | Write-Host "1. AWS" 15 | Write-Host "2. Google Cloud" 16 | 17 | $provider = Read-Host -Prompt 'Type the number corresponding to your cloud provider' 18 | 19 | if ($provider -eq 1) { 20 | Write-Host "Checking for AWS credentials, this may take a while..." 21 | if ((Get-AWSCredential -ProfileName default) -ne $null) { 22 | Write-Host "AWS credentials already set!" -ForegroundColor Green 23 | } else { 24 | Write-Host "AWS credentials not found. Make ones and set them." 25 | $access = Read-Host -Prompt 'Enter AWS access key' 26 | $secret = Read-Host -Prompt 'Enter AWS secret key' 27 | Write-Host "Setting credentials, this may take a while..." -ForegroundColor Yellow 28 | Set-AWSCredential -AccessKey $access -SecretKey $secret -StoreAs default 29 | Write-Host "Credentials set!" -ForegroundColor Green 30 | } 31 | 32 | Write-Host "" 33 | Write-Host "Choose your instance type" 34 | Write-Host "1. G4DN instance" 35 | Write-Host "2. G5 instance" 36 | $instanceType = Read-Host -Prompt 'Type the number corresponding to your instance type' 37 | Write-Host "" 38 | Write-Host "Choose your driver type" 39 | Write-Host "1. Gaming" 40 | Write-Host "2. GRID" 41 | $driverType = Read-Host -Prompt 'Type the number corresponding to your choice' 42 | 43 | if ($driverType -eq 1) { 44 | Write-Host "Downloading gaming driver..." 45 | $GamingObjects = Get-S3Object -BucketName $GamingBucket -KeyPrefix $GamingKeyPrefix -Region us-east-1 46 | foreach ($GamingObject in $GamingObjects) { 47 | if ($GamingObject.Key -and $GamingObject.Size -gt 0) { 48 | $GamingLocalFilePath = Join-Path $LocalPath $GamingObject.Key 49 | $GamingLocalDir = [System.IO.Path]::GetDirectoryName($GamingLocalFilePath) 50 | 51 | Write-Output "Downloading $($GamingObject.Key) to $GamingLocalFilePath" 52 | 53 | try { 54 | Copy-S3Object -BucketName $GamingBucket -Key $GamingObject.Key -LocalFile $GamingLocalFilePath -Region us-east-1 55 | Write-Output "Successfully downloaded $($GamingObject.Key)" 56 | } catch { 57 | Write-Error "Failed to copy $($GamingObject.Key): $_" 58 | } 59 | } 60 | } 61 | 62 | Write-Host "Installing gaming driver..." 63 | Start-Process -FilePath "$([Environment]::GetFolderPath('Desktop'))\NVIDIA\windows\latest\*.exe" -Wait -ArgumentList "/s /n" 64 | Write-Host "Registering driver..." 65 | New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\nvlddmkm\Global" -Name "vGamingMarketplace" -PropertyType "DWord" -Value 2 -Force 66 | Start-BitsTransfer -Source "https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCertWindows_2023_9_22.cert" -Destination "$Env:PUBLIC\Documents\GridSwCert.txt" 67 | Write-Host "Driver installed!" -ForegroundColor Green 68 | } 69 | 70 | if ($driverType -eq 2) { 71 | if (-not (Test-Path $LocalPath)) { 72 | New-Item -Path $LocalPath -ItemType Directory | Out-Null 73 | } 74 | 75 | $Objects = Get-S3Object -BucketName $Bucket -KeyPrefix $KeyPrefix -Region us-east-1 76 | 77 | foreach ($Object in $Objects) { 78 | if ($Object.Key -ne '' -and $Object.Size -ne 0) { 79 | $LocalFilePath = Join-Path $LocalPath $Object.Key 80 | $LocalDir = [System.IO.Path]::GetDirectoryName($LocalFilePath) 81 | 82 | try { 83 | Copy-S3Object -BucketName $Bucket -Key $Object.Key -LocalFile $LocalFilePath -Region us-east-1 84 | } catch { 85 | Write-Error "Failed to copy $($Object.Key): $_" 86 | } 87 | } 88 | } 89 | 90 | Write-Host "Installing GRID driver..." 91 | Start-Process -FilePath "$([Environment]::GetFolderPath('Desktop'))\NVIDIA\latest\*.exe" -Wait -ArgumentList "/s /n" 92 | Write-Host "Registering driver..." 93 | New-Item -Path "HKLM:\SOFTWARE\NVIDIA Corporation\Global" -Name GridLicensing -Force 94 | New-ItemProperty -Path "HKLM:\SOFTWARE\NVIDIA Corporation\Global\GridLicensing" -Name "NvCplDisableManageLicensePage" -PropertyType "DWord" -Value 1 -Force 95 | Write-Host "Driver installed!" -ForegroundColor Green 96 | } 97 | 98 | if ($instanceType -eq 1) { 99 | Start-Process cmd.exe -ArgumentList "/c cd C:\Windows\System32\DriverStore\FileRepository\nvgrid*\ && .\nvidia-smi -ac 5001,1590" -Wait 100 | } 101 | 102 | if ($instanceType -eq 2) { 103 | Start-Process cmd.exe -ArgumentList "/c cd C:\Windows\System32\DriverStore\FileRepository\nvgrid*\ && .\nvidia-smi -ac 6250,1710" -Wait 104 | } 105 | } 106 | 107 | if ($provider -eq 2) { 108 | Invoke-WebRequest -Uri "https://github.com/GoogleCloudPlatform/compute-gpu-installation/raw/main/windows/install_gpu_driver.ps1" -OutFile "$specialFolder\install_gpu_driver.ps1" 109 | & "$specialFolder\install_gpu_driver.ps1" 110 | } 111 | 112 | Write-Host "If you restart, the script will continue automatically on next boot, or you can select Continue on the desktop." 113 | $restart = (Read-Host "Would you like to restart now? (y/n)").ToLower() 114 | if ($restart -eq "y") { 115 | Restart-Computer -Force 116 | } 117 | -------------------------------------------------------------------------------- /Steps/step1.ps1: -------------------------------------------------------------------------------- 1 | $osType = Get-CimInstance -ClassName Win32_OperatingSystem 2 | $WorkDir = "$PSScriptRoot\..\Bin" 3 | $specialFolder = "c:\cloudstreaming" 4 | Function GetFile([string]$Url, [string]$Path, [string]$Name) { 5 | try { 6 | if(![System.IO.File]::Exists($Path)) { 7 | Write-Host "Downloading"$Name"..." 8 | Start-BitsTransfer $Url $Path 9 | } 10 | } catch { 11 | throw "Download failed" 12 | } 13 | } 14 | 15 | $OldVersion = (Read-Host "Would you like to turn off Internet Explorer restrictions on Server 2019 and below? (y/n)").ToLower() -eq "y" 16 | if($OldVersion) { 17 | Write-Host "Removing IE restrictions..." 18 | Set-Itemproperty "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" -name IsInstalled -value 0 -force | Out-Null 19 | Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" -Name IsInstalled -Value 0 -Force | Out-Null 20 | Stop-Process -Name Explorer -Force 21 | } 22 | 23 | Write-Host "Choose your streaming technology" 24 | Write-Host "1. Parsec (Best for most people)" 25 | Write-Host "2. Amazon DCV (For AWS customers)" 26 | Write-Host "3. Sunshine (For use with Moonlight)" 27 | Write-Host "Consult the wiki for more information" 28 | 29 | $streamTech = Read-Host -Prompt 'Type the number corresponding your choice' 30 | 31 | if($streamTech -eq 1) { 32 | Write-Host "" 33 | GetFile "https://builds.parsecgaming.com/package/parsec-windows.exe" "$WorkDir\parsec.exe" "Parsec" 34 | Write-Host "Installing Parsec..." 35 | Start-Process -FilePath "$WorkDir\parsec.exe" -ArgumentList "/norun /silent" -NoNewWindow -Wait -Passthru 36 | } 37 | 38 | if($streamTech -eq 2) { 39 | Write-Host "" 40 | GetFile "https://d1uj6qtbmh3dt5.cloudfront.net/nice-dcv-server-x64-Release.msi" "$specialFolder\nicedcv.msi" "NiceDCV" 41 | Write-Host "Installing Amazon DCV..." 42 | Start-Process -FilePath "msiexec.exe" -Wait -ArgumentList '/qn /i C:\cloudstreaming\nicedcv.msi' 43 | } 44 | 45 | if($streamTech -eq 3) { 46 | Write-Host "" 47 | GetFile "https://github.com/LizardByte/Sunshine/releases/latest/download/sunshine-windows-installer.exe" "$WorkDir\sunshine.exe" "Sunshine" 48 | Write-Host "Installing Sunshine..." 49 | Start-Process -FilePath "$WorkDir\sunshine.exe" -Wait 50 | Copy-Item -Path "$WorkDir\sunshine.ico" -Destination $specialfolder 51 | $TargetFile = "$ENV:windir\explorer.exe" 52 | $ShortcutFile = "$env:Public\Desktop\Sunshine Settings.lnk" 53 | $WScriptShell = New-Object -ComObject WScript.Shell 54 | $Shortcut = $WScriptShell.CreateShortcut($ShortcutFile) 55 | $Shortcut.TargetPath = $TargetFile 56 | $Shortcut.IconLocation = "$specialfolder\sunshine.ico" 57 | $Shortcut.Arguments = "https://127.0.0.1:47990" 58 | $Shortcut.Save() 59 | Write-Host "Sunshine Settings shortcut created successfully!" -ForegroundColor Green 60 | Write-Host "Sunshine installed successfully!" -ForegroundColor Green 61 | } 62 | 63 | if($streamTech -in 1, 3) { 64 | Write-Host "" 65 | $Audio = (Read-Host "Would you like to download audio drivers? (y/n)").ToLower() -eq "y" 66 | if($Audio) { 67 | GetFile "https://download.vb-audio.com/Download_CABLE/VBCABLE_Driver_Pack43.zip" "$WorkDir\vbcable.zip" "VBCABLE" 68 | Write-Host "Installing VBCABLE..." 69 | Expand-Archive -Path "$WorkDir\vbcable.zip" -DestinationPath "$WorkDir\vbcable" 70 | (Get-AuthenticodeSignature -FilePath "$WorkDir\vbcable\vbaudio_cable64_win7.cat").SignerCertificate | Export-Certificate -Type CERT -FilePath "c:\cloudstreaming\vbcable.cer" | Out-Null 71 | Import-Certificate -FilePath "C:\cloudstreaming\vbcable.cer" -CertStoreLocation 'Cert:\LocalMachine\TrustedPublisher' | Out-Null 72 | Start-Process -FilePath "$WorkDir\vbcable\VBCABLE_Setup_x64.exe" -ArgumentList "-i","-h" -NoNewWindow -Wait } 73 | } 74 | 75 | if($streamTech -in 1, 3) { 76 | Write-Host "" 77 | $Monitor = (Read-Host "You may need a headless display/monitor. Would you like to install one? (y/n)").ToLower() -eq "y" 78 | if($Monitor) { 79 | GetFile "https://github.com/ge9/IddSampleDriver/releases/download/0.0.1.4/IddSampleDriver.zip" "$WorkDir\idd.zip" "IddSampleDriver" 80 | Expand-Archive -Path "$WorkDir\idd.zip" -DestinationPath "c:\" | Out-Null 81 | Start-Process cmd.exe -ArgumentList "/c c:\IddSampleDriver\InstallCert.bat" 82 | Write-Host "This process is not done, you need to manually install the driver." 83 | Write-Host "Go to Device Manager, click on the main window, and click on Action > Add legacy hardware." 84 | Write-Host "Select Install the hardware that I manually select from a list (Advanced)." 85 | Write-Host "Select Display Adapters, Have Disk, then navigate to c:\IddSampleDriver." 86 | Write-Host "Select the INF file and continue. Select reboot later." 87 | Write-Host "Only remove the basic display adapters after you have successfully connected to your stream tech of choice." 88 | Write-Host "" 89 | } 90 | } 91 | 92 | $Video = (Read-Host "Would you like to install video drivers (AWS and GCP, y/n)?").ToLower() -eq "y" 93 | 94 | if($Video) { 95 | $Shell = New-Object -comObject WScript.Shell 96 | $Shortcut = $Shell.CreateShortcut("$Home\Desktop\Continue.lnk") 97 | $Shortcut.TargetPath = "powershell.exe" 98 | $Shortcut.Arguments = "-Command `"Set-ExecutionPolicy Unrestricted; & '$PSScriptRoot\...\starthere.ps1'`" -RebootSkip" 99 | $Shortcut.Save() 100 | $script = "-Command `"Set-ExecutionPolicy Unrestricted; & '$PSScriptRoot\..\starthere.ps1'`" -RebootSkip"; 101 | $action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument $script 102 | $trigger = New-ScheduledTaskTrigger -AtLogon -RandomDelay "00:00:30" 103 | $principal = New-ScheduledTaskPrincipal -GroupId "BUILTIN\Administrators" -RunLevel Highest 104 | Register-ScheduledTask -Action $action -Trigger $trigger -Principal $principal -TaskName "Continue" -Description "Continue script" | Out-Null 105 | Start-Process powershell.exe -ArgumentList "-ExecutionPolicy Bypass -File `"$PSScriptRoot\GPUDownloaderTool.ps1`"" 106 | Stop-Transcript 107 | exit 108 | } 109 | -------------------------------------------------------------------------------- /Steps/step2.ps1: -------------------------------------------------------------------------------- 1 | $osType = Get-CimInstance -ClassName Win32_OperatingSystem 2 | $WorkDir = "$PSScriptRoot\..\Bin" 3 | $specialFolder = "c:\cloudstreaming" 4 | Function GetFile([string]$Url, [string]$Path, [string]$Name) { 5 | try { 6 | if(![System.IO.File]::Exists($Path)) { 7 | Write-Host "Downloading"$Name"..." 8 | Start-BitsTransfer $Url $Path 9 | } 10 | } catch { 11 | throw "Download failed" 12 | } 13 | } 14 | 15 | Import-Module BitsTransfer 16 | 17 | Write-Host "Applying general fixes and installing Windows Features..." 18 | Write-Host "" 19 | 20 | $Fixes = (Read-Host "Do you want to apply some essential fixes? (may already be active on your system, y/n)").ToLower() -eq "y" 21 | if($Fixes) { 22 | Enable-MMAgent -MemoryCompression | Out-Null 23 | New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "ServicesPipeTimeout" -Value 600000 -PropertyType "DWord" | Out-Null 24 | Set-Service -Name Audiosrv -StartupType Automatic | Out-Null 25 | reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Reliability" /v ShutDownReasonOn /t REG_DWORD /d 0 /f | Out-Null 26 | Write-Host "Applying accessibility flags..." 27 | Set-ItemProperty "HKCU:\Control Panel\Accessibility\StickyKeys" "Flags" "506" | Out-Null 28 | Set-ItemProperty "HKCU:\Control Panel\Accessibility\Keyboard Response" "Flags" "122"| Out-Null 29 | Set-ItemProperty "HKCU:\Control Panel\Accessibility\ToggleKeys" "Flags" "58" | Out-Null 30 | } 31 | 32 | Write-Host "" 33 | if($osType.ProductType -eq 3) { 34 | Write-Host "Installing .NET Framework 3.5..." 35 | Install-WindowsFeature NET-Framework-Features | Out-Null 36 | } 37 | 38 | Write-Host "" 39 | if($osType.ProductType -eq 3) { 40 | Write-Host "Installing Quality Windows Audio/Video Experience..." 41 | Install-WindowsFeature -Name QWAVE | Out-Null 42 | } 43 | 44 | Write-Host "" 45 | if($osType.ProductType -eq 3) { 46 | Write-Host "Installing Windows Media Foundation..." 47 | Install-WindowsFeature Server-Media-Foundation | Out-Null 48 | } 49 | 50 | $Login = (Read-Host "Do you need to setup auto login? (not needed for Amazon DCV, y/n)").ToLower() -eq "y" 51 | 52 | if($Login) { 53 | Write-Host "" 54 | Write-Host 'Configuring automatic login...' 55 | $RegPath = "hklm:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" 56 | Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1" -type String | Out-Null 57 | $username = Read-Host -Prompt 'Enter your username' 58 | $securedValue = Read-Host -AsSecureString -Prompt 'Please input your password' 59 | $bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($securedValue) 60 | $value = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr) 61 | Set-ItemProperty $RegPath "DefaultPassword" -Value "$value" -type String | Out-Null 62 | Set-ItemProperty $RegPath "DefaultUserName" -Value "$username" -type String | Out-Null 63 | Set-ItemProperty $RegPath "DefaultDomainName" -Value "" -type String | Out-Null 64 | } 65 | 66 | Write-Host "" 67 | $timeZoneQuestion = (Read-Host "Do you want to set a time zone? (y/n)").ToLower() -eq "y" 68 | 69 | if($timeZoneQuestion) { 70 | Write-Host "Please use the full name (example: Pacific Standard Time)"-ForegroundColor Red 71 | $timeZone = Read-Host -Prompt 'What is your time zone?' 72 | Set-TimeZone -Name "$timezone" 73 | } 74 | 75 | Write-Host "" 76 | Write-Host "You may be able to remove system info from the desktop by forcing a wallpaper" 77 | $setWallpaper = (Read-Host -Prompt 'Would you like to do so? (y/n)').ToLower() -eq "y" 78 | 79 | if($setWallpaper) { 80 | GetFile "https://cdn.wallpaperhub.app/cloudcache/7/c/2/f/3/4/7c2f345bdfcadb8a3faf483ebaa2e9aea712bbdb.jpg" "$WorkDir\wallpaper.jpg" "Default Windows 10 Wallpaper" 81 | Move-Item -Path "$WorkDir\wallpaper.jpg" -Destination "$specialfolder\wallpaper.jpg" 82 | Write-Host "Setting the wallpaper, you can set any wallpaper you like in the cloudstreaming folder..." 83 | New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies" -Name "System" | Out-Null 84 | New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name Wallpaper -value "c:\cloudstreaming\wallpaper.jpg" | Out-Null 85 | New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name WallpaperStyle -value 2 | Out-Null 86 | Stop-Process -Name Explorer -Force 87 | } 88 | -------------------------------------------------------------------------------- /Steps/step3.ps1: -------------------------------------------------------------------------------- 1 | $WorkDir = "$PSScriptRoot\..\Bin" 2 | $specialFolder = "C:\cloudstreaming" 3 | $installerFolder = "$specialFolder\Installers" 4 | 5 | Function GetFile([string]$Url, [string]$Path, [string]$Name) { 6 | try { 7 | if (!(Test-Path $Path)) { 8 | Write-Host "Downloading $Name..." 9 | Start-BitsTransfer $Url $Path 10 | } 11 | } catch { 12 | throw "Download failed for $Name" 13 | } 14 | } 15 | 16 | Import-Module BitsTransfer 17 | 18 | Function InstallMSI([string]$name, [string]$url, [string]$path) { 19 | GetFile $url $path $name 20 | Write-Host "Installing $name..." 21 | Start-Process -FilePath "msiexec.exe" -Wait -ArgumentList "/qn /i `"$path`"" 22 | Write-Host "" 23 | } 24 | 25 | Function Ask-User([string]$Prompt) { 26 | return (Read-Host $Prompt).Trim().ToLower() -eq 'y' 27 | } 28 | 29 | Write-Host "All software after this point is optional and should install silently..." 30 | 31 | # Tailscale 32 | if (Ask-User "Would you like to download and install Tailscale? (y/n)") { 33 | InstallMSI "Tailscale" "https://pkgs.tailscale.com/stable/tailscale-setup-latest.msi" "$installerFolder\tailscale.msi" 34 | } else { 35 | Write-Host "Skipping Tailscale..." 36 | } 37 | 38 | # Browsers 39 | if (Ask-User "Would you like to download and install web browsers? (y/n)") { 40 | if (Ask-User "Would you like to download and install Mozilla Firefox? (y/n)") { 41 | InstallMSI "Firefox" "https://download.mozilla.org/?product=firefox-msi-latest-ssl&os=win64&lang=en-US" "$installerFolder\firefox.msi" 42 | } 43 | 44 | if (Ask-User "Would you like to download and install Microsoft Edge? (y/n)") { 45 | InstallMSI "Microsoft Edge" "http://go.microsoft.com/fwlink/?LinkID=2093437" "$installerFolder\edge.msi" 46 | } 47 | 48 | if (Ask-User "Would you like to download and install Google Chrome? (y/n)") { 49 | InstallMSI "Google Chrome" "https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi" "$installerFolder\chrome.msi" 50 | } 51 | } else { 52 | Write-Host "Skipping browsers..." 53 | } 54 | 55 | # Game Launchers 56 | if (Ask-User "Would you like to download and install game launchers? (y/n)") { 57 | if (Ask-User "Would you like to download and install Steam? (y/n)") { 58 | $steamInstaller = "$WorkDir\SteamSetup.exe" 59 | GetFile "https://cdn.akamai.steamstatic.com/client/installer/SteamSetup.exe" $steamInstaller "Steam" 60 | Write-Host "Installing Steam..." 61 | Start-Process -FilePath $steamInstaller -ArgumentList "/S" -NoNewWindow -Wait 62 | } 63 | 64 | if (Ask-User "Would you like to download and install Epic Games? (y/n)") { 65 | InstallMSI "Epic Games" "https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncherInstaller.msi" "$installerFolder\epic.msi" 66 | } 67 | } else { 68 | Write-Host "Skipping game launchers..." 69 | } 70 | -------------------------------------------------------------------------------- /bin/sunshine.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chocolatemoo53/cloudstreaming/4ec74cfc5d1b680d8b6aed19c33a97fbf7762240/bin/sunshine.ico -------------------------------------------------------------------------------- /starthere.ps1: -------------------------------------------------------------------------------- 1 | Param([Parameter(Mandatory=$false)] [Switch]$RebootSkip) 2 | $host.ui.RawUI.WindowTitle = "cloudstreaming" 3 | Start-Transcript -Path "$PSScriptRoot\Log.txt" 4 | function Elevated { 5 | $id = [System.Security.Principal.WindowsIdentity]::GetCurrent() 6 | $p = New-Object System.Security.Principal.WindowsPrincipal($id) 7 | if ($p.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)) 8 | { Write-Output $true } 9 | else 10 | { Write-Output $false } 11 | } 12 | 13 | if (-not(Elevated)) 14 | { throw "Please run this script as a built-in or elevated Administrator" 15 | Stop-Transcript 16 | Pause 17 | } 18 | 19 | function Write-HostCenter { param($Message) Write-Host ("{0}{1}" -f (' ' * (([Math]::Max(0, $Host.UI.RawUI.BufferSize.Width / 2) - [Math]::Floor($Message.Length / 2)))), $Message) } 20 | 21 | Clear-Host 22 | 23 | Write-HostCenter 'Starting up...' 24 | Write-HostCenter 'Hello there, the script is ready!' -ForegroundColor Green 25 | Write-Host "" 26 | 27 | if(!$RebootSkip) { 28 | Write-Host "Creating a special directory for this script to use..." -ForegroundColor Yellow 29 | New-Item -Path C:\cloudstreaming -ItemType directory | Out-Null 30 | New-Item -Path C:\cloudstreaming\Installers -ItemType directory | Out-Null 31 | New-Item -Path C:\cloudstreaming\Drivers -ItemType directory | Out-Null 32 | Write-Host "Your machine may restart at least once during this setup!" -ForegroundColor Red 33 | Write-Host "Your setup time may vary..." -ForegroundColor Red 34 | Write-Host "Step 1 - Installing required software..." -ForegroundColor Yellow 35 | & $PSScriptRoot\Steps\step1.ps1 -Main 36 | } else { 37 | if(Get-ScheduledTask | Where-Object {$_.TaskName -like "Continue" }) { 38 | Unregister-ScheduledTask -TaskName "Continue" -Confirm:$false 39 | } 40 | Write-Host "Welcome back, let's continue with step two!" 41 | } 42 | 43 | Write-Host "" 44 | Write-Host "Step 2 - Applying fixes..." -ForegroundColor Yellow 45 | & $PSScriptRoot\Steps\step2.ps1 46 | 47 | Write-Host "" 48 | Write-Host "Step 3 - Installing extra applications..." -ForegroundColor Yellow 49 | & $PSScriptRoot\Steps\step3.ps1 50 | 51 | Write-Host "" 52 | $ip = (Invoke-WebRequest ifconfig.me/ip).Content 53 | Write-Host "Your IP address is $ip" -ForegroundColor Red 54 | Write-Host "Use this IP address in Moonlight or Amazon DCV, setup dynamic DNS if this a temporary address." -ForegroundColor Red 55 | Write-Host "If you liked the script, please star it on GitHub!" -ForegroundColor Green 56 | 57 | $restart = (Read-Host "It is recommenended to restart your server. Restart now? (y/n)").ToLower(); 58 | if($restart -eq "y") { 59 | Restart-Computer -Force 60 | } 61 | -------------------------------------------------------------------------------- /welcome.ps1: -------------------------------------------------------------------------------- 1 | Clear-Host 2 | Write-Host "Opening in a new window..." -ForegroundColor Red 3 | Write-Host "Thank you for using this script! Remember that all steps taken in the script are reversable..." -ForegroundColor Green 4 | Start-Process powershell.exe -ArgumentList "-ExecutionPolicy Bypass -File `"$PSScriptRoot\GPUDownloaderTool.ps1`"" 5 | --------------------------------------------------------------------------------