public override DeploymentResult Execute() { var result = new DeploymentResult(); LogCoarseGrain("Opening registry hive '{0}' on '{1}'", Hive.AsRegistryHiveString(), ServerName); using (var regHive = OpenHive()) using (var regKey = regHive.CreateSubKey(Key)) { if (regKey == null) { throw new ApplicationException(String.Format("Creation of registry key '{0}' in hive '{1}' on '{2}' failed. ", Key, Hive, ServerName)); } } result.AddGood(Name); return(result); }
protected void VerifyRegistryHivePermissions(DeploymentResult result) { if (Hive == RegistryHive.CurrentUser) { result.AddNote("Elevated permissions not required for Registry Hive '{0}'", Hive.AsRegistryHiveString()); return; } }