Cleanup and code refactor into sweetcade.ps1
This commit is contained in:
parent
95b0d24a97
commit
138de65e8e
@ -1,5 +1,5 @@
|
|||||||
Write-Host "---Download Wget---"
|
Write-Host "---Download Wget---"
|
||||||
Invoke-WebRequest "https://eternallybored.org/misc/wget/1.21.4/64/wget.exe" -OutFile "C:\sctools\wget\wget.exe"
|
Invoke-WebRequest "https://eternallybored.org/misc/wget/1.21.4/64/wget.exe" -OutFile "C:\sc\tools\wget\wget.exe"
|
||||||
Write-Host "---Download 7-Zip---"
|
Write-Host "---Download 7-Zip---"
|
||||||
C:\sctools\wget\wget.exe -O "C:\sc\tools\7zip\7zr.exe" "https://7-zip.org/a/7zr.exe"
|
C:\sctools\wget\wget.exe -O "C:\sc\tools\7zip\7zr.exe" "https://7-zip.org/a/7zr.exe"
|
||||||
Write-Host "---Download git---"
|
Write-Host "---Download git---"
|
||||||
|
@ -2,8 +2,8 @@ Write-Host "---Detecting GPU Type---"
|
|||||||
#PSEUDO - Detect GPU vendor without drivers TODO
|
#PSEUDO - Detect GPU vendor without drivers TODO
|
||||||
# if nvidia
|
# if nvidia
|
||||||
# then
|
# then
|
||||||
# C:\sctools\git\bin\git.exe clone https://github.com/lord-carlos/nvidia-update
|
# C:\sc\tools\git\bin\git.exe clone https://github.com/lord-carlos/nvidia-update
|
||||||
# nvidia.ps1 -clean -folder C:\sctools\nvidia
|
# nvidia.ps1 -clean -folder C:\sc\tools\nvidia
|
||||||
|
|
||||||
# if amd
|
# if amd
|
||||||
# then
|
# then
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
Get-Content -Path ..\license.txt | Out-Host -Paging
|
|
||||||
if ($? -neq 0)
|
|
||||||
{
|
|
||||||
Write-Host "----------"
|
|
||||||
Write-Host "You must read and accept the terms of the software license to install Sweetcade."
|
|
||||||
Write-Host "This script will now exit after 60 seconds."
|
|
||||||
Start-Sleep -Seconds 60
|
|
||||||
Exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Write-Host "----------"
|
|
||||||
Write-Host "You must accept the terms of the Mozilla Public License 2.0 in order to use Sweetcade."
|
|
||||||
Write-Host "If you [A]ccept, connect a keyboard and type A."
|
|
||||||
Write-Host "If you [R]eject, connect a keyboard and type R."
|
|
||||||
$vSCRejectTOS = Read-Host "A / R?"
|
|
||||||
if ($vSCNextHopUserResponse -contains "R")
|
|
||||||
{
|
|
||||||
Write-Host "You have rejected the software license. The Sweetcade installer will now exit."
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#PSEUDO - Go to next script (TODO)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,19 +1,4 @@
|
|||||||
Write-Host "---Create Directories---"
|
Write-Host "---Create Directories---"
|
||||||
New-Item -Path "C:\" -Name "sc" -ItemType "Directory"
|
|
||||||
if ( ?$ -neq True )
|
|
||||||
{
|
|
||||||
Write-Host "SC-DIR-ERR001: CANNOT CREATE NEEDED DIRECTORIES"
|
|
||||||
Write-Host "Creating the following directories has failed."
|
|
||||||
Write-Host "C:\sc"
|
|
||||||
Write-Host "Unable to continue. Please check that these locations are writable and that they do not already exist."
|
|
||||||
Start-Sleep -Seconds 60
|
|
||||||
Exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#PSEUDO - Continue without writing function? TODO
|
|
||||||
}
|
|
||||||
New-Item -Path "C:\sc" -Name "tools" -ItemType "Directory"
|
New-Item -Path "C:\sc" -Name "tools" -ItemType "Directory"
|
||||||
if ( ?$ -neq True )
|
if ( ?$ -neq True )
|
||||||
{
|
{
|
||||||
|
59
scripts/ps/sweetcade.ps1
Normal file
59
scripts/ps/sweetcade.ps1
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
# Script order:
|
||||||
|
|
||||||
|
# sweetcade.ps1 (main launcher)
|
||||||
|
# netcheck.ps1 (check for internet, dns resolution)
|
||||||
|
# syscheck.ps1 (check system specs and OS state)
|
||||||
|
# makerespt.ps1 (create restore point)
|
||||||
|
# makedirs.ps1 (create directories)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Write-Host "---------SWEETCADE INSTALL SCRIPT---------"
|
||||||
|
Write-Host "---Retrieving Software License File---"
|
||||||
|
Invoke-WebRequest "https://git.sdf.org/camoy/Sweetcade/raw/branch/main/license.txt" -OutFile .\license.txt
|
||||||
|
Write-Host "---Displaying Software License File---"
|
||||||
|
Get-Content -Path .\license.txt | Out-Host -Paging
|
||||||
|
if ($? -neq 0)
|
||||||
|
{
|
||||||
|
Write-Host "----------"
|
||||||
|
Write-Host "You must read and accept the terms of the software license to install Sweetcade."
|
||||||
|
Write-Host "This script will now exit after 60 seconds."
|
||||||
|
Start-Sleep -Seconds 60
|
||||||
|
Exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-Host "----------"
|
||||||
|
Write-Host "You must accept the terms of the Mozilla Public License 2.0 in order to use Sweetcade."
|
||||||
|
Write-Host "If you [A]ccept, connect a keyboard and type A."
|
||||||
|
Write-Host "If you [R]eject, connect a keyboard and type R."
|
||||||
|
$vSCRejectTOS = Read-Host "A / R?"
|
||||||
|
if ($vSCNextHopUserResponse -contains "R")
|
||||||
|
{
|
||||||
|
Write-Host "You have rejected the software license. The Sweetcade installer will now exit."
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-Host "---Download Sweetcade---"
|
||||||
|
Invoke-WebRequest "https://git.sdf.org/camoy/Sweetcade/archive/main.zip" -OutFile .\main.zip
|
||||||
|
Write-Host "---Create Install Directory---"
|
||||||
|
New-Item -Path "C:\" -Name "sc" -ItemType "Directory"
|
||||||
|
Write-Host "---Extract Sweetcade---"
|
||||||
|
Expand-Archive -Path .\main.zip -Destination "C:\sc" -PassThru -Force
|
||||||
|
Write-Host "---Start Network Check---"
|
||||||
|
Invoke-Expression (start powershell ((Split-Path $MyInvocation.InvocationName) + "C:\sc\scripts\ps\netcheck.ps1"))
|
||||||
|
Write-Host "---Start System Check---"
|
||||||
|
Invoke-Expression (start powershell ((Split-Path $MyInvocation.InvocationName) + "C:\sc\scripts\ps\syscheck.ps1"))
|
||||||
|
Write-Host "---Create Restore Point---"
|
||||||
|
Invoke-Expression (start powershell ((Split-Path $MyInvocation.InvocationName) + "C:\sc\scripts\ps\makerespt.ps1"))
|
||||||
|
Write-Host "---Create Extra Directories---"
|
||||||
|
Invoke-Expression (start powershell ((Split-Path $MyInvocation.InvocationName) + "C:\sc\scripts\ps\makedirs.ps1"))
|
||||||
|
Write-Host "---Download Supporting Tools---"
|
||||||
|
Invoke-Expression (start powershell ((Split-Path $MyInvocation.InvocationName) + "C:\sc\scripts\ps\download.ps1"))
|
||||||
|
Write-Host "---Install GPU Graphics Driver---"
|
||||||
|
Invoke-Expression (start powershell ((Split-Path $MyInvocation.InvocationName) + "C:\sc\scripts\ps\gpudriver.ps1"))
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,6 +0,0 @@
|
|||||||
[EditionID]
|
|
||||||
IoTEnterpriseS
|
|
||||||
[Channel]
|
|
||||||
Retail
|
|
||||||
[VL]
|
|
||||||
0
|
|
@ -1,2 +0,0 @@
|
|||||||
[PID]
|
|
||||||
Value=00000-00000-00000-00000-00000
|
|
Loading…
Reference in New Issue
Block a user