public override void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams) { base.RunStarted(automationObject, replacementsDictionary, runKind, customParams); var vs = automationObject as EnvDTE.DTE; if (vs != null) { using (var serviceProvider = new ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)vs)) { tracer.ShieldUI((Action)(() => { var shell = serviceProvider.GetService <SVsShell, IVsShell>(); var registryRoot = VsHelper.GetPropertyOrDefault <string>(shell.GetProperty, (int)__VSSPROPID.VSSPROPID_VirtualRegistryRoot); var suffix = registryRoot.Replace(VsSettingsRegistryKey, string.Empty); replacementsDictionary.Add(@"$vsrootsuffix$", suffix); tracer.Info(Resources.VsRootSuffixTemplateWizard_RootSuffixDetermined, suffix); }), Resources.VsRootSuffixTemplateWizard_FailedToRetrieveRegistryRoot); } } }