Page 1 of 1

Check for Windows 8.1 Update 1 (KB2919355)

Posted: Mon Jun 16, 2014 5:16 pm
by wmmiller
Hi Fred.
Is there a way to make UVK check automatically for this update when it opens? It seems that this update must be installed for Windows 8.1 to receive further updates. I saw some talk about this online. That’s what prompted me to ask what you think. One would know right off the bat if it’s missing.

Bill

http://superuser.com/questions/742124/h ... indows-8-1

Re: Check for Windows 8.1 Update 1 (KB2919355)

Posted: Mon Jun 16, 2014 5:24 pm
by Fred
Hi Bill.

I'll try to make a script that tells if the update is installed. Since UVK scripts now can have AutoIt code, it shouldn't be too hard.

Re: Check for Windows 8.1 Update 1 (KB2919355)

Posted: Mon Jun 16, 2014 8:14 pm
by Fred
OK, here's what I cam up with:

Code: Select all

  <AutoItScript>

$kbUpdate = 'KB2919355'
MsgBox(0, $kbUpdate&' check', _IsUpdateInstalled($kbUpdate) ? _
('The update '&$kbUpdate&' is installed.') : _
('The update '&$kbUpdate&' is NOT installed.'))

Func _IsUpdateInstalled($kbName)
	Local $updObj = ObjCreate('Microsoft.Update.Session')
	Local $objSearcher = $updObj.CreateUpdateSearcher()
	Local $histCount = $objSearcher.GetTotalHistoryCount()
	Local $histCol = $objSearcher.QueryHistory(0,$histCount)
	Local $updItem, $title
	For $i = 0 To $histCount -1
		$updItem = $histCol.Item($i)
		If StringInStr($updItem.Title,$kbName) Then Return 1
	Next
	Return 0
EndFunc ;==> _IsUpdateInstalled
You can use this script to check the update you want.
Just set $kbUpdate to the desired KB number.
The message box will tell you if the update is installed or not.

Re: Check for Windows 8.1 Update 1 (KB2919355)

Posted: Mon Jun 16, 2014 8:34 pm
by Fred
This one is better. It tells the date at which the update was installed.

Code: Select all

  <AutoItScript>

$kbUpdate = 'KB2919355'
$date = _IsUpdateInstalled($kbUpdate)
MsgBox(0, $kbUpdate&' check', ($date <> '') ? _
('The update '&$kbUpdate&' was installed at '&$date&'.') : _
('The update '&$kbUpdate&' is NOT installed.'))

Func _IsUpdateInstalled($kbName)
	;Returns the date at which the update was installed,
	;or an empty string if it's not installed
	Local $updObj = ObjCreate('Microsoft.Update.Session')
	If Not IsObj($updObj) Then Return SetError(1,0,'')
	Local $objSearcher = $updObj.CreateUpdateSearcher()
	If Not IsObj($objSearcher) Then Return SetError(2,0,'')
	Local $histCount = $objSearcher.GetTotalHistoryCount()
	Local $histCol = $objSearcher.QueryHistory(0,$histCount)
	If Not IsObj($histCol) Then Return SetError(3,0,'')
	Local $updItem, $title
	For $i = 0 To $histCount -1
		$updItem = $histCol.Item($i)
		If Not IsObj($updItem) Then ContinueLoop
		If StringInStr($updItem.Title,$kbName) Then Return _
		StringRegExpReplace($updItem.Date, _
		'(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})', _
		'$1/$2/$3 $4:$5:$6')
	Next
	Return ''
EndFunc ;==> _IsUpdateInstalled

Re: Check for Windows 8.1 Update 1 (KB2919355)

Posted: Mon Jun 16, 2014 9:35 pm
by Fred
So, if I understood correctly, UVK should check if
The OS version is windows 8.1 AND
The OS build number is smaller than 17031 AND
The the KB2919355 update is not installed.

If all the conditions above meet, it should display a message box telling the KB2919355 update needs to be installed.

Is that it?

Re: Check for Windows 8.1 Update 1 (KB2919355)

Posted: Tue Jun 17, 2014 1:22 am
by wmmiller
Yes, that should do it. Then one could get that out of the way and know that future updates will be available.

Re: Check for Windows 8.1 Update 1 (KB2919355)

Posted: Tue Jun 17, 2014 11:52 am
by Fred
OK, it's done. Check out the new beta.

Note I could not try this out, as I currently don't have any machine with win 8.1 and the update missing.

It would be useful if you could test it out before releasing the new stable version.

Re: Check for Windows 8.1 Update 1 (KB2919355)

Posted: Tue Jun 17, 2014 12:40 pm
by wmmiller
Thanks Fred,
So, UVK is checking as it starts? I may need to do a fresh 8.1 install. I don’t think I will have time for a few days though. We have people coming to help us cut down a bunch of trees and move more stuff to the new house. Maybe someone else will see this and be able to report back as well.

Bill

Re: Check for Windows 8.1 Update 1 (KB2919355)

Posted: Tue Jun 17, 2014 1:01 pm
by Fred
Yes, UVK is checking it out when it starts. If the update is not installed, it will notify you through a message box.

Currently, the message box just tells you the update is missing. It does not do anything else.

The best way to try this out is to setup a virtual machine with a windows 8.1 fresh install. If you can't do that, don't worry, I'll do it myself.