我正在尝试为一个名为李斯特的应用程序创建一个带有巧克力的包。我遵循了巧克力维基上的说明以及这里一文。
我还在http://chocolatey.org上创建了一个帐户,并使用
nuget setApiKey -Source http://chocolatey.org/api/v2/
将替换为您的API键。
当我输入命令choco pack来创建NuGet包时,它说成功地创建了包,但是当我测试刚才使用cinst Listary -source Listary.1.0.nupkg -force创建的包时,它说
Invalid URI: The format of the URI could not be determined.
Command 'install' failed (sometimes this indicates a partial failure). Additional info/packages: Listary这就是我的Listary.nuspec文件中的内容。
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Listary</id>
<title>Listary</title>
<version>1.0</version>
<authors>Zhenheng Dai</authors>
<owners>Zhenheng Dai</owners>
<summary>Keep files at your fingertips. Listary is a unique search utility for Windows.</summary>
<description>Listary is a unique search utility for Windows. Not only does it make file browsing truly flexible -- thanks to its multi-file managers support -- but the ultra-compact UI also redefines minimalism. The lightweight design doesn't stop it from providing various advanced features however, that may fit the needs of both casual and power users alike. All you have to do is just type the file name that you’re looking for, and Listary will display the search results at breakneck speed.</description>
<projectUrl>http://www.listary.com</projectUrl>
<tags>listary search find filemanager admin</tags>
<copyright></copyright>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<releaseNotes></releaseNotes>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>chocolateyInstall.ps1包含以下内容。
$packageName = 'Listary'
$installerType = 'exe'
$url = 'http://www.listary.com/download/Listary.exe'
$silentArgs = '/SP /VERYSILENT /NORESTART'
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url"发布于 2013-12-07 05:58:13
https://github.com/chocolatey/choco/wiki/CreatePackages#testing-your-package (固定链路)
注意,源不是nupkg,而是找到nupkg文件的目录。
在choco.exe (巧克力的转世)中,您只需指向nuspec或nupkg文件即可安装。
https://stackoverflow.com/questions/20420495
复制相似问题