/// <summary> /// Will check if Windows Update package is installed, and install package if not already installed. /// </summary> /// <param name="install"></param> /// <param name="packageId">Windows package KB-id. Example: KB1234567</param> /// <param name="packageUrl">The URL for the msi install file</param> /// <param name="packageName">A uniqe package name (DisplayName in Windows Registry) to make this /// operation idempotent. Example: Security Update for Microsoft .NET Framework 4.5.1 (KB2972216). /// If this package name is not correct, ConDep will install this package /// on every execution. ConDep looks in these three registry keys for installed software packages: /// HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall /// HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall /// HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall</param> /// <returns></returns> public static IOfferRemoteInstallation WindowsUpdate(this IOfferRemoteInstallation install, string packageId, string packageUrl, string packageName) { var winUpdateOperation = new InstallWindowsUpdateOperation(packageId, packageUrl, packageName); Configure.Operation(install, winUpdateOperation); return(install); }
/// <summary> /// Will check if Windows Update package is installed, and install package if not already installed. /// </summary> /// <param name="install"></param> /// <param name="packageId">Windows package KB-id. Example: KB1234567</param> /// <param name="packageUrl">The URL for the msi install file</param> /// <param name="packageName">A uniqe package name (DisplayName in Windows Registry) to make this /// operation idempotent. Example: Security Update for Microsoft .NET Framework 4.5.1 (KB2972216). /// If this package name is not correct, ConDep will install this package /// on every execution. ConDep looks in these three registry keys for installed software packages: /// HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall /// HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall /// HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall</param> /// <returns></returns> public static IOfferRemoteInstallation WindowsUpdate(this IOfferRemoteInstallation install, string packageId, string packageUrl, string packageName) { var winUpdateOperation = new InstallWindowsUpdateOperation(packageId, packageUrl, packageName); OperationExecutor.Execute((RemoteBuilder)install, winUpdateOperation); return(install); }