Example #1
0
        /// <summary>
        /// Gets whether the product defined by the package <paramref name="path"/> is installed.
        /// </summary>
        /// <param name="path">The path to the package to test.</param>
        /// <returns>True if the package is installed; otherwise, false.</returns>
        public static bool IsPackageInstalled(string path)
        {
            string productCode;

            if (!PathsToProductCodes.TryGetValue(path, out productCode))
            {
                productCode = MsiUtils.GetMSIProductCode(path);
                PathsToProductCodes.Add(path, productCode);
            }

            return(MsiUtils.IsProductInstalled(productCode));
        }
Example #2
0
 /// <summary>
 /// Gets whether the product defined by the package <paramref name="productCode"/> is installed.
 /// </summary>
 /// <param name="path">The product code of the package to test.</param>
 /// <returns>True if the package is installed; otherwise, false.</returns>
 public static bool IsProductInstalled(string productCode)
 {
     return(MsiUtils.IsProductInstalled(productCode));
 }
        /// <summary>
        /// Gets whether the product defined by the package <paramref name="path"/> is installed.
        /// </summary>
        /// <param name="path">The path to the package to test.</param>
        /// <returns>True if the package is installed; otherwise, false.</returns>
        private bool IsPackageInstalled(string path)
        {
            string productCode = MsiUtils.GetMSIProductCode(path);

            return(MsiUtils.IsProductInstalled(productCode));
        }