private void ValidateEntryPoint()
 {
     if (this.entryPoint != null)
     {
         if (!string.IsNullOrEmpty(this.entryPoint.TargetPath) && !this.entryPoint.TargetPath.EndsWith(".manifest", StringComparison.OrdinalIgnoreCase))
         {
             base.OutputMessages.AddErrorMessage("GenerateManifest.InvalidEntryPoint", new string[] { this.entryPoint.ToString() });
         }
         string resolvedPath = this.entryPoint.ResolvedPath;
         if (resolvedPath == null)
         {
             resolvedPath = Path.Combine(Path.GetDirectoryName(base.SourcePath), this.entryPoint.TargetPath);
         }
         if (File.Exists(resolvedPath))
         {
             ApplicationManifest manifest = ManifestReader.ReadManifest(resolvedPath, false) as ApplicationManifest;
             if (manifest != null)
             {
                 if (this.Install)
                 {
                     if (manifest.HostInBrowser)
                     {
                         base.OutputMessages.AddErrorMessage("GenerateManifest.HostInBrowserNotOnlineOnly", new string[0]);
                     }
                 }
                 else if ((manifest.FileAssociations != null) && (manifest.FileAssociations.Count > 0))
                 {
                     base.OutputMessages.AddErrorMessage("GenerateManifest.FileAssociationsNotInstalled", new string[0]);
                 }
             }
         }
     }
 }
Exemple #2
0
        private void ValidateEntryPoint()
        {
            if (_entryPoint != null)
            {
                if (!String.IsNullOrEmpty(_entryPoint.TargetPath) && !_entryPoint.TargetPath.EndsWith(".manifest", StringComparison.OrdinalIgnoreCase))
                {
                    OutputMessages.AddErrorMessage("GenerateManifest.InvalidEntryPoint", _entryPoint.ToString());
                }

                string ManifestPath = _entryPoint.ResolvedPath;
                if (ManifestPath == null)
                {
                    ManifestPath = Path.Combine(Path.GetDirectoryName(SourcePath), _entryPoint.TargetPath);
                }
                if (File.Exists(ManifestPath))
                {
                    ApplicationManifest entryPointManifest = ManifestReader.ReadManifest(ManifestPath, false) as ApplicationManifest;
                    if (entryPointManifest != null)
                    {
                        if (Install)
                        {
                            if (entryPointManifest.HostInBrowser)
                            {
                                OutputMessages.AddErrorMessage("GenerateManifest.HostInBrowserNotOnlineOnly");
                            }
                        }
                        else
                        {
                            if (entryPointManifest.FileAssociations != null && entryPointManifest.FileAssociations.Count > 0)
                            {
                                OutputMessages.AddErrorMessage("GenerateManifest.FileAssociationsNotInstalled");
                            }
                        }
                    }
                }
            }
        }