Open TheCakeIsNaOH opened 8 months ago
My thoughts around this is to introduce two new cmdlets with a similar name to the Get-AppInstallLocation
that is already implemented.
Set-AppInstallLocation
, which should have the responsibilities of:
-LiteralPath
and -Force
. Literal Path should be mandatory (could potentially have -Path
as an alternative that allows globbing, but not sure how useful that is)-Force
is also used.Update-AppInstallLocation
, which should have the responsibilities of:
-AppNamePattern
and -Force
where AppNamePattern
is mandatory.Get-AppInstallLocation
to get the correct install location.-Force
is also used.Alternatively to the second cmdlet, we could also just have the first one but make LiteralPath
/Path
and AppNamePattern
be mandatory in different sets.
Sometimes, it may be desirable to set the installation directory manually in an install script. This can be done by setting
$env:ChocolateyPackageInstallLocation
, however, it would be good to have a helper that abstracts the functionality. It should not set the variable if it is already set, unlessforce
is passed.This is so the install directory can be set for installers that do not set an explicit install directory in the registry, and for packages that have a complex install script that requires manual install directory setting. See https://github.com/orgs/chocolatey-community/discussions/2254