Ejemplo n.º 1
0
        public VisualStudioInstance(ISetupInstance2 FromInstance)
        {
            this.IsLaunchable = FromInstance.IsLaunchable();
            this.IsComplete   = FromInstance.IsComplete();
            this.Name         = FromInstance.GetInstallationName();
            this.Path         = FromInstance.GetInstallationPath();
            this.Version      = FromInstance.GetInstallationVersion();
            this.DisplayName  = FromInstance.GetDisplayName();
            this.Description  = FromInstance.GetDescription();
            this.ResolvePath  = FromInstance.ResolvePath();
            this.EnginePath   = FromInstance.GetEnginePath();
            this.InstanceId   = FromInstance.GetInstanceId();
            this.ProductPath  = FromInstance.GetProductPath();

            try
            {
                var   time     = FromInstance.GetInstallDate();
                ulong high     = (ulong)time.dwHighDateTime;
                uint  low      = (uint)time.dwLowDateTime;
                long  fileTime = (long)((high << 32) + low);

                this.InstallDate = DateTime.FromFileTimeUtc(fileTime);
            }
            catch
            {
                this.InstallDate = DateTime.UtcNow;
            }

            // FromInstance.GetState();
            // FromInstance.GetPackages();
            // FromInstance.GetProduct();
            // FromInstance.GetProperties();
            // FromInstance.GetErrors();
        }