Visual Studio 2010 Help Archive Mirror
Introduction
One of the few useful innovations in the Visual Studio 2010 help system (aka Microsoft Help System 1.1) is the ability to install and update help content archives from the online catalog. However, the need to pull out the order of a gigabyte of archives for each development machine may seem like an invoice, so it was decided to create a local mirror of the online catalog. Unfortunately, we could not find an official way to solve this problem.Study
Using any HTTP sniffer (such as Fiddler ), you can find out that the directory is located at http://services.mtps.microsoft.com/ServiceAPI/products , while the archives are located directly on the site http: // packages .mtps.microsoft.com /. It is these two resources that will need to be mirrored.Implementation
To create a mirror, we need the well-known console utility wget, as well as the web-server (I used nginx). The process of creating a mirror consists of the following steps:- Training. First of all, you need to create a folder that will store the contents of the future mirror, for example, D: \ mtps.
- Download directory. In the created folder, you need to run the following, quite extensive command:
wget -r -k -x -nH -H -N -E -l inf -e robots=off -X /ServiceAPI/packages -R *fr-fr*,*pt-br*,*es-es*,*pl-pl*,*de-de*,*cs-cz*,*it-it*,*tr-tr*,*ru-ru*,*ja-jp*,*ko-kr*,*zh-tw*,*zh-cn* http://services.mtps.microsoft.com/ServiceAPI/products/
after the end of which, the folder will contain a lot of archives, as well as the ServiceAPI folder. It is worth paying attention to the -R parameter, which controls the language of downloaded archives. In this case, all languages except for en-us are excluded. - Web server setup. First you need to mount the previously created folder as the root of the web server, and then create a rewrite rule that turns links like http://services.mtps.microsoft.com/ServiceAPI/products/dd936256 into http: //services.mtps. microsoft.com/ServiceAPI/products/dd936256.html because this is how wget preserves the directory structure. In my case, the server setup looked like this:
location / {
root d:\mtps;
index index.html index.htm;
rewrite ^(.*/[a-z0-9-]+)$ $1.html last;
} - Client setup Since the help management utility expects a directory at services.mtps.microsoft.com, you need to edit the etc / hosts file by matching this domain with the address of our local mirror. In my case, creating an alias on localhost was enough.
- Verification Now you can start the Help Library Manager (Help -> Manage Help Contents menu in Visual Studio) and make sure that the “Check for updates online” and “Install content from online” items work fine using the contents of the local mirror.
I hope you find this guide useful.