Closed smcolligan closed 5 years ago
What does choco source list
on the computer return?
I'd also be interested in the logs and verbose output from running this.
Hi @pauby - Unfortunately, I had to move on from this. I needed to get this working and couldn't make it work using the Source
attribute. So I refactored my code to use Script resources instead:
Script 'Install SVN' {
GetScript = {
return @{ 'Result' = "Install SVN" }
}
TestScript = {
return ((& $using:chocoInstalledEXEPath list -l | Where-Object {$_ -match $using:svnPackageName}) -ne $null)
}
SetScript = {
& $using:chocoInstalledEXEPath install $using:svnPackageName --version $using:svnPackageVersion -s $using:chocoInternalSource -y
}
DependsOn = '[Script]Install Chocolatey'
}
Given that, I'm unfortunately not in a position to reproduce this at the moment.
I tried this:
cChocoPackageInstaller 'Install dummy-pkg'
{
Name = 'dummy-pkg'
Ensure = 'Present'
AutoUpgrade = $false
Version = 1.0.0
Source = 'c:\packages'
DependsOn = "[cChocoInstaller]InstallChocolatey"
}
And it worked as it should. dummy-pkg
obviously doesn't exist in the Chocolatey Community Repository so could only be picked up locally.
I also tried:
cChocoPackageInstaller 'Install dummy-pkg'
{
Name = 'winrar'
Ensure = 'Present'
AutoUpgrade = $false
Version = 5.70.0.20190305
Source = 'c:\packages'
DependsOn = "[cChocoInstaller]InstallChocolatey"
}
I don't have Winrar internalised so it can only come from the community repository but as this explicitly states the source it should fail, which it does.
I can't see the issue here and as there are no logs from the original issue I'm going to close this ticket but if it appears in the future we can always re-open.
Hello,
I've been trying to use the
Source
parameter on thecChocoPackageInstaller
resource to point to our internal repository. However, the resource still pulls from the public repository.I've been checking the choco logs on the machine in question, and can find no reference to my source. But, I do see it reaching out to sourceforge to download the package.
Any ideas?
Thanks,
Sean