3

We're building a new installer for our software, which consists of installing SQL Server 2014 Express. One thing about SQL Server is that it does not allow you to continue installing if your computer's pending a restart. We run it in silent mode, so it essentially just fails to install SQL Server. More specifically, when the computer's pending restart due to Windows updates.

I found this question, but did not help. Then I found this article, wrote a function, and actually answered on that question.

Then I tested it on a few other systems. It turns out, this function also returns true on a system which is pending any Windows updates, but not necessarily a restart. In fact, this system hasn't had an update since January... But the SQL Server install itself doesn't complain. So one or more of the checks in this function are not necessary.

enter image description here

I disabled two of those checks:

  • SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Services\Pending
  • Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\PackagesPending

However it's still returning true on the system which SQL doesn't actually have a problem with.

Which of these checks are necessary for us to test to equate to SQL Server's checks, so that we can ensure the SQL installation won't fail later on in the install process?

Ken White
  • 123,280
  • 14
  • 225
  • 444
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
  • So far, it seems the second and third check are not necessary, which is the complete opposite of what the other answer I found says... – Jerry Dodge Oct 17 '20 at 20:59
  • Interesting q, +1, but at the risk of being obtuse, why not just force a restart before you begin? – MartynA Oct 17 '20 at 21:16
  • @MartynA It's a rare situation, but Windows Updates will be Windows Updates. We all know that pain. However, depending on the nature, it could require numerous reboots. User could reboot, come back to the installer, then boom, it requires another reboot. Plus we would need to keep track of whether the installer started and asked user to reboot. We're trying to make this installer as painless as possible for our users. – Jerry Dodge Oct 17 '20 at 21:17
  • I don't see why this question is tagged Delphi, as it has nothing at all to do with Delphi. – Ken White Oct 17 '20 at 23:52
  • 1
    @KenWhite "at all" except for the fact that the code I wrote is in Delphi, and easily converted to Inno Setup, given its pascal root... – Jerry Dodge Oct 17 '20 at 23:57

0 Answers0