Check for Windows 8.1 Update 1 (KB2919355)

Do you know of a feature that UVK should have? Post it here!
Post Reply
wmmiller
Posts: 1097
Joined: Fri Dec 07, 2012 6:02 am
Location: Minnesota, USA

Check for Windows 8.1 Update 1 (KB2919355)

Post 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
Play stupid games….win stupid prizes
Fred
Site Admin
Posts: 2323
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Check for Windows 8.1 Update 1 (KB2919355)

Post 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.
The only thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Fred
Site Admin
Posts: 2323
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Check for Windows 8.1 Update 1 (KB2919355)

Post 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.
The only thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Fred
Site Admin
Posts: 2323
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Check for Windows 8.1 Update 1 (KB2919355)

Post 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
The only thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Fred
Site Admin
Posts: 2323
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Check for Windows 8.1 Update 1 (KB2919355)

Post 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?
The only thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
wmmiller
Posts: 1097
Joined: Fri Dec 07, 2012 6:02 am
Location: Minnesota, USA

Re: Check for Windows 8.1 Update 1 (KB2919355)

Post by wmmiller »

Yes, that should do it. Then one could get that out of the way and know that future updates will be available.
Play stupid games….win stupid prizes
Fred
Site Admin
Posts: 2323
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Check for Windows 8.1 Update 1 (KB2919355)

Post 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.
The only thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
wmmiller
Posts: 1097
Joined: Fri Dec 07, 2012 6:02 am
Location: Minnesota, USA

Re: Check for Windows 8.1 Update 1 (KB2919355)

Post 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
Play stupid games….win stupid prizes
Fred
Site Admin
Posts: 2323
Joined: Sat Jul 30, 2011 12:05 pm
Location: Red coast, France
Contact:

Re: Check for Windows 8.1 Update 1 (KB2919355)

Post 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.
The only thing we humans have in common is that we are all different. So, if you think you're weird because you're different from everyone else, then we are all weird.

Fred
Post Reply