Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

How to avoid OS reboot prompt when installing the .NET Framework 3.5 on Windows Vista

How to avoid OS reboot prompt when installing the .NET Framework 3.5 on Windows Vista

  • Comments 31

Description of the issue

When installing the .NET Framework 3.5 or Visual Studio 2008 on Windows Vista RTM, some people have noticed that a Windows Update dialog box pops up to indicate that the system must be restarted in order to complete installation of OS updates.  The dialog box looks something like the following:

What is happening behind the scenes

Windows Vista includes the .NET Framework 2.0 and 3.0 as OS components.  The .NET Framework 3.5 includes Windows Vista OS hotfix packages for the .NET Framework 2.0 SP1 and 3.0 SP1, and both of these hotfixes require reboots in order to complete installation.  The .NET Framework 3.5 setup wrapper contains logic to handle these reboot requests and notify the user, but the Windows Update service in Windows Vista also runs in the background and listens for this type of reboot request and pops up dialog boxes like this to notify the user that a reboot is needed as the result of installing an OS update.

Unfortunately, if this dialog appears during the .NET Framework 3.5 setup or during installation of a product that installs the .NET Framework 3.5 as a prerequisite (such as Visual Studio 2008), and the user chooses to restart using the Restart Now button on this dialog, it can cause the system to reboot even if the .NET Framework 3.5 or Visual Studio 2008 setup is still running.  This can leave the system in an unknown state if these setups are installing something at the time of the reboot.

How to work around this issue

The Visual Studio 2008 readme will include an item suggesting that the user dismiss or ignore this Windows Update dialog if it is seen during .NET Framework 3.5 or Visual Studio 2008 setup.  However, the readme is not always easily found by end users, and this issue can potentially happen for any application that includes the .NET Framework 3.5 setup as a prerequisite on Windows Vista or during unattended deployment of the .NET Framework 3.5.

You can programatically prevent this dialog from appearing when deploying the .NET Framework 3.5.  This logic can be included in the script used for unattended deployment or within a setup process that includes the .NET Framework 3.5 as a prerequisite.

Use Windows Update Agent (WUA) APIs to pause the Windows Update service

To implement this solution, whatever script or process you are using to launch the .NET Framework 3.5 setup will use the Pause and Resume APIs on the IAutomaticUpdates interface in the Windows Update Agent (WUA) API set to temporarily pause and resume Windows Update functionality on the system.

You can use steps like the following to accomplish this:

  1. Call the Pause API to pause the Windows Update service
  2. Install the .NET Framework 3.5
  3. Reboot the system if the .NET Framework 3.5 setup returns exit code 3010
  4. Call the Resume API to resume the Windows Update service if the .NET Framework 3.5 setup does not return 3010

If you call Pause without calling Resume, the operation will eventually time out (the default time out value is 8 hours).  Rebooting the system will also cause the Windows Update service to resume without needing to call the Resume method.

<update date="12/13/2007"> Removing option suggesting that users disable the wuauserv service to workaround this issue.  Doing this can cause failures during .NET Framework 2.0 SP1 or 3.0 SP1 installation on Windows Vista and should not be used.  The valid workarounds are to ignore the reboot prompt or use the WUA Pause and Resume APIs </update>

 

  • Visual Studio 2008 is out! I've upgraded three machines (two Vista, one XP) from Beta 2 to RTM, then

  • You've been kicked (a good thing) - Trackback from DotNetKicks.com

  • Wow, this is a very serious bug, Aaron. Please work with the folks there to fix this.

    I've opened a bug on MS Connect:

    https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=313381

    Folks, please vote for this an get this serious problem fixed.

  • PingBack from http://www.tudorvlad.ro/2007/11/30/visual-studio-2008-net-fw-35-overview/

  • Aaron,

    with all respect (and kudos for discussing this), I think your assesment is removed from end user reality.

    The typical end user cannot tell apart "Funny Photos Setup" from "Windows Update". He's installing his new toy, a message pops up to "reboot to finish installing", and if he does, he's probably screwed.

    The typical support call is "Your software broke my system", and you will be lucky to figure out that it happened during installation.

    It's a hard job to train end users to actually reboot their system when a setup or Windows Update says "reboot". That impulse might actually a few hapless helpdesk souls, but next time our user will say "some computer guy told me not to reboot when this comes up". Some 3rd party vendors will work around by telling their users to deactivate Windows Update.

    Microsoft expects one billion Windows computers next year. This is a component that will be redistributed by aspiring coders that wanted to "creating fun, cool projects that run on Windows" (quote MS web site), not fix installers.

    This is the setup for a system update getting hairy with a system component that is core to security and stability.

    I know these things aren't easy to get right. But if Microsoft doesn't think it's important, why should "we" - 3rd party developers?

    I understand that your position is no official Microsoft statement, and I assume the bug is not your fault. I just wish you understand that there are more than just the technical issues.

  • Hi Peterchen - I definitely understand the possible user confusion caused by this issue.  The worst part is that this issue can affect any application that installs the .NET Framework 3.5, not just developer tools like Visual Studio.  I've communicated all of the feedback collected on this blog post to the .NET Framework setup team, but there's not a lot more I can do in the meantime.  I'm going to try to work with them to create some sample code to implement the WU pause/resume APIs described above.

    Also, I've experienced this issue on a couple of systems since the time that I posted my original comments about this issue, and it is worse then I initially anticipated because the time it takes to install 2.0 SP1, 3.0 SP1 and 3.5 on Windows Vista RTM can be really long.  That makes it more likely that folks will notice the reboot prompt from Windows Update even if they're not actively watching their systems during installation of 3.5.  The main piece of good news is that this issue won't affect systems that have Vista SP1, but of course that won't be available for a few more months, plus it doesn't provide a solution for applications that want to only require Vista RTM.

  • PingBack from http://varely.wordpress.com/2007/12/21/be-careful-when-installing-visual-studio-2008-rtm-on-your-vista/

  • I've been working on a simple application to implement the WUA Update/Resume workaround for my installer. Here's how it works:

    1. Check for pending reboots. If A reboot is required, alert the user and quit.

    2. Check for WUA installations in progress. If one is in progress, alert the user and quit.

    3. Pause the WUA

    I'm not currently bothering to resume, since this should happen in 8 hours anyway (or the next time the user reboots).

    The problem is that, while the IUpdateInstaller interface's IsBusy property allows me to make sure no WUA installations are running, I don't see any way to determine whether or not a "download and immediately install" cycle is currently in its download phase. This means that if an update is being downloaded when my installer starts, the WUA may begin installing it and interrupt my installer despite all the precautions.

    Is there a way to detect WUA downloads in progress (other than the ones you initiate) or prevent them from installing after the download completes? (I hoped that using Pause would do the latter, but it doesn't seem to.)

  • Hi Jsn_segal - I had expected that the Pause method would prevent Automatic Updates from proceeding to install an update after it got done downloading in this type of scenario.  I will try to ask around and see if I can find someone who works with the WUA APIs more closely to see if there are any options for handling that scenario.

  • Hi Jsn_segal - I discussed this scenario with a few folks who work on the WUA APIs and Automatic Updates here at Microsoft.  They indicated that there is not a way to detect that an Automatic Updates download is in progress, but that Automatic Updates will not proceed to the installation phase for an update if Pause was called.

  • My setup application has to pre-install the .NET Framework 3.5 and ran into the same issue that the reboot prompt dialog shows up.

    Using the IAutomaticUpdates::Pause and IAutomaticUpdates::Resume, the dialog disappears but even worse, it will reboot while my setup application is still running without any warning.

    I called the IAutomaticUpdates::Pause at the first beginning of the setup application and called the IAutomaticUpdates::Resume at the end of the setup application. The rebooting happens before calling the IAutomaticUpdates::Resume.

    Can anyone tell me how to work arround this issue? It has been a testing blocker right now.

    Thanks!

  • error when installing vs2008 on vista

  • Hello all,

    Does anyone know if I may run into this same sort of thing installing .NET 4.0 full?

    Should I presume that this will certainly show up if the 4.0 is installed unto a machine that has not even the 3.5 version?

  • Hi Another puzzled tech - It is possible that the .NET Framework 4 will require a reboot in the way described in this blog post.  It is not guaranteed to happen 100% of the time, so you shouldn't assume that it will certainly show up.  However, your installation process should include logic to check the return code from the .NET Framework setup process and prompt the user to reboot if the return code is 3010.

  • I went to update my .NET framework 4 today as a part of an update to a program. It detected that it doesn't require an update as it is on the most current version. It did however prompt a restart and now my machine restarts perpetually. It will turn on tell me that .NET framework is up to date and as soon as I close the prompt it will load my desktop and prompt me about the inevitable restart. I am at a loss.

Page 2 of 3 (31 items) 123
Leave a Comment
  • Please add 4 and 7 and type the answer here:
  • Post