问题
In NuGet, you can put a readme.txt in the root of the pacakge and it will open automatically. However, I have seen NuGet packages open a URL upon installation. How is this done (you can see an example with this NuGet package).
回答1:
It is done through a PowerShell script in the package's tools\install.ps1 file. Download the Glimpse package package, extract the archive, look for the tools\install.ps1 file.
At the bottom, you'll find the following script which performs the navigation:
$DTE.ItemOperations.Navigate("http://getglimpse.com/Version/Install/?" + $package.Id + "=" + $package.Version)
回答2:
You need to add a powershell script to your package:
Init.ps1
runs when you first install a package into a solutionInstall.ps1
runs every time a package is installed into a project.
Source: http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Automatically_Displaying_a_Readme.txt_File_During_Package_Installation
来源:https://stackoverflow.com/questions/15401521/how-to-open-readme-url-for-nuget-package