Implement the windows installation in a loop
This commit is contained in:
parent
401aa9e41c
commit
afb2d1be65
|
@ -11,15 +11,24 @@
|
|||
. "$PSScriptRoot/../Scripts/SetupConfig.ps1";
|
||||
. "$PSScriptRoot/../Software/Firefox/Install.ps1";
|
||||
|
||||
<#
|
||||
Finishes the installation of a running Windows machine.
|
||||
#>
|
||||
function Start-WindowsInstallation {
|
||||
Start-InstallationLoop;
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Starts the installation loop.
|
||||
#>
|
||||
function Start-InstallationLoop {
|
||||
. "$PSScriptRoot/../Scripts/Choco.ps1";
|
||||
. "$PSScriptRoot/../Scripts/Hooks.ps1";
|
||||
. "$PSScriptRoot/../Scripts/PowerManagement.ps1";
|
||||
. "$PSScriptRoot/../Scripts/SetupConfig.ps1";
|
||||
|
||||
while (-not (Get-IsFinished)) {
|
||||
|
||||
}
|
||||
switch (Get-Stage) {
|
||||
$null {
|
||||
Invoke-Hook "Start-Initialization" -Fallback {
|
||||
|
@ -44,6 +53,7 @@ function Start-WindowsInstallation {
|
|||
}
|
||||
Default {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Invoke-WindowsInstallation([Context] $context) {
|
||||
|
|
|
@ -5,6 +5,7 @@ using namespace System.Security.Principal;
|
|||
$null = New-Module {
|
||||
[string] $configRoot = "HKLM:\Software\PortValhalla";
|
||||
[string] $stageOption = "Stage";
|
||||
[string] $finishedOption = "Finished";
|
||||
[RegistryKey] $key = $null;
|
||||
|
||||
<#
|
||||
|
@ -99,4 +100,22 @@ $null = New-Module {
|
|||
|
||||
$null = Set-SetupOption $stageOption $Name;
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gets a value indicating whether the setup has finished.
|
||||
#>
|
||||
function Get-IsFinished {
|
||||
return [bool] (Get-SetupOption $finishedOption);
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Sets a value indicating whether the setup has finished.
|
||||
#>
|
||||
function Set-IsFinished {
|
||||
param(
|
||||
$Value
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue