2018-07-23 23:52:13 +02:00
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
|
|
|
|
$package_name = $env:ChocolateyPackageName
|
|
|
|
$package_version = $env:ChocolateyPackageVersion
|
|
|
|
$install_path = "--- PATH ---\$package_name-$package_version.txt"
|
|
|
|
$source = "--- SOURCE ---" # used by the test to determine which source it was installed from
|
|
|
|
|
|
|
|
if ($env:ChocolateyAllowEmptyChecksums) {
|
|
|
|
$allow_empty_checksums = $true
|
|
|
|
} else {
|
|
|
|
$allow_empty_checksums = $false
|
|
|
|
}
|
|
|
|
if ($env:ChocolateyIgnoreChecksums) {
|
|
|
|
$ignore_checksums = $true
|
|
|
|
} else {
|
|
|
|
$ignore_checksums = $false
|
|
|
|
}
|
|
|
|
if ($env:ChocolateyForce) {
|
|
|
|
$force = $true
|
|
|
|
} else {
|
|
|
|
$force = $false
|
|
|
|
}
|
|
|
|
if ($env:ChocolateyForceX86) {
|
|
|
|
$force_x86 = $true
|
|
|
|
} else {
|
|
|
|
$force_x86 = $false
|
|
|
|
}
|
2019-11-25 00:51:13 +01:00
|
|
|
if ($env:ChocolateyInstallOverride) {
|
|
|
|
$override_args = $true
|
|
|
|
} else {
|
|
|
|
$override_args = $false
|
|
|
|
}
|
2018-07-23 23:52:13 +02:00
|
|
|
#$process_env = Get-EnvironmentVariableNames -Scope Process
|
|
|
|
#$env_vars = @{}
|
|
|
|
#foreach ($name in $process_env) {
|
|
|
|
# $env_vars.$name = Get-EnvironmentVariable -Name $name -Scope Process
|
|
|
|
#}
|
|
|
|
$timeout = $env:chocolateyResponseTimeout
|
|
|
|
|
|
|
|
$package_info = @{
|
|
|
|
allow_empty_checksums = $allow_empty_checksums
|
|
|
|
#env_vars = $env_vars
|
|
|
|
force = $force
|
|
|
|
force_x86 = $force_x86
|
|
|
|
ignore_checksums = $ignore_checksums
|
|
|
|
install_args = $env:ChocolateyInstallArguments
|
2019-11-25 00:51:13 +01:00
|
|
|
override_args = $override_args
|
2018-07-23 23:52:13 +02:00
|
|
|
package_params = Get-PackageParameters
|
|
|
|
proxy_url = $env:ChocolateyProxyLocation
|
|
|
|
source = $source
|
|
|
|
timeout = $timeout
|
|
|
|
}
|
|
|
|
$package_json = ConvertTo-Json -InputObject $package_info
|
|
|
|
|
|
|
|
[System.IO.File]::WriteAllText($install_path, $package_json)
|