- Versioning rules cannot be expressed between pieces of an application and enforced by the operating system. The current approach relies on backward compatibility, which is often difficult to guarantee.
- There is no way to maintain consistency between sets of components that are built together and the set that is present at run time.
- Isolation(Refer my Previous Post to get detail about isolation concept at my blog)
- Windows 2000 locks files that are shipped with the operating system in the System32 directory so they cannot be inadvertently replaced when applications are installed.
- Provide the infrastructure to allow multiple versions of a component to be run simultaneously (called side-by-side execution).
- Provide the infrastructure to enforce versioning rules
- Enable developers to specify version rules between different software components.
- An Assembly is a partially compiled code library for use in deployment, versioning and security. An Assembly can consist of one or more code files.
- It contains code that the common language runtime executes. Microsoft intermediate language (MSIL) code in a portable executable (PE) file will not be executed if it does not have an associated assembly manifest.
There are two types of Assemblies:
- Process assemblies (EXE)
- Library assemblies (DLL)
- The Short Name
- The culture
- The version
- A public key token
- Assemblies are designed to simplify application deployment and to solve versioning problems that can occur with component-based applications.
- Assembly simplify uninstalling and replicating
- Assembly supports side-by-side execution
- Each computer on which the common language runtime is installed has a machine-wide code cache called the 'Global Assembly Cache'. The global assembly cache (or GAC as it is commonly known) stores assemblies specifically designated to be shared by several applications on the computer. The global assembly cache is located in 'Windows/WinNT' directory and inherits the directory's access control list that administrators have used to protect the folder.
- Assemblies placed in the GAC must have the same assembly name as file name (not including the file name extension). For example, an assembly with the assembly name of 'myAssembly' must have a file name of either 'myAssembly.exe' or 'myAssembly.dll'.
- File Security
- Shared Loaction
- Side-by-Side Versioning
- As an Additional Search Location
How to Install Assemblies in GAC?
- Through Custom Action "Execute Program from Installed Files"(I will cover this approach here in my blog)
- Through Custom action "Call VBScript from Installation"
/i "[INSTALLDIR]Bw\SAP.Connector.dll" /silent, This will silently install the assembly ‘SAP.Connector’ for the file ‘SAP.Connector.dll’
/u SAP.Connector /silent, This will silently uninstall the assembly ‘SAP.Connector’ for the file ‘SAP.Connector.dll’
Note: Most of the tools will populate the Assembly tables in the MSI for you, the utilities such as gacutil.exe and custom action usage are for understanding.