Mirror of the reference archives of Visual Studio 2010
Introduction
One of the few useful innovations of the Visual Studio 2010 help system (aka Microsoft Help System 1.1) is the ability to install and update help archives from the online catalog. However, the need to extract the order of a gigabyte of archives for each developer machine may seem expensive, so it was decided to create a local mirror of the online catalog. Unfortunately, it was not possible to find an official way to solve this problem.
Study
Using any HTTP sniffer (such as Fiddler , for example), you can find out that the directory is located at http://services.mtps.microsoft.com/ServiceAPI/products , while the archives are located directly on 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 a web server (I used nginx). The mirror creation process consists of the following steps:
Training. The first step is 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, rather lengthy 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 which, in the folder, there will be a mass of archives, and also a ServiceAPI folder. It is worth paying attention to the -R parameter, which controls the language of the loaded archives. In this case, all languages except en-us are excluded.
Setting up a web server. First you need to mount the previously created folder as the root of the web server, and then create a rewrite rule that would make 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 saves the directory structure. In my case, the server setup looked like this: location / {<br/> root d:\mtps;<br/> index index.html index.htm;<br/> rewrite ^(.*/[a-z0-9-]+)$ $1.html last;<br/>}<br/>
Customize the client. Since the help system management utility expects a directory at services.mtps.microsoft.com, you need to edit the etc / hosts file by matching the address of our local mirror to this domain. In my case, it was enough to create an alias on localhost.
Check. Now you can run the Help Library Manager (menu Help -> Manage Help Contents 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.
To update the mirror, just go to the folder with the archives, delete the ServiceAPI subfolder and restart wget with the above parameters, while the –N switch prevents the old archives from being downloaded again. You can also create a script that automatically performs this work and runs, say, once a week using the scheduler. ')
I hope this guide will be useful to you.