I'm not able to create a package with vcredist2015 as a dependency. I've tried several versions of the package. I've tried some other dependencies and they seem to work fine.
(I'm new to Chocolatey, I could be missing something obvious or misunderstanding something.)
That I'm able to create and install a package with vcredist2015 as a depdendency.
$ choco new samplepackage
add this to samplepackage.nupkg:
<dependencies>
<dependency id="vcredist2015" version="14.0.23918.0"/>
</dependencies>
$ choco pack
$ choco install samplepackage.nupkg
PS C:\Users\Marcus\choco\tesseract> choco install -d -v .\tesseract.3.0.5.nupkg
Chocolatey v0.9.10-beta1-151-ga83d5c5
Chocolatey is running on Windows v 10.0.10586.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" install -d -v .\tesseract.3.0.5.nupkg
Received arguments: install -d -v .\tesseract.3.0.5.nupkg
The source 'https://chocolatey.org/api/v2/' evaluated to a 'normal' source type
NOTE: Hiding sensitive configuration data! Please double and triple
check to be sure no sensitive data is shown, especially if copying
output to a gist for review.
Configuration: CommandName='install'|
CacheLocation='C:\Users\Marcus\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|
Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
Debug='True'|Verbose='True'|Force='False'|Noop='False'|
HelpRequested='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='True'|AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='.\tesseract.3.0.5.nupkg'|
AllVersions='False'|SkipPackageInstallProvider='False'|
PackageNames='.\tesseract.3.0.5.nupkg'|Prerelease='False'|
ForceX86='False'|OverrideArguments='False'|NotSilent='False'|
IgnoreDependencies='False'|AllowMultipleVersions='False'|
AllowDowngrade='False'|ForceDependencies='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.10586.0'|
Information.PlatformName='Windows'|
Information.ChocolateyVersion='0.9.10.0'|
Information.ChocolateyProductVersion='0.9.10-beta1-151-ga83d5c5'|
Information.FullName='choco, Version=0.9.10.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|
Information.Is64Bit='True'|Information.IsInteractive='True'|
Information.IsUserAdministrator='True'|
Information.IsProcessElevated='True'|Features.AutoUninstaller='True'|
Features.CheckSumFiles='True'|Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.VirusCheck='False'|
ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
NewCommand.AutomaticPackage='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|FeatureCommand.Command='unknown'|
ConfigCommand.Command='unknown'|PushCommand.TimeoutInSeconds='0'|
PinCommand.Command='unknown'|
_ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
Installing the following packages:
.\tesseract.3.0.5.nupkg
By installing you accept licenses for the packages.
Updating source and package name to handle *.nupkg or *.nuspec file.
[NuGet] Attempting to resolve dependency 'chocolatey (≥ 0.9.8.21)'.
[NuGet] Attempting to resolve dependency 'vcredist2015 (≥ 14.0.23918.0)'.
tesseract not installed. An error occurred during installation:
Unable to resolve dependency 'vcredist2015 (≥ 14.0.23918.0)'.
No package information as package is null.
No package information to save as package is null.
The install of tesseract was NOT successful.
tesseract not installed. An error occurred during installation:
Unable to resolve dependency 'vcredist2015 (≥ 14.0.23918.0)'.
Chocolatey installed 0/1 package(s). 1 package(s) failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures:
- tesseract
Exiting with 1
@morochena I think what you are looking for is here:
https://github.com/chocolatey/choco/wiki/CreatePackages#testing-your-package
i.e. when testing locally, you will need to specify an additional source, so that your dependency can be resolved.
@gep13 Thanks for the response. Unfortunately I'm getting the same error when attempting to install with this command:
$ choco install -fdv -s "'$pwd;https://chocolatey.org/api/v2/'" .\samplepackage.0.0.1.nupkg
@morochena the command should not use nupkg as part of the package name you want to resolve - this explicitly overrides the source to be $pwd only.
I updated that testing section to call this out:
NOTE: Do not call install with .nupkg - pointing to a file explicitly overrides source. You must call your install with the package name, not the nupkg file and location. You've already specified for choco to look in a local source with -s "'$pwd;https://chocolatey.org/api/v2/'". Call choco install dude, not choco install .\dude.nupkg.
If you want to verify the behavior you were seeing, look at the Sources= config value you had in your debug verbose output.
I'm going to close this as a documentation issue and since I resolved that, 👍
@ferventcoder thanks for the explanation! It works following your instructions.
Most helpful comment
If you want to verify the behavior you were seeing, look at the
Sources=config value you had in your debug verbose output.I'm going to close this as a documentation issue and since I resolved that, 👍