Exemplo n.º 1
0
        /// <remarks>https://docs.microsoft.com/sv-se/visualstudio/deployment/deployment-element-clickonce-deployment</remarks>
        public Manifest(string location, XDocument xml)
        {
            Location = location;
            Xml      = xml;
            assembly = Asmv1.Tools.Deserialize(Xml);
            var ident = assembly.assemblyIdentity;

            Name           = ident.name;
            Version        = new Version(ident.version);
            PublicKeyToken = ident.publicKeyToken;
            Language       = ident.language;
            Architecture   = ident.processorArchitecture;

            var entryp = assembly.entryPoint;

            if (entryp != null)
            {
                entry.Name           = entryp.assemblyIdentity.name;
                entry.Version        = new Version(entryp.assemblyIdentity.version);
                entry.PublicKeyToken = entryp.assemblyIdentity.publicKeyToken;
                entry.Language       = entryp.assemblyIdentity.language;
                entry.Architecture   = entryp.assemblyIdentity.processorArchitecture;
                entry.Executable     = entryp.commandLine.file;
                entry.Parameters     = entryp.commandLine.parameters;
            }
            if (assembly.description != null)
            {
                entry.Icon       = assembly.description.iconFile;
                entry.Publisher  = assembly.description.publisher;
                entry.Product    = assembly.description.product;
                entry.SupportUrl = assembly.description.supportUrl;
            }

            if (assembly.deployment != null)
            {
                Install           = assembly.deployment.install;
                MapFileExtensions = assembly.deployment.mapFileExtensions;
                if (assembly.deployment.minimumRequiredVersion != null)
                {
                    MinimumRequiredVersion = new Version(assembly.deployment.minimumRequiredVersion);
                }

                // if update is defined
                if (assembly.deployment.subscription != null &&
                    assembly.deployment.subscription.update != null)
                {
                    SubscriptionUpdateBeforeApplicationStartup =
                        assembly.deployment.subscription.update.beforeApplicationStartup != null;
                }

                if (assembly.deployment.deploymentProvider != null)
                {
                    DeploymentProviderCodebase = assembly.deployment.deploymentProvider.codebase;
                }
            }
        }
Exemplo n.º 2
0
 /// <remarks/>
 public static void Serialize(TextWriter writer, assembly asm)
 {
     AsmSerialiser.Serialize(writer, asm, Constants.Namespaces);
 }