private void ValidateWixIisRegistryDefinitions(WixFragmentComponentGroup frameworkGroup, WixFragmentComponentGroup coreGroup) { // Framework foreach (var component in frameworkGroup.Component) { if (component.RegistryValue.KeyPath != "yes") { throw new PackagingException($@"Product.wxs Framework registryvalue {component.RegistryValue.Name}\{component.RegistryValue.Name} did not have KeyPath set to yes, but was {component.RegistryValue.KeyPath}."); } if (component.RegistryValue.MultiStringValue.Count != 3) { throw new PackagingException($@"Product.wxs Framework registryvalue {component.RegistryValue.Name}\{component.RegistryValue.Name} did not have correct number of string values: expected 3 was {component.RegistryValue.MultiStringValue.Count}."); } foreach (var value in _frameworkIISRegistryValues) { if (!component.RegistryValue.MultiStringValue.Contains(value)) { throw new PackagingException($@"Product.wxs Framework registryvalue {component.RegistryValue.Name}\{component.RegistryValue.Name} missing {value}"); } } } // Core foreach (var component in coreGroup.Component) { if (component.RegistryValue.KeyPath != "yes") { throw new PackagingException($@"Product.wxs Core registryvalue {component.RegistryValue.Name}\{component.RegistryValue.Name} did not have KeyPath set to yes, but was {component.RegistryValue.KeyPath}."); } if (component.RegistryValue.MultiStringValue.Count != 4) { throw new PackagingException($@"Product.wxs Core registryvalue {component.RegistryValue.Name}\{component.RegistryValue.Name} did not have correct number of string values: expected 4 was {component.RegistryValue.MultiStringValue.Count}."); } foreach (var value in _coreIISRegistryValues) { if (!component.RegistryValue.MultiStringValue.Contains(value)) { throw new PackagingException($@"Product.wxs Core registryvalue {component.RegistryValue.Name}\{component.RegistryValue.Name} missing {value}"); } } } }
private void ValidateWixFileExtensionDefinitions(WixFragmentComponentGroup group, bool isCore = false) { foreach (var component in group.Component) { var file = component.File; if (file.KeyPath != "yes") { throw new PackagingException($"Product.wxs file {file.Id} did not have KeyPath set to yes, but was {file.KeyPath}."); } var expectedSourcePath = isCore ? $@"$(var.SolutionDir)newrelichome_$(var.Platform)_coreclr\extensions\{file.Name}" : $@"$(var.SolutionDir)newrelichome_$(var.Platform)\extensions\{file.Name}"; if (file.Source != expectedSourcePath) { throw new PackagingException($"Product.wxs file {file.Id} did not have the expected source path of {expectedSourcePath}, but was {file.Source}"); } } }
private void ValidateWixRegistryDefinitions(WixFragmentComponentGroup group) { foreach (var component in group.Component) { var registryValue = component.RegistryValue; if (registryValue == null) { continue; } if (registryValue.KeyPath != "yes") { throw new PackagingException($"Product.wxs registryvalue {registryValue.Name} did not have KeyPath set to yes, but was {registryValue.KeyPath}."); } var expectedKey = $@"Software\New Relic\.NET Agent"; if (registryValue.Key != expectedKey) { throw new PackagingException($"Product.wxs registryvalue {registryValue.Name} did not have the expected source path of {expectedKey}, but was {registryValue.Key}"); } } }