Monday, October 01, 2007 - Posts
The Run as Normal User (RANU) switch is part of the VS 2008 since beta 1. Aaron and Deepankar already blogged about this a couple of months ago.
In the context of VSX, RANU basically means "load my Vs Package registration information from HKCU instead of HKLM hive", or:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0Exp\Configuration
Instead of:
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0
As pointed by Aaron, this is only for development scenarios. Package deployment is still under the HKLM hive and you will need Administrator privileges.
To support the HKCU hive and the RANU switch several tools where modified:
- devenv.exe itself
- RegPkg.exe or the package registration tool
- VSRegEx.exe or the reset experimental hive tool
This is the default VSX package registration method no matter which OS is used on the development machine. The VS SDK shortcuts and VSX package project templates had been updated to reflect this registration method.
The RANU switch is only applicable for the experimental hive, so if for some specific reason we want to register a package on the normal hive on our development environment, we need to manually edit the csproj file and add the following lines:
<PropertyGroup>
<TargetRegistryRoot>Software\Microsoft\VisualStudio\9.0</TargetRegistryRoot>
<RegisterWithRanu>false</RegisterWithRanu>
</PropertyGroup>
Of course if you need to integrate a GAX guidance package with a VSX package (for ex a DSL) you should take this into account. You basically need to register the GP on the Exp hive with the RANU switch.
Pablo
devenv /setup basically means "Reset" VS. Several things happen when we do a devenv /setup:
- The VS menus are recreated
- <all user profile path>\All Users\Application Data\Microsoft\VisualStudio\9.0\<Locale>\devenv.CTM
- The toolbox is recreated
- <user profile path>\Local Settings\Application Data\Microsoft\VisualStudio\9.0\toolbox.tbd
- VS templates cache are recreated
You may already noticed that devenv /setup takes a lot of time to process, and this is because the Vs templates recreation step.
Since VS 2005, VS templates are installed as .zip files on certain know locations:
Installed Templates
By default, templates installed with the product are located at:
Custom Templates
By default, custom templates are located at:
Recreating the VS templates means to transverse all know locations for installed templates (custom templates dont follow this rule), extract every zip file found and copy it to a directory ending with "Cache", for ex:
Fortunately with Orcas there is a new devenv switch:
"devenv /setup /nosetupvstemplates"
The Microsoft.VsSDK.targets is smart enough to use the switch as part of the build process when necessary. Necessary means no updates to the .vsct file or no updates to vs templates.
One thing to notice is that the old Microsoft.VsSDK.targets was smart too. For ex. if you didn't modify the .ctc file, the devenv /setup was not going to be executed.
Pablo
Finally on VS 2008 we can easily know that we are running a VS instance pointing to the experimental hive by just looking at the window title. :)
Pablo