tis-powershell3 3.0.0-4

  • package : tis-powershell3
  • version : 3.0.0-4
  • description : Powershell 3.0 management framework KB2506146
  • maintainer : Hubert TOUVET
  • date : 2017-07-20 11:23:41
  • signer : TRANQUIL IT SYSTEMS
  • signature_date : 20170720-112340
  • min_os_version : 6.0
  • min_wapt_version :
  • Depends :

setup.py

# -*- coding: utf-8 -*-
from setuphelpers import *
import re

uninstallkey = []

def is_kb_installed(hotfixid):
    installed_update = installed_windows_updates()
    if [kb for kb in installed_update if kb['HotFixID' ].upper() == hotfixid.upper()]:
        return True
    return False

def waiting_for_reboot():
    # Query WUAU from the registry
    if reg_key_exists(HKEY_LOCAL_MACHINE,r"SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired") or \
        reg_key_exists(HKEY_LOCAL_MACHINE,r"SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending") or \
        reg_key_exists(HKEY_LOCAL_MACHINE,r'SOFTWARE\Microsoft\Updates\UpdateExeVolatile'):
        return True
    return False

def install():
    if windows_version() < Version('6.1'):
        kb = 'KB2506146'
        if not is_kb_installed(kb):
            if iswin64():
                msu = 'Windows6.0-KB2506146-x64.msu'
            else:
                msu = 'Windows6.0-KB2506146-x86.msu'
            run('wusa.exe "{}" /quiet /norestart'.format(msu),accept_returncodes=[0,3010,2359302],timeout=3600)
            print('reboot needed')
        else:
            print('{} already installed'.format(kb))
    else:
        kb = 'KB2506143'
        if not is_kb_installed(kb):
            if iswin64():
                msu = 'Windows6.1-KB2506143-x64.msu'
            else:
                msu = 'Windows6.1-KB2506143-x86.msu'
            run('wusa.exe "{}" /quiet /norestart'.format(msu),accept_returncodes=[0,3010,2359302],timeout=3600)
            print('reboot needed')
        else:
            print('{} already installed'.format(kb))

    if waiting_for_reboot():
        print('A reboot is needed !')


    

manifest

[["WAPT/certificate.crt", "0db563dc9077b268ca07ba834322d0fc5e21f8e5"], ["WAPT/wapt.psproj", "557e60050809687d56525e6ac46df9c0e02ccae6"], ["Windows6.0-KB2506146-x86.msu", "4f59b2b6711a47feadabff3eacd6d5f9b3a4b867"], ["Windows6.1-KB2506143-x86.msu", "de0819c0efb5b42c378075df9ee545859131c22e"], ["Windows6.1-KB2506143-x64.msu", "31b738cc9a7ffb3addd3c575fc58dfa726be8a8a"], ["Windows6.0-KB2506146-x64.msu", "e7dfbf60f047bdd412c48eb45a05a0193b3bc0dc"], ["setup.py", "31070844900c775e9e2642cede8146df66c9c59f"], ["WAPT/control", "26451083f77aad20f9a60e87b4a4503f67678313"]]