Windows automatic update API (5)

Source: Internet
Author: User

BenArticleModify the deficiencies and errors in previous articles. Hope to help you.

In Vista and XP, wua varies in many places, depending on the XP Automatic update version. The biggest difference is that after the Xp-sp2 is installed, the wua version is relatively old, and many functions in the interface are not provided. For example: proxy class, iupdate3, iupdatesearcher2, etc. Therefore, when developing with. net, pay attention to whether the client has updated wua. Basically, the latest wua version is V6. It is slightly different from the version provided in Vista.

Proxy:
For example, if a company sets up a proxy, it will not be updated in XP, but Vista will, because the dialog box for users to enter the username and password of the proxy will pop up in Vista. In this caseProgramTo search, download, and install, you must first create a proxy class and then create an operation class for the proxy class.

CodeRefer to the following:

1 Wuapilib. updatesessionclass session =   New Wuapilib. updatesessionclass ();
2
3 Session. WebProxy. Address =   @" ********** " ;
4 Session. WebProxy. promptforcredentials (sender, " Input your passport! " );

Promptforcredentials method. The system dialog box is displayed. After you enter the user name and password, it is automatically assigned to the proxy class.

1 Wuapilib. iupdatesearcher upsearch = Session. createupdatesearcher ();
2 Wuapilib. iupdatedownloader updownload = Session. createupdatedownloader ();
3 Wuapilib. iupdateinstaller2 upinstall = (Wuapilib. iupdateinstaller2) Session. createupdateinstaller ();

Finally, if you are using the D version of the operating system, the automatic update first requires you to update the WGA, and the subsequent program can be updated only when the verification is passed, you can use your own programs to update parts that cannot be updated automatically under XP, such as drivers.

I am also working on related software. I will share it with you later.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.