Allow overriding base installer action

This commit is contained in:
Manuel Thalmann 2024-10-22 01:25:30 +02:00
parent 09cac4e333
commit c6425ccd65

View file

@ -35,6 +35,11 @@ $null = New-Module {
}
};
$runBase = {
$defaults = @{ action = $Action };
& "$Inherit" @defaults @args;
};
if (-not $Name) {
$Name = Split-Path -Leaf (Split-Path -Parent ((Get-PSCallStack)[1].ScriptName));
}
@ -50,7 +55,7 @@ $null = New-Module {
$parameters = $parameters + @("-Force");
}
& $Inherit -Action $Action @parameters
& $runBase @parameters
};
}
}
@ -85,7 +90,7 @@ $null = New-Module {
installer = $installHandler;
arguments = $Arguments;
context = $Context;
base = { & "$Inherit" -Action $Action $args };
base = { & $runBase @args };
};
switch ($Action) {