. NET impact on software Installation

Source: Internet
Author: User


. NET impact on software Installation

What is. NET?
...
. How does net change the entire software installation?
. NET changes many of the ways in which we install software. Most obviously, we have a new language C #. Also, the operating system has undergone subtle changes, as well as the way it handles shared code.

About Meta data (Metadata)
First of all, you must understand what is managed code? All of the software based on Microsoft intermediate Language (MSIL) is run with managed codes. Like what. NET launched the new language C # is entirely in managed code run. and other visual Studio. NET, such as Visual C + +, allows mixed use of managed code and none-managed code.
So what are the characteristics of managed Code? The biggest difference between it and none-managed Code is the inclusion of metadata (Metadata). Metadata describes every element in the code, allowing. NET, and allows the code to be self-describing (self-describing). NET runtime uses metadata to provide services such as memory management, Cross-language integration, code security, and object lifecycle Automation. To put it simply, Managed code is one that can be run in a "contractual partnership" with the. NET Runtime.
Metadata can include assemblies, loadable files, types, methods, and so on. The most closely related to the fabrication and installation is the assembly manifest. Assembly is a major component of a program that includes all features, version information, and is published as a whole. Each assembly must include a assembly manifest, and assembly can be self-describing. Manifest include:

A assembly identity, version, etc., expressed in text, if you want to share it with another program, and include a digital signature.
Describe the included files
Specifies the type and resource of the assembly and indicates which of the assembly output.
Enumerate all the dependent assembly.
To indicate the permissions that are required for running
The manifest also includes data that was previously completed by the Self Registration (self-registration). For example, all types of information are stored in manifest, and these manifest data are placed in the. dll or. exe file. By manifest, we can easily know the managed Code dependencies without omitting any information. However, if it is Managed code and none-managed code mixed situation, it is not so easy to do.
Without a new installation technology, developers face a big problem.

Misconceptions about self-installation (self-installing) code
One is that software written using managed code does not need to be installed. Because some of the installed tasks have been completed by metadata, such as the registration of COM components. Just copy all the files from the program to a directory, and you can run it directly. Unfortunately, this is not the whole process of software installation.
Software installation is not simply a copy of the file from location A to location B. Software installer should be to provide users with a friendly, reliable and unified way to install the software on the user's machine. First, the installer requires a unified, familiar user interface that allows users to choose which options to install, and then create folders, shortcuts, upgrades, network installations, license management, and more. In the example above, you can't do all these things for the user, let alone license management.
In addition, Managed code and none-managed code mixed applications cannot be installed themselves. Also, it is more troublesome to install such a program than to install a pure none-managed Code. We can't all of a sudden lose all the previous code, all turned into managed code. Therefore, we have to seriously consider this issue.

Isolated Applications and Side-by-side components
In Windows XP and. NET platforms, Microsoft provides a set of mechanisms to reduce the occurrence of DLL hell. We know that applications are generally dependent on some shared resources, the so-called sharing, that is, if there is already a resource installed on the system, the application will no longer need to install the resource, directly use it. So DLL hell happens, and if an application needs a higher-than-existing version of the shared resource on the system, it replaces the old version with a newer, higher-release resource. It is also possible that the new version of the resource will not be compatible with older versions of the resources. Only one version of the resource exists in the system, so applications that rely on older versions of the resource will crash!

To solve this problem, Microsoft offers two methods: Isolated applications and side-by-side components.
Isolated application is when the application is released with an isolated version of all of the program's components (Isolated versions), which is not affected by other installers. But this requires a complete rewrite of the code, which costs too much.
The Side-by-side component is the one that can be run in an environment where the old and new versions of shared resources coexist. Many of the shared resources in Windows XP are written in a side-by-side way. Developers can achieve side-by-side benefits by using the write application manifest. Application manifest describes the version information of the components that the program relies on, so the operating system can mount the correct shared resources based on that information. For example, the application was developed on the V5 of COMCTL32, and the COMCTL32 version of V5 was indicated in application manifest. Now, even if there is a different version of COMCTL32 on the system, the operating system will still load the V5 version of the resource for the program.

.....



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.