因此,我已经尝试了OneGet一段时间,并希望创建包。我遇到的最大问题是,OneGet似乎并没有真正执行包中提供的卸载脚本。
这是我一直在测试的.nuspec文件和脚本文件:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>notepadplusplus</id>
<version>6.8.5</version>
<title>Notepad++</title>
<authors>Notepad ppl</authors>
<owners>King Kong</owners>
<projectUrl>https://notepad-plus-plus.org/</projectUrl>
<iconUrl>http://i1-win.softpedia-static.com/screenshots/icon-60/Notepad-plus-plus.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Notepad++ is a free (as in "free speech" and also as in "free beer") source code editor and Notepad replacement that supports several languages. Running in the MS Windows environment, its use is governed by GPL License.</description>
<summary>Notepad++</summary>
<tags>notepad notepad++ texteditor text editor</tags>
</metadata>
<files>
<file src="tools\chocolateyInstall.ps1" target="tools\chocolateyInstall.ps1" />
<file src="tools\chocolateyUninstall.ps1" target="tools\chocolateyUninstall.ps1" />
</files>
</package>chocolateyinstall.ps1:
Install-ChocolateyPackage 'notepadplusplus' 'exe' '/S' 'https://notepad-plus-plus.org/repository/6.x/6.8.5/npp.6.8.5.Installer.exe'chocolateyuninstall.ps1:
Get-WmiObject -Class Win32_Product | Select-Object -Property Name > C:\foo.txt我使用卸载脚本来测试脚本是否运行,但它没有运行。当我对安装脚本做同样的操作时,我可以清楚地看到它击中了脚本并实际创建了文本文件。
所以我的问题是Windows 10中的oneget模块根本不使用脚本文件吗?由于执行卸载包,如果提供的名称与注册表中的名称完全相同,则似乎执行卸载文件。例如,执行命令Uninstall-package notepad++将卸载notepad++,即使它是用notepadplusplus的名称安装的。
发布于 2015-10-24 17:30:59
目前的OneGet巧克力供应商是一个功能不全的原型,从2014年3月(是,2014年),由微软编写。官方提供者还没有完成。期待在2017年的某个时候完成。巧克力团队使用优先排序计划,允许在需求变化时快速调整优先级,因此很难提供更好的估计日期。如果有人对此感兴趣,请在下面评论。
我们将在邮件列表和时事通讯中发布一个正式的公告。
在它公布之前,我希望它是一个早期预览,并且几乎考虑到它的所有故障(包括自2014年以来增加的安全修复)。它目前是基于巧克力,从近两年前,甚至没有充分发挥功能,以提供的功能。
HTH
https://stackoverflow.com/questions/33298848
复制相似问题