Esempio n. 1
0
        /// <summary>
        /// Installs files that are unexpectedly missing.
        /// </summary>
        /// <param name="product">Product code for the product that owns the component to be installed</param>
        /// <param name="component">Component to be installed</param>
        /// <param name="installState">Specifies the way the component should be installed.</param>
        /// <exception cref="InstallCanceledException">the user exited the installation</exception>
        /// <remarks><p>
        /// Win32 MSI API:
        /// <a href="http://msdn.microsoft.com/library/en-us/msi/setup/msiinstallmissingcomponent.asp">MsiInstallMissingComponent</a>
        /// </p></remarks>
        public static void InstallMissingComponent(string product, string component, InstallState installState)
        {
            uint ret = NativeMethods.MsiInstallMissingComponent(product, component, (int)installState);

            if (ret != 0)
            {
                throw InstallerException.ExceptionFromReturnCode(ret);
            }
        }