Example #1
0
        protected override void InternalValidate()
        {
            if (!ImportUMPrompt.IsDesktopExperienceRoleInstalled())
            {
                ServerIdParameter serverIdParameter = new ServerIdParameter();
                base.WriteError(new DesktopExperienceRequiredException(serverIdParameter.Fqdn), ErrorCategory.NotInstalled, null);
            }
            base.InternalValidate();
            long num = (this.PromptFileData != null) ? ((long)this.PromptFileData.Length) : this.PromptFileStream.Length;

            if (num > 5242880L)
            {
                this.HandleOversizeAudioData();
            }
            if (this.PromptFileName.Length > 128 || !string.Equals(Path.GetFileName(this.PromptFileName), this.PromptFileName))
            {
                base.WriteError(new InvalidFileNameException(128), ErrorCategory.InvalidArgument, null);
            }
        }
Example #2
0
        private static bool IsDesktopExperienceRoleInstalled()
        {
            string systemDirectory = Environment.SystemDirectory;

            return(!string.IsNullOrEmpty(systemDirectory) && Environment.OSVersion.Version.Major >= 6 && ImportUMPrompt.CheckVersionInfo(Path.Combine(systemDirectory, "wmvcore.dll"), 3802) && ImportUMPrompt.CheckVersionInfo(Path.Combine(systemDirectory, "wmspdmod.dll"), 3804) && ImportUMPrompt.CheckVersionInfo(Path.Combine(systemDirectory, "wmspdmoe.dll"), 3804));
        }