Programmatically installing MSI packages

后端 未结 6 1767
暖寄归人
暖寄归人 2020-12-03 08:23

I would like to install a given .msi package programmatically from my C# .NET application, preferably with the installation parameters that my application specifies (like th

6条回答
  •  心在旅途
    2020-12-03 08:38

    The "Deployment Tools Foundation" project which is a part of the WIX3.5 install contains a .NET wrapper for most (if not all) of the Windows Installer API. Get it by downloading and installing the WiX install: http://wixtoolset.org/ (currently WiX 3.11, updated Aug.2017).

    Locate the Microsoft.Deployment.WindowsInstaller.dll file in the %ProgramFiles%\Windows Installer XML v3.??\SDK\ folder. Set a reference in your C# project and try to run the different APIs and see if you get the desired functionality.

    I highly recommend using Deployment Tools Foundation over any COM Interop from .NET code.

提交回复
热议问题