C # scripting engine Cs-script (iii)--How to deploy

Source: Internet
Author: User

This article not only describes how cs-script is deployed, but also describes the rationale behind the deployment of Cs-script, and describes in detail the various details of the deployment in a block diagram.

I. Access to resources

1. Download the compiled Csscript resources from the official website: cs-script.7z

https://csscriptsource.codeplex.com/releases/view/616234

2. Extract to a directory, pay attention to the selection of a relatively fixed directory, such as a dedicated to store the library file directory;

For example, on my machine will be placed in: E:\OpenSource\cs directory;

II. implementation of the installation

Strictly speaking, Csscript is not required to deploy, in fact, just download the zip package is OK, do not need any deployment, download can be used. The subsequent so-called installation just makes some adjustments to the operating system, so that subsequent scripting can be made more convenient to execute the script.

Installation steps:

1. Locate the decompression directory in the first section and run the Install.cmd in its root directory to complete the installation;

2. By default, Cs-script libraries are using. NET V4.5 (note, not that Setup requires. NET V4.5, but rather that the program is running, especially CSScriptLibrary.dll) if the current computer does not have. NET installed. v4.5, the program will pop up hints, or choose to reduce to V4.0 to use, so internally, is to use lib\bin\net 4.0\csscriptlibrary.dll to replace the CSScriptLibrary.dll in the Lib directory.

Iii. what the Install.cmd adds to the system

1. Add the various environment variables as shown in:

At the same time will%csscript_dir%,%csscript_dir%\lib added to the environment variable, so that you can find Cscs.exe, Csws.exe and other csscript tools;

2. The Cs-script directory was created in Programdata, and some of the resources needed for subsequent secondary debugging were copied, and some of the commands needed for subsequent context menus were copied to the

C:\ProgramData\CS-Script\ShellExt directory, the contents are as follows:

3. A dynamic Right-click menu is registered, and as soon as you right-click on the CS file, the following content is included in the right-click menu:

This menu is actually generated dynamically based on the cmd file in the C:\ProgramData\CS-Script\ShellExt directory.

Iv. what have install.bat done?

Open Install.cmd, inside a sentence:

Start Css_config.exe, so I guess all the configuration of the work is encapsulated in the Css_config.exe source, fortunately this is open source code, in the download source package also includes the Css_config project code, so I followed Css_ Config source down, open Css_config found his code is very simple, mainly to do three things:

1. Check whether the current Windows has Administrator rights and if not, prompt and exit;

2. According to the current system's. NET version, as well as the user's choice, confirm which version of the CSSCriptLibrary.dll is copied to the Lib directory;

3. Call Csws.exe to execute a CS script to perform a deeper configuration with the following code:

stringCSWs = Path.Combine (RootDir,"Csws.exe"); stringConfigscript = Path.Combine (RootDir,@"Lib\config.cs"); Args=New string[2]; args[0] ="/dbg"; args[1] =Configscript; AppDomain.CurrentDomain.ExecuteAssembly (Path.Combine (RootDir,@"Csws.exe"), args);

Follow the Config.cs down the road, found the entire deployment process of logic listening complex, in a variety of cmd, EXE, DLL and CS around around, roughly as shown, if you are interested, you can go into detail to see the specific code.

C # scripting engine Cs-script (iii)--How to deploy

Related Article

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.