public bool HasBeenInstalled(MachinePrerequisite machinePreq) { if (machinePreq == null) { throw new ArgumentNullException("machinePreq"); } var profLocs = EnvironmentRepository.GetProfilerLocations(); if (profLocs == null || profLocs.Length == 0) { return(false); } foreach (var profLoc in profLocs) { using (var classesRootKey = EnvironmentRepository.OpenRegistryBaseKey(RegistryHive.ClassesRoot, profLoc.RegistryView)) using (var inprocServer32Key = EnvironmentRepository.OpenRegistrySubKey(classesRootKey, ProfilerLocation.InprocServer32Path)) { machinePreq.OnProfilerStatusChecking(profLoc); if (!IsProfilerInstalled(inprocServer32Key, ProfilerLocation.GetExpectedFileDescription(machinePreq.PackageVersion))) { return(false); } } } return(true); }
protected internal virtual void OnProfilerStatusChecking(ProfilerLocation profLoc) { var handler = ProfilerStatusChecking; if (handler == null) { return; } handler(profLoc); }
protected internal virtual void OnProfilerUnregistering(ProfilerLocation profLoc) { var handler = ProfilerUnregistering; if (handler == null) { return; } handler(profLoc); }
protected internal virtual void OnProfilerStatusChecking(ProfilerLocation profLoc) { Prerequisite.OnProfilerStatusChecking(profLoc); }