Example #1
0
        internal static void WriteDeployManifest(InstallContext m_Cnt)
        {
            string       productName   = m_Cnt.Parameters[InstallContextNames.Productname];
            Version      version       = new Version(m_Cnt.Parameters[InstallContextNames.Version]);
            string       allUsers      = m_Cnt.Parameters[InstallContextNames.Allusers];
            AssemblyName _AssemblyName = new AssemblyName(productName)
            {
                Version     = version,
                Flags       = AssemblyNameFlags.None,
                CultureInfo = CultureInfo.InvariantCulture
            };

            //it is public token from cas.snk
            _AssemblyName.SetPublicKeyToken(new byte[] { 0x88, 0x32, 0xff, 0x1a, 0x67, 0xea, 0x61, 0xa3 });
            ManifestManagement.ProductType _type = String.Compare(allUsers, "1") == 0 ? ManifestManagement.ProductType.AllUsers : ManifestManagement.ProductType.SingleUser;
            string publisher              = m_Cnt.Parameters[InstallContextNames.Manufacturer];
            Uri    supportUrl             = new Uri(m_Cnt.Parameters[InstallContextNames.Arphelplink]);
            string _applicationDataFolder = FileNames.ConstructApplicationDataFolder(publisher, productName);

            if (!(new DirectoryInfo(_applicationDataFolder)).Exists)
            {
                throw new InstallException(_applicationDataFolder + " - the directory for application data does not exists");
            }
            m_SetModifyRights(_applicationDataFolder);
            ManifestManagement.WriteDeployManifest(_AssemblyName, _type, publisher, supportUrl, supportUrl, _applicationDataFolder);
        }
Example #2
0
 private static void Initialization()
 {
     //This is called in static creator.
     //It is possible that this might be called before creation of valid manifest,
     //that’s why it is worth to call Initialization again when the DeployManifest is null.
     //see property "DeployManifest"
     mDeployManifest = ManifestManagement.ReadDeployManifest();
     ApplicationData = GetApplicationData();
 }