Esempio n. 1
0
        public static WindowHandleWrapper InstallerWindowWrapper(this Microsoft.Deployment.WindowsInstaller.Session session)
        {
            var title = session.GetPropertyValue(PropertyNames.ProductName);
            var ret   = new WindowHandleWrapper(title + " Setup");

            if (ret.Handle == IntPtr.Zero)
            {
                ret = new WindowHandleWrapper(title);
            }
            return(ret);
        }
Esempio n. 2
0
        public static Version GetDetectedOlderVersion(this Microsoft.Deployment.WindowsInstaller.Session session)
        {
            var olderVersionProductCodeProp = session.GetPropertyValue(PropertyNames.OlderVersionDetected);

            if (!string.IsNullOrEmpty(olderVersionProductCodeProp))
            {
                var productCodes = olderVersionProductCodeProp.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                var versions     = from code in productCodes
                                   join prod in Microsoft.Deployment.WindowsInstaller.ProductInstallation.AllProducts.AsQueryable() on code equals prod.ProductCode
                                   select prod.ProductVersion;
                if (versions.Count() > 0)
                {
                    return(versions.Max());
                }
            }
            return(null);
        }
Esempio n. 3
0
 public static InstallUILevel UiLevel(this Microsoft.Deployment.WindowsInstaller.Session session)
 {
     return((InstallUILevel)int.Parse(session.GetPropertyValue("UILevel")));
 }
Esempio n. 4
0
 public static string GetInstallDirProperty(this Microsoft.Deployment.WindowsInstaller.Session session)
 {
     return(CprBroker.Utilities.Strings.EnsureDirectoryEndSlash(session.GetPropertyValue(PropertyNames.InstallDir)));
 }
Esempio n. 5
0
 public static bool IsOlderVersionDetected(this Microsoft.Deployment.WindowsInstaller.Session session)
 {
     return(!string.IsNullOrEmpty(session.GetPropertyValue(PropertyNames.OlderVersionDetected)));
 }
Esempio n. 6
0
 public static bool IsPatching(this Microsoft.Deployment.WindowsInstaller.Session session)
 {
     return(!string.IsNullOrEmpty(session.GetPropertyValue(PropertyNames.Patch)));
 }