Search Results for

    Show / Hide Table of Contents

    RPS Package Provider

    The RPS Package Provider is a PowerShell module that provides RPS with the ability to Connect to find, download, test, and install patches.

    How the Package Provider tests or installs a patch depends on the patch's product type. For more information on the product types see: RPS Patch Product Types

    WindowsHotfix

    To test if a WindowsHotfix patch is installed the following command is used by the Package Provider:

    Get-Hotfix -Id <ProductId> -ErrorAction SilentlyContinue
    
    • ProductId - The product id from the patch manifest, which is the unique identifier of the product.

    To install a WindowsHotfix patch the following command is used by the Package Provider:

    wusa.exe "<Path to installer executable>" /quiet /norestart
    
    • Path to installer executable - this is the path to the actual file that kicks off the install process.
      • For example: C:\packages\MyPatch1.0.0\installer.exe

    WindowsMsi

    To test if a WindowsMsi patch is installed the following command is used by the Package Provider:

        $params = @{
            Name            = "<ProductName>"
            RequiredVersion = "<ProductVersion>"
            ProviderName    = 'programs','msi'
            ErrorAction     = 'SilentlyContinue'
        }
        Get-Package @params
    
    • ProductName - The product name from the patch manifest that identifies the name of the installed product.
    • ProductVersion - The product version from the patch manifest that identifies the version of the installed product.

    To install a WindowsMsi patch the following command is used by the Package Provider:

    msiexec.exe /i "<Path to installer msi>" /quiet /norestart
    
    • Path to installer msi - this is the path to the actual file that kicks off the install process
      • For example: C:\packages\MyPatch1.0.0\installer.msi

    WindowsMsp

    To test if a WindowsMsp patch is installed the following command is used by the Package Provider:

        $params = @{
            Name            = "<ProductName>"
            RequiredVersion = "<ProductVersion>"
            ProviderName    = 'programs','msi'
            ErrorAction     = 'SilentlyContinue'
        }
        Get-Package @params
    
    • ProductName - The product name from the patch manifest that identifies the name of the installed product.
    • ProductVersion - The product version from the patch manifest that identifies the version of the installed product.

    To install a WindowsMsp patch the following command is used by the Package Provider:

    msiexec.exe /p "<Path to installer msp>" /quiet /norestart
    
    • Path to installer msp - this is the path to the actual file that kicks off the install process
      • For example: C:\packages\MyPatch1.0.0\patchInstaller.msp

    WindowsCabinet

    Note

    The RPS Package Provider is only compatible with Windows KB (Knowledge Base) updates that have the CAB file format. Other CAB files may not work using this method. You can test if a CAB file is compatible by using the Dism command explained below to see if its compatible with the RPS Package Provider. If they are not compatible then they may be able to be installed using the script framework and a custom PowerShell script that can install the file.

    To test if a WindowsCabinet patch is installed the following command is used by the Package Provider:

    Get-Hotfix -Id <ProductId> -ErrorAction SilentlyContinue
    
    • ProductId - The product id from the patch manifest, which is the unique identifier of the product.

    To install a WindowsCabinet patch the following command is used by the Package Provider:

    Dism\Add-WindowsPackage -PackagePath <Path to cab archive> -Online -NoRestart
    
    • Path to cab archive - this is the path to the actual file for the cab archive
      • for example: C:\packages\MyPatch1.0.0\cabArchive.cab

    WindowsExe

    To test if a WindowsExe patch is installed use following script which is used internally by the Package Provider:

    $Name = "<ProductName>"
    $IdentifyingNumber = "<ProductId>"
    $Version = "<ProductVersion>"
    
    $uninstallRegistryKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
    $uninstallRegistryKeyWow64 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
    
    $productEntry = $null
    $productEntryPath = $null
    
    if ([String]::IsNullOrEmpty($Version) -or ([String]::IsNullOrEmpty($IdentifyingNumber) -and [String]::IsNullOrEmpty($Name)))
    {
        return $productEntry
    }
    
    if (-not [String]::IsNullOrEmpty($IdentifyingNumber))
    {
        $productEntryKeyLocation = Join-Path -Path $uninstallRegistryKey -ChildPath $IdentifyingNumber
        $productEntryPath = Get-Item -Path $productEntryKeyLocation -ErrorAction 'SilentlyContinue'
    
        if ($null -eq $productEntryPath)
        {
            $productEntryKeyLocation = Join-Path -Path $uninstallRegistryKeyWow64 -ChildPath $IdentifyingNumber
            $productEntryPath = Get-Item -Path $productEntryKeyLocation -ErrorAction 'SilentlyContinue'
        }
    
        if ($productEntryPath -and $Version -eq (Get-LocalizedRegistryKeyValue -RegistryKey $productEntryPath -ValueName 'DisplayVersion'))
        {
            Write-Host "True"
        }
    }
    else
    {
        foreach ($registryKeyEntry in (Get-ChildItem -Path @( $uninstallRegistryKey, $uninstallRegistryKeyWow64) -ErrorAction 'Ignore' ))
        {
            if ($Name -eq (Get-LocalizedRegistryKeyValue -RegistryKey $registryKeyEntry -ValueName 'DisplayName') -and
                $Version -eq (Get-LocalizedRegistryKeyValue -RegistryKey $registryKeyEntry -ValueName 'DisplayVersion'))
            {
                Write-Host "True"
            }
        }
    }
    
    Write-Host "False"
    
    • ProductName - The product name from the patch manifest that identifies the name of the installed product.
    • ProductVersion - The product version from the patch manifest that identifies the version of the installed product.
    • ProductId - The product id from the patch manifest, which is the unique identifier of the product.

    To install a WindowsExe patch the following command is used by the Package Provider:

    <Path to executable> <InstallArguments>
    
    • Path to executable - this is the path to the actual file for the exe
      • For example: C:\packages\MyPatch1.0.0\installer.exe /quiet

    LinuxRpm

    To test if a LinuxRpm patch is installed the following command is used by the Package Provider:

    rpm -qa <ProductName> | grep <ProductVersion>
    
    • ProductName - The product name from the patch manifest that identifies the name of the installed product.
    • ProductVersion - The product version from the patch manifest that identifies the version of the installed product.

    To install a LinuxRpm patch the following command is used by the Package Provider:

    yum -y --nogpgcheck localinstall <Path to RPM>
    
    • Path to RPM - this is the path to the actual file for the RPM
      • For example: /root/packages/MyPatch1.0.0/installer.rpm

    ScriptFramework

    To test if a ScriptFramework patch is installed you can run the "Test" method of your ScriptFramework script directly.

    To install a ScriptFramework patch you can execute the "Set" method of your ScriptFramework script directly.

    For more information and examples on this see: Packaging Script Framework

    In This Article
    Back to top Generated by DocFX