rgl / packer-plugin-windows-update

Packer plugin for installing Windows updates
Mozilla Public License 2.0
304 stars 71 forks source link

Attempts to resolve issues created when two updates named the same with different dates causing HRESULT: 0x80240013 #132

Closed stuartp44 closed 10 months ago

stuartp44 commented 1 year ago

This PR detects when an update is attempted to be installed which equal the same update by its title. We do this by comparing what is currently in the install object, using the update title and skip the update it if we find it already in the object. This stops the HRESULT: 0x80240013 which is, as far as I know, when a duplicate update is attempted to be installed at the same time.

Resolves #131

rgl commented 1 year ago

What made you believe that updates are being compared by title?

stuartp44 commented 1 year ago

See https://github.com/rgl/packer-plugin-windows-update/issues/131

stuartp44 commented 1 year ago

May I ask for feedback for this? this PR genuinely fixes an issue we have using this and has no effect on dropping updates as they will be installed (if valid) on the next search. For us, on the next search the duplicate update is not there anymore and is actually installed by the first detect and install.

stuartp44 commented 1 year ago

Is this able to be pushed into master now?

rgl commented 1 year ago

Am I sorry. But this is making too many style code changes; what are you using to reformat this?

Anyhow, please, limit the changes to just the part that has the change:

if (($updatesToInstall | Select-Object -ExpandProperty Title) -contains $updateTitle) {
...
stuartp44 commented 1 year ago

Done and resolved the formatting. I use prettier, just had to disable it as it does it without having to save.

stuartp44 commented 1 year ago

Chasing up on this? Are you happy with the changes?