Compare commits
No commits in common. "e2de2c5ff2482ad3f6cede7dcf2280616653dffe" and "c6006a4fe0a368f6a01e56bb5940ce50bf0a4fb3" have entirely different histories.
e2de2c5ff2
...
c6006a4fe0
|
@ -280,14 +280,6 @@ $null = New-Module {
|
|||
Get-Config "valhalla.software.$Name";
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks whether the running system is a QEMU virtual machine.
|
||||
#>
|
||||
function Test-Qemu {
|
||||
((Get-WmiObject win32_computersystem).Manufacturer) -eq "QEMU";
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks whether the current user is the setup user.
|
||||
|
|
|
@ -29,10 +29,7 @@ $null = New-Module {
|
|||
$env:CONFIG_MODULE = Resolve-Path $env:CONFIG_MODULE;
|
||||
}
|
||||
|
||||
if (Test-Admin) {
|
||||
Disable-WindowsUpdateAutoRestart;
|
||||
}
|
||||
|
||||
Disable-WindowsUpdateAutoRestart;
|
||||
New-Alias -Force "sudo" gsudo;
|
||||
& $Action;
|
||||
}
|
||||
|
|
|
@ -79,14 +79,10 @@ function Test-Command {
|
|||
Checks whether `winget` is working properly.
|
||||
#>
|
||||
function Test-Winget {
|
||||
(Test-Command winget) -and (
|
||||
& {
|
||||
$output = winget source update winget;
|
||||
|
||||
$? -and -not ([System.Linq.Enumerable]::Any(
|
||||
[string[]]($output),
|
||||
[System.Func[string,bool]]{ param($line) $line -eq "Cancelled"; }));
|
||||
});
|
||||
(Test-Command winget) -and -not (
|
||||
[System.Linq.Enumerable]::Any(
|
||||
[string[]](winget source update winget),
|
||||
[System.Func[string,bool]]{ param($line) $line -eq "Cancelled"; }));
|
||||
}
|
||||
|
||||
<#
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#!/bin/pwsh
|
||||
using namespace System.Management.Automation.Host;
|
||||
using namespace System.Security.Principal;
|
||||
|
||||
. "$PSScriptRoot/../../../scripts/Windows/Scripts/Prerequisites.ps1";
|
||||
|
@ -74,37 +73,7 @@ $null = New-Module {
|
|||
Invoke-Hook "Install-PowerShellCore" -Fallback {
|
||||
choco install -y powershell-core --install-arguments='"ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1 ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 REGISTER_MANIFEST=1 USER_MU=1 ENABLE_MU=1"';
|
||||
};
|
||||
|
||||
if ($env:DEBUG) {
|
||||
if (
|
||||
(Test-Qemu) -and
|
||||
($Host.UI.PromptForChoice(
|
||||
"Confirm",
|
||||
"Do you wish to swap to live scripts?",
|
||||
[ChoiceDescription[]]@(
|
||||
[ChoiceDescription]::new("&No", "Use scripts stored in the virtual machine"),
|
||||
[ChoiceDescription]::new("&Yes", "Use live scripts stored on the host")),
|
||||
0) -eq 1)) {
|
||||
Install-ChocoPackage winfsp qemu-guest-agent;
|
||||
Get-Service VirtioFsSvc | Start-Service -PassThru | Set-Service -StartupType Automatic;
|
||||
|
||||
while (-not (Test-Path Z:\)) {
|
||||
Start-Sleep 0.1;
|
||||
}
|
||||
|
||||
foreach ($name in @("CONFIG_MODULE", "INSTALLER_SCRIPT")) {
|
||||
$variable = Get-Item "Env:\$name";
|
||||
|
||||
$path = Join-Path `
|
||||
"Z:\Repositories\PortValhalla" `
|
||||
([System.IO.Path]::GetRelativePath("$PSScriptRoot/../../..", $variable.Value));
|
||||
|
||||
Set-Item "Env:\$name" $path;
|
||||
Write-Host "The new value of ``$name`` is ``$path``";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Restart-Intermediate;
|
||||
return;
|
||||
}
|
||||
|
@ -161,7 +130,6 @@ $null = New-Module {
|
|||
. "$PSScriptRoot/../Software/PinnedItem/Manage.ps1";
|
||||
};
|
||||
|
||||
Install-WingetPackage AutoHotkey.AutoHotkey;
|
||||
Set-Stage ([SetupStage]::Configure);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -230,7 +230,6 @@ function Start-Setup {
|
|||
Add-StartupCommand `
|
||||
-Script (
|
||||
"powershell -Command " +
|
||||
($env:DEBUG ? "`$env:DEBUG = $([int]$env:DEBUG)" : "") +
|
||||
"`$env:PWSH_PATH = $(Get-PathInjection $env:PWSH_PATH);" +
|
||||
"`$env:INSTALLER_SCRIPT = $(Get-ScriptPathInjection $env:SETUP_SCRIPT_NAME);" +
|
||||
"`$env:CONFIG_MODULE = $(Get-ScriptPathInjection $env:CONFIG_MODULE);" +
|
||||
|
|
|
@ -52,8 +52,13 @@ $null = New-Module {
|
|||
#>
|
||||
function Get-StartupArguments {
|
||||
"-Command " +
|
||||
($env:PWSH_PATH ? "`$env:PWSH_PATH = $(ConvertTo-Injection $env:PWSH_PATH);" : "") +
|
||||
($env:DEBUG ? "`$env:DEBUG = $([int]$env:DEBUG)" : "")
|
||||
(& {
|
||||
if ($env:PWSH_PATH) {
|
||||
"`$env:PWSH_PATH = $(ConvertTo-Injection $env:PWSH_PATH);"
|
||||
} else {
|
||||
""
|
||||
}
|
||||
}) +
|
||||
"`$env:INSTALLER_SCRIPT = $(ConvertTo-Injection (Resolve-Path $env:INSTALLER_SCRIPT));" +
|
||||
"`$env:CONFIG_MODULE = $(ConvertTo-Injection (Resolve-Path $env:CONFIG_MODULE));" +
|
||||
"& `$env:INSTALLER_SCRIPT;"
|
||||
|
|
|
@ -13,9 +13,6 @@ begin
|
|||
sed "s/\//\\\\/g"
|
||||
end
|
||||
|
||||
argparse --name (status filename) -x "iso,usb" "iso" "usb" "debug" -- $argv
|
||||
or exit 1
|
||||
|
||||
set -l setupLabel "winiso-valhalla"
|
||||
set -l projectPath "PortValhalla"
|
||||
set -l systemDrivePath "sources/\$OEM\$/\$1"
|
||||
|
@ -134,13 +131,6 @@ begin
|
|||
"$git[5]\\bin"
|
||||
) \
|
||||
"set SETUP_LABEL=$setupLabel" \
|
||||
(
|
||||
begin
|
||||
if [ -n "$_flag_debug"]
|
||||
echo "set DEBUG=1"
|
||||
end
|
||||
end
|
||||
) \
|
||||
"set PWSH_PATH=$(echo "$pwshPath" | mkWinPath)" \
|
||||
"set LOCAL_PROJECT_PATH=$(echo "$localProjectPath" | mkWinPath)" \
|
||||
"set REMOTE_PROJECT_PATH=$(echo "$projectPath" | mkWinPath)" \
|
||||
|
|
|
@ -19,7 +19,7 @@ then
|
|||
echo "Please specify the path to the Windows 11 ISO image in your .env file located at:";
|
||||
realpath --relative-to "$workingDir" "$(realpath .env)";
|
||||
else
|
||||
WIN11_IMAGE_PATH="$WIN11_IMAGE_PATH" exec fish ./deploy.fish $@;
|
||||
WIN11_IMAGE_PATH="$WIN11_IMAGE_PATH" fish ./deploy.fish;
|
||||
fi;
|
||||
|
||||
popd > /dev/null;
|
||||
|
|
Loading…
Reference in a new issue