Make distribution name unique

This commit is contained in:
Manuel Thalmann 2024-08-24 16:41:05 +02:00
parent b0719bfc4e
commit b01c07c65a

View file

@ -37,8 +37,8 @@ $null = New-Module {
Starts the installation loop. Starts the installation loop.
#> #>
function Start-InstallationLoop { function Start-InstallationLoop {
$distribution = "PortValhalla"; $distribution = "ValhallaUbuntu";
$wslLocation = "$env:ProgramData/PortValhalla/Ubuntu"; $wslLocation = "$env:ProgramData/PortValhalla/$distribution";
$wslDisk = "$wslLocation/ext4.vhdx"; $wslDisk = "$wslLocation/ext4.vhdx";
while (-not (Get-IsFinished)) { while (-not (Get-IsFinished)) {
@ -164,15 +164,6 @@ $null = New-Module {
Set-UserPermissions $wslLocation; Set-UserPermissions $wslLocation;
& "$wslLocation\ubuntu.exe" install --root; & "$wslLocation\ubuntu.exe" install --root;
wsl --shutdown; wsl --shutdown;
& {
$tempDisk = New-TemporaryFile;
Move-Item $wslDisk $tempDisk;
wsl --deregister Ubuntu;
Move-Item $tempDisk $wslDisk;
wsl --import-in-place $distribution $wslDisk;
};
continue; continue;
} }