Monday, 25 December 2006

Maori XMass: Installing Custom things in Visual Studio

Who'd have known, Bran Van 3000 is pretty good, while Sandman is po-faced sub-goth fantasy schtick. (ducks)

Installing Custom Project Templates for all users in Visual Studio Express


Aaanyway, thought I'd note down what I discovered about installing custom Project Templates into Visual Studio Express. (NB: This is different to installing into a user's "My Project Templates" folder; that only makes the template visible to one user.)
  • Package your template up into a nice zip file using either the Visual Studio Wizard, or Microsoft's documentation
  • Read the path given in the registry keyHKLM\SOFTWARE\Microsoft\VCSExpress\8.0\VSTemplate\Project key UserFolder
  • To that path, append the language string for the user's installed version. (For US English, that'll ususally be 1033. (i.e. append "\1033\" or whatever to the previously read path)
  • Copy the zipped template file into that directory
  • Locate the VCSexpress.exe executable. The location can be read from HKLM\SOFTWARE\Microsoft\VCSExpress\8.0 key InstallDir in the registry, but you'll need to append the executable name to that.
  • Run VCSExpress.exe with the /setup option
...that should make the IDE re-register it's list of project templates.
Next time you run Visual Studio Express, and go to File | New Project, your project template should be listed. To uninstall the template, delete the .zip file from where you installed it, and re-run VCSExpess.exe /setup

Programatically installing user controls in Visual Studio Express


Given how much trouble this was, and how clunkily it behaves, I rather suspect that Microsoft don't really want you doing this. Never mind.
I've only persuaded this to work for a single user at a time, which is a bit annoying. Anyway, to install some classes you've derived from Component:
  • Get the path stored in HKCU\Software\Microsoft\VCSExpress\8.0<\code> key VisualStudioLocation
  • Append "\Controls" to that path
  • To make your controls appear on a tab called $NAME, append "\$NAME\"
  • Copy the assembly containing your Component(s) into that path
  • Locate the VCSExpress.exe file, as described above
  • Execute VCSExpress.exe /command Tools.InstallCommunityControls
Which has a decent chance of working. NSIS code to do all that is available on request.

No comments: