Exemple #1
0
 internal static void InstallLicense(string user, string company, string email, bool loadLicenseFromDefaultContainer, string alternativeProductName, string licenseUnlockCode, Assembly assembly)
 {
     if (assembly == null)
     {
         throw new ArgumentNullException(nameof(assembly), $"Entring {nameof(InstallLicense)} with null argument.");
     }
     LicenseTraceSource.TraceVerbose(39, $"Entering InstallLicense {user}, {company}, {email}");
     ManifestManagement.WriteDeployManifest(assembly, alternativeProductName);
     LicenseFile.Install(user, company, email, FileNames.LicenseFilePath, loadLicenseFromDefaultContainer, licenseUnlockCode);
 }
Exemple #2
0
        /// <summary>
        /// It completes the install transaction.
        /// </summary>
        /// <param name="savedState">An <see cref="T:System.Collections.IDictionary"/> that contains the state
        /// of the computer after all the installers in the collection have run.
        /// </param>
        /// <exception cref="T:System.ArgumentException">
        /// The <paramref name="savedState"/> parameter is null.
        /// -or-
        /// The saved-state <see cref="T:System.Collections.IDictionary"/> might have been corrupted.
        /// </exception>
        /// <exception cref="T:System.Configuration.Install.InstallException">
        /// An exception occurred during the <see cref="M:System.Configuration.Install.Installer.Commit(System.Collections.IDictionary)"/> phase
        /// of the installation. This exception is ignored and the installation continues.
        /// However, the application might not function correctly after the installation is complete.
        /// </exception>
        public override void Commit(IDictionary savedState)
        {
            base.Commit(savedState);
            InstallContext _Context = this.Context;

            try
            {
                ManifestManagement.WriteDeployManifest(_Context);
                LicenseFile.Install(_Context.Parameters[InstallContextNames.User], _Context.Parameters[InstallContextNames.Company], _Context.Parameters[InstallContextNames.Email], FileNames.LicenseFilePath, true, null);
            }
            catch (Exception ex)
            {
                throw new InstallException("Installation Error", ex);
            }
        }
Exemple #3
0
 /// <summary>
 /// Installs the license fro the <see cref="Stream"/>.
 /// </summary>
 /// <param name="license">The license available as the <see cref="Stream"/>.</param>
 public static void InstallLicense(Stream license)
 {
     LicenseFile.Install(license);
 }