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, unless force 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
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, unlessforceis 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