Ejemplo n.º 1
0
        public NetSparkleConfiguration(String ReferenceAssembly, Boolean UseReflectionBasedAssemblyAccessor)
        {
            // set the value
            this.UseReflectionBasedAssemblyAccessor = UseReflectionBasedAssemblyAccessor;

            // save the referecne assembly
            _referenceAssembly = ReferenceAssembly;

            try
            {
                // set default values
                InitWithDefaultValues();

                // set some value from the binary
                NetSparkleAssemblyAccessor accessor = new NetSparkleAssemblyAccessor(ReferenceAssembly, this.UseReflectionBasedAssemblyAccessor);
                ApplicationName  = accessor.AssemblyProduct;
                InstalledVersion = accessor.AssemblyVersion;

                // build the reg path
                String regPath = BuildRegistryPath();

                // load the values
                LoadValuesFromPath(regPath);
            }
            catch (Exception e)
            {
                // disable update checks when exception was called
                CheckForUpdate = false;

                if (e.Message.Contains("STOP:"))
                {
                    throw e;
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The constructor reads out all configured values
        /// </summary>        
        public NetSparkleConfiguration(String ReferenceAssembly)
        {
            _referenceAssembly = ReferenceAssembly;

            try
            {
                // set some value from the binary
                NetSparkleAssemblyAccessor accessor = new NetSparkleAssemblyAccessor(ReferenceAssembly);
                ApplicationName     = accessor.AssemblyProduct;
                InstalledVersion    = accessor.AssemblyVersion;

                // set default values
                InitWithDefaultValues();

                // build the reg path
                String regPath = BuildRegistryPath();

                // load the values
                LoadValuesFromPath(regPath);
            }
            catch (Exception e)
            {
                // disable update checks when exception was called
                CheckForUpdate = false;

                if (e.Message.Contains("STOP:"))
                    throw e;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This function build a valid registry path in dependecy to the
        /// assembly information
        /// </summary>
        /// <returns></returns>
        private String BuildRegistryPath()
        {
            NetSparkleAssemblyAccessor accessor = new NetSparkleAssemblyAccessor(this.ReferenceAssembly, this.UseReflectionBasedAssemblyAccessor);

            if (string.IsNullOrEmpty(accessor.AssemblyCompany) || string.IsNullOrEmpty(accessor.AssemblyProduct))
            {
                throw new NetSparkleException("STOP: Sparkle is missing the company or productname tag in " + ReferenceAssembly);
            }

            return("Software\\" + accessor.AssemblyCompany + "\\" + accessor.AssemblyProduct + "\\AutoUpdate");
        }
Ejemplo n.º 4
0
        /// <summary>
        /// This function build a valid registry path in dependecy to the
        /// assembly information
        /// </summary>
        /// <returns></returns>
        private String BuildRegistryPath()
        {
            NetSparkleAssemblyAccessor accessor = new NetSparkleAssemblyAccessor(_referenceAssembly, UseReflectionBasedAssemblyAccessor);

            if (accessor.AssemblyCompany == null || accessor.AssemblyCompany.Length == 0 ||
                accessor.AssemblyProduct == null || accessor.AssemblyProduct.Length == 0)
            {
                throw new Exception("STOP: Sparkle is missing the company or productname tag in " + _referenceAssembly);
            }

            return("Software\\" + accessor.AssemblyCompany + "\\" + accessor.AssemblyProduct + "\\AutoUpdate");
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="referenceAssembly">the name of hte reference assembly</param>
        /// <param name="isReflectionBasedAssemblyAccessorUsed"><c>true</c> if reflection is used to access the assembly.</param>
        protected NetSparkleConfiguration(string referenceAssembly, bool isReflectionBasedAssemblyAccessorUsed)
        {
            // set the value
            this.UseReflectionBasedAssemblyAccessor = isReflectionBasedAssemblyAccessorUsed;

            // save the referecne assembly
            this.ReferenceAssembly = referenceAssembly;

            // set default values
            InitWithDefaultValues();

            try
            {
                // set some value from the binary
                NetSparkleAssemblyAccessor accessor = new NetSparkleAssemblyAccessor(referenceAssembly, this.UseReflectionBasedAssemblyAccessor);
                ApplicationName  = accessor.AssemblyProduct;
                InstalledVersion = accessor.AssemblyVersion;
            }
            catch
            {
                this.CheckForUpdate = false;
                throw;
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="referenceAssembly">the name of hte reference assembly</param>
        /// <param name="isReflectionBasedAssemblyAccessorUsed"><c>true</c> if reflection is used to access the assembly.</param>
        protected NetSparkleConfiguration(string referenceAssembly, bool isReflectionBasedAssemblyAccessorUsed)
        {
            // set the value
            this.UseReflectionBasedAssemblyAccessor = isReflectionBasedAssemblyAccessorUsed;

            // save the referecne assembly
            this.ReferenceAssembly = referenceAssembly;

            // set default values
            InitWithDefaultValues();

            try
            {
                // set some value from the binary
                NetSparkleAssemblyAccessor accessor = new NetSparkleAssemblyAccessor(referenceAssembly, this.UseReflectionBasedAssemblyAccessor);
                ApplicationName = accessor.AssemblyProduct;
                InstalledVersion = accessor.AssemblyVersion;
            }
            catch
            {
                this.CheckForUpdate = false;
                throw;
            }
        }
        /// <summary>
        /// This function build a valid registry path in dependecy to the 
        /// assembly information
        /// </summary>
        /// <returns></returns>
        private String BuildRegistryPath()
        {
            NetSparkleAssemblyAccessor accessor = new NetSparkleAssemblyAccessor(this.ReferenceAssembly, this.UseReflectionBasedAssemblyAccessor);

            if (string.IsNullOrEmpty(accessor.AssemblyCompany) || string.IsNullOrEmpty(accessor.AssemblyProduct))
                throw new NetSparkleException("STOP: Sparkle is missing the company or productname tag in " + ReferenceAssembly);

            return "Software\\" + accessor.AssemblyCompany + "\\" + accessor.AssemblyProduct + "\\AutoUpdate";
        }
Ejemplo n.º 8
0
        /// <summary>
        /// This function build a valid registry path in dependecy to the 
        /// assembly information
        /// </summary>
        /// <returns></returns>
        private String BuildRegistryPath()
        {
            NetSparkleAssemblyAccessor accessor = new NetSparkleAssemblyAccessor(_referenceAssembly);

            if (accessor.AssemblyCompany == null || accessor.AssemblyCompany.Length == 0 ||
                    accessor.AssemblyProduct == null || accessor.AssemblyProduct.Length == 0)
                throw new Exception("STOP: Sparkle is missing the company or productname tag");

            return "Software\\" + accessor.AssemblyCompany + "\\" + accessor.AssemblyProduct + "\\AutoUpdate";
        }