From 4cc1a60cb1993c2fe4f2c768c95151c439db8a3b Mon Sep 17 00:00:00 2001 From: camoy Date: Tue, 25 Jun 2024 14:46:27 -0700 Subject: [PATCH] Syntax adjustments, Make Restory Point script --- pseudo.txt | 21 ++++++++++----------- scripts/ps/license.ps1 | 5 ++++- scripts/ps/makerespt.ps1 | 21 +++++++++++++++++++++ scripts/ps/netcheck.ps1 | 6 +----- scripts/ps/startuwf.ps1 | 2 +- scripts/ps/stopuwf.ps1 | 2 +- 6 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 scripts/ps/makerespt.ps1 diff --git a/pseudo.txt b/pseudo.txt index 2be0a8a..f2b2284 100644 --- a/pseudo.txt +++ b/pseudo.txt @@ -6,9 +6,9 @@ ----- Name resolution test (resolve domains we need to contact, list todo) --- RAM - scripts/ps/syscheck.ps1 ----- 8GB minimum ---- Disks - unattend/autounattend.xml ---- C:\ minimum of 80GB ---- D:\ consumes remaining disk +--- Disks - scripts/unattend/autounattend.xml +--- C:\ minimum of 80GB - scripts/unattend/autounattend.xml +--- D:\ consumes remaining disk - scripts/unattend/autounattend.xml --- Correct OS version - scripts/ps/syscheck.ps1 --- Valid product key check - scripts/ps/syscheck.ps1 - User prompts @@ -16,15 +16,14 @@ --- Specify control type, number of buttons, joysticks --- Desired D:\ partition size - Begin install process ---- Create restore point for C:\ ---- Resize C:\ to 80GB ---- Wait for diskpart to finish before running next diskpart script ---- Resize D:\ to consume desired disk space +--- Create restore point for C:\ - scripts/ps/makerespt.ps1 +--- Resize C:\ to 80GB - scripts/unattend/autounattend.xml +--- Resize D:\ to consume desired disk space - scripts/unattend/autounattend.xml - OS Configuration ---- Set user to auto-login +--- Set user to auto-login - scripts/unattend/autounattend.xml --- Disable auto-sleep and turning off screen ---- Disable Windows Defender ---- Disable OneDrive +--- Disable Windows Defender - scripts/unattend/autounattend.xml +--- Disable OneDrive - scripts/unattend/autounattend.xml --- Download supporting applications ----- 7-Zip binary ----- MinGW @@ -38,7 +37,7 @@ ----- OpenJVS ----- FastIO2KB ----- WinIPAC Tool ------ Data Management Tool (maybe included with Launchbox?) +----- Data Management Tool (maybe included with Launchbox/Attractmode?) ----- Sweetcade uninstall script ------- Remove Launchbox, CRU, Control support software from startup folder ------- Delete relevant folders/files diff --git a/scripts/ps/license.ps1 b/scripts/ps/license.ps1 index 4fcb803..559050e 100644 --- a/scripts/ps/license.ps1 +++ b/scripts/ps/license.ps1 @@ -7,6 +7,7 @@ Get-Content -Path ..\license.txt | Out-Host -Paging Start-Sleep -Seconds 60 Exit 1 } + else { Write-Host "----------" @@ -17,9 +18,11 @@ Get-Content -Path ..\license.txt | Out-Host -Paging 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) } + } \ No newline at end of file diff --git a/scripts/ps/makerespt.ps1 b/scripts/ps/makerespt.ps1 new file mode 100644 index 0000000..f584797 --- /dev/null +++ b/scripts/ps/makerespt.ps1 @@ -0,0 +1,21 @@ +Write-Host "---Create restore point for C:\---" +Checkpoint-Computer -Description "Before Sweetcade Install" -RestorePointType APPLICATION_INSTALL +if ( $? -neq True ) + { + Write-Host "SC-RPT-ERR001: CANNOT CREATE RESTORE POINT" + Write-Host "Creating a restore point has failed. The reason for failure should be printed above." + Write-Host "You may continue to install Sweetcade but will have to use the uninstall script instead should you wish to remove Sweetcade." + Write-Host "If you would like to [C]ontinue, connect a keyboard and type C." + Write-Host "If you would like to [S]top the install to investigate further, connect a keyboard and type S." + vSCRestorePointUserResponse = Read-Host "C / S?" + if ($vSCNextHopUserResponse -contains "C") + { + #PSUDEOCODE - Continue to next script (TODO) + } + + else + { + Write-Host "This script will now exit after 60 seconds." + Start-Sleep -Seconds 60 + } + } \ No newline at end of file diff --git a/scripts/ps/netcheck.ps1 b/scripts/ps/netcheck.ps1 index 9445d6d..c10b4a2 100644 --- a/scripts/ps/netcheck.ps1 +++ b/scripts/ps/netcheck.ps1 @@ -39,9 +39,5 @@ function fSCDNSResolutionTest { $vSCDNSResolutionTestResult5 = $? } - -### -fSCGetDefaultGateway{} -fSCPingDefaultGateway{} -fSCDNSResolutionTest{} +#PSEUDO - Check each hostname for name resolution, if-then to next script (syscheck.ps1) diff --git a/scripts/ps/startuwf.ps1 b/scripts/ps/startuwf.ps1 index d39c07d..503fa1d 100644 --- a/scripts/ps/startuwf.ps1 +++ b/scripts/ps/startuwf.ps1 @@ -1 +1 @@ -Todo \ No newline at end of file +#TODO \ No newline at end of file diff --git a/scripts/ps/stopuwf.ps1 b/scripts/ps/stopuwf.ps1 index d39c07d..503fa1d 100644 --- a/scripts/ps/stopuwf.ps1 +++ b/scripts/ps/stopuwf.ps1 @@ -1 +1 @@ -Todo \ No newline at end of file +#TODO \ No newline at end of file