2011-12-27 46 views

回答

2

這取決於你的意思是「來自代碼」。如果您願意運行單獨的EXE(而不是調用API),則可以使用WUSA.exe來安裝.MSU文件。請參閱知識庫文章934307, Description of the Windows Update Stand-alone Installer (Wusa.exe) and of.msu files in Windows Vista, Windows 7, Windows Server 2008 and in Windows Server 2008 R2

/quiet:在沒有用戶交互的安靜模式下運行Wusa.exe。當 工具以安靜模式運行時,它在沒有用戶交互的情況下運行。如果需要, 計算機將重新啓動。 [。 。 。 ]

/norestart:防止Wusa.exe重新啓動計算機。如果/ quiet開關不存在,則忽略 /norestart開關。 [。 。 。 ]

例如,如果Windows6.0-KB934307-x86.msu程序文件是在 d:\ 934307文件夾中,在命令提示輸入以下命令到 安裝更新包:wusa.exe D:\934307\Windows6.0-KB934307-x86.msu /quiet /norestart