Managing windows updates (WUApilib)
-
I'm working on a application that will manage Windows updates for you (asynchronous). Everything is working except it will popup messages to users. Like when installing Language Packs it will display the installation for that, and if trying to install Internet Explorer 9 it will popup and ask the user to Accept, Ask me Later, or Don't Install. Is there a way to hide everything and just install it? I've search through Microsoft's pages on this API and can't find it. Here is where I perform the install. I didn't include any of the code for the callbacks or downloads because it would a huge post which you all probably wouldn't like lol. If you want me to I can.
public static void Install(UpdateCollection installs)
{
if (installer != null || installs.Count > 0)
{
if (updateSession == null)
updateSession = new UpdateSessionClass();try { installer = updateSession.CreateUpdateInstaller(); installer.Updates = installs; installer.AllowSourcePrompts = false; installer.parentWindow = null; WUInstProgress installProgress = new WUInstProgress(); WUInstCompleted installCompleted = new WUInstCompleted(); installCompleted.InstCompleted += new InstCompletedDelegate(installCompleted\_InstCompleted); installer.BeginInstall(installProgress, installCompleted, null); } catch (Exception ex) { ReportError(ex.ToString()); } } else ReportLog("Install collection was null or empty"); }
-
I'm working on a application that will manage Windows updates for you (asynchronous). Everything is working except it will popup messages to users. Like when installing Language Packs it will display the installation for that, and if trying to install Internet Explorer 9 it will popup and ask the user to Accept, Ask me Later, or Don't Install. Is there a way to hide everything and just install it? I've search through Microsoft's pages on this API and can't find it. Here is where I perform the install. I didn't include any of the code for the callbacks or downloads because it would a huge post which you all probably wouldn't like lol. If you want me to I can.
public static void Install(UpdateCollection installs)
{
if (installer != null || installs.Count > 0)
{
if (updateSession == null)
updateSession = new UpdateSessionClass();try { installer = updateSession.CreateUpdateInstaller(); installer.Updates = installs; installer.AllowSourcePrompts = false; installer.parentWindow = null; WUInstProgress installProgress = new WUInstProgress(); WUInstCompleted installCompleted = new WUInstCompleted(); installCompleted.InstCompleted += new InstCompletedDelegate(installCompleted\_InstCompleted); installer.BeginInstall(installProgress, installCompleted, null); } catch (Exception ex) { ReportError(ex.ToString()); } } else ReportLog("Install collection was null or empty"); }
I don't believe you can control these prompts since they are coming from the component being installed, which you have access to.
I know the language. I've read a book. - _Madmatt
-
I'm working on a application that will manage Windows updates for you (asynchronous). Everything is working except it will popup messages to users. Like when installing Language Packs it will display the installation for that, and if trying to install Internet Explorer 9 it will popup and ask the user to Accept, Ask me Later, or Don't Install. Is there a way to hide everything and just install it? I've search through Microsoft's pages on this API and can't find it. Here is where I perform the install. I didn't include any of the code for the callbacks or downloads because it would a huge post which you all probably wouldn't like lol. If you want me to I can.
public static void Install(UpdateCollection installs)
{
if (installer != null || installs.Count > 0)
{
if (updateSession == null)
updateSession = new UpdateSessionClass();try { installer = updateSession.CreateUpdateInstaller(); installer.Updates = installs; installer.AllowSourcePrompts = false; installer.parentWindow = null; WUInstProgress installProgress = new WUInstProgress(); WUInstCompleted installCompleted = new WUInstCompleted(); installCompleted.InstCompleted += new InstCompletedDelegate(installCompleted\_InstCompleted); installer.BeginInstall(installProgress, installCompleted, null); } catch (Exception ex) { ReportError(ex.ToString()); } } else ReportLog("Install collection was null or empty"); }
While I can't help you directly, you can bingle SilentInstall for those apps/components if any such options. Another possible way would be robocopy or the likes. Good Luck. For instance take a look here or herefor a silent or unattended install of .net framework 4. They(MS) say it's like this: dotnetfx.exe /q:a /c:"install /q" Or just search for it yourself. My bingle foo is pretty low. :)
All the best, Dan
modified on Wednesday, July 13, 2011 12:57 PM
-
While I can't help you directly, you can bingle SilentInstall for those apps/components if any such options. Another possible way would be robocopy or the likes. Good Luck. For instance take a look here or herefor a silent or unattended install of .net framework 4. They(MS) say it's like this: dotnetfx.exe /q:a /c:"install /q" Or just search for it yourself. My bingle foo is pretty low. :)
All the best, Dan
modified on Wednesday, July 13, 2011 12:57 PM
But that isn't using the windows update API. The problem is I'm not exactly sure how or if it is possible to tell using the API which updates require a users input. If it does require a user input I could set it as needed to be manually installed and skip it or fire off another script to manually download the files and run it silently.
-
I'm working on a application that will manage Windows updates for you (asynchronous). Everything is working except it will popup messages to users. Like when installing Language Packs it will display the installation for that, and if trying to install Internet Explorer 9 it will popup and ask the user to Accept, Ask me Later, or Don't Install. Is there a way to hide everything and just install it? I've search through Microsoft's pages on this API and can't find it. Here is where I perform the install. I didn't include any of the code for the callbacks or downloads because it would a huge post which you all probably wouldn't like lol. If you want me to I can.
public static void Install(UpdateCollection installs)
{
if (installer != null || installs.Count > 0)
{
if (updateSession == null)
updateSession = new UpdateSessionClass();try { installer = updateSession.CreateUpdateInstaller(); installer.Updates = installs; installer.AllowSourcePrompts = false; installer.parentWindow = null; WUInstProgress installProgress = new WUInstProgress(); WUInstCompleted installCompleted = new WUInstCompleted(); installCompleted.InstCompleted += new InstCompletedDelegate(installCompleted\_InstCompleted); installer.BeginInstall(installProgress, installCompleted, null); } catch (Exception ex) { ReportError(ex.ToString()); } } else ReportLog("Install collection was null or empty"); }
Ahhh I over looked it: http://msdn.microsoft.com/en-us/library/aa386492(v=VS.85).aspx[^] Using IUpdateInstaller2 instead of IUpdateInstaller allows you to forcequiet installs. It doesn't hurt to go through all the references again a few times :-). I will post back if it worked or not.... *Update* Worked pretty good! The only thing is the updates will still fail if it is unable to install silently. The one I tested was Internet Explorer 9. At least this gives me the ability to filter them out and not have it pending for a users input.
modified on Wednesday, July 13, 2011 10:20 PM
-
Ahhh I over looked it: http://msdn.microsoft.com/en-us/library/aa386492(v=VS.85).aspx[^] Using IUpdateInstaller2 instead of IUpdateInstaller allows you to forcequiet installs. It doesn't hurt to go through all the references again a few times :-). I will post back if it worked or not.... *Update* Worked pretty good! The only thing is the updates will still fail if it is unable to install silently. The one I tested was Internet Explorer 9. At least this gives me the ability to filter them out and not have it pending for a users input.
modified on Wednesday, July 13, 2011 10:20 PM