コードから .msu インストールをサイレント モードで実行する方法はありますか?
msi ファイルで可能であることはわかっていますが、.msu を実行すると失敗します。
コードから .msu インストールをサイレント モードで実行する方法はありますか?
msi ファイルで可能であることはわかっていますが、.msu を実行すると失敗します。
It depends on what you mean by "from code". If you are willing to run a separate EXE (rather than invoke an API), then you can use WUSA.exe
to install .MSU files. See KB 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
: Run Wusa.exe in quiet mode without user interaction. When the tool runs in quiet mode, it runs without user interaction. The computer restarts if it is required. [ . . . ]
/norestart
: Prevent Wusa.exe from restarting the computer. The /norestart switch is ignored if the /quiet switch is not present. [ . . . ]For example, if the Windows6.0-KB934307-x86.msu file is in the D:\934307 folder, type the following command at a command prompt to install the update package:
wusa.exe D:\934307\Windows6.0-KB934307-x86.msu /quiet /norestart