/// <summary>
        /// This function build a valid registry path in dependecy to the
        /// assembly information
        /// </summary>
        /// <returns></returns>
        private String BuildRegistryPath()
        {
            KryptonSparkleAssemblyAccessor accessor = new KryptonSparkleAssemblyAccessor(this.ReferenceAssembly, this.UseReflectionBasedAssemblyAccessor);

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

            return("Software\\" + accessor.AssemblyCompany + "\\" + accessor.AssemblyProduct + "\\AutoUpdate");
        }
Esempio n. 2
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 KryptonSparkleConfiguration(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
                KryptonSparkleAssemblyAccessor accessor = new KryptonSparkleAssemblyAccessor(referenceAssembly, this.UseReflectionBasedAssemblyAccessor);
                ApplicationName  = accessor.AssemblyProduct;
                InstalledVersion = accessor.AssemblyVersion;
            }
            catch
            {
                this.CheckForUpdate = false;
                throw;
            }
        }