Determine whether to install the framework + Apsara Virtual Machine Simulation Environment. NET is truly out of the framework

Source: Internet
Author: User
Tags dotnet

Method 1: Use the vmdotnet tool to remove the C # program from the. NET Framework (Unavailable) (X please do not use your. Net Program as the startup program because it also depends on the Framework)

Here is a brief description of the vmdotnet folder. There is a v2.0.50727 folder under this folder, obviously. net framework' executable file (fetionvm.exe icon) is included in this folder. This is the virtual machine file we will use. We do not need to consider its files. This program can bring in a parameter, that is, the path of the program to run in this virtual environment. This is like fetionvm.exe c: \ 1.exe. you can also use the relative path: fetionvm.exe 1.exe. of course, the two must be in the same directory. In this case, the vmdotnet.logfile is used to record the error message when fetionvm.exe is used. It is mainly because the path is incorrect and the corresponding program cannot be found. After learning about this folder, we can start it!

Copy this folder to the DEBUG directory of your project. The name of my existing project is picprocessor, And the executable file generated is. Of course, you can also set it as needed, if you put it somewhere else, you should pay attention to the path.

Here we need to create another C # application project. I name it picstart, delete form1.cs, or create a new console program and write the following code in program. CS:

Using system;
Using system. Collections. Generic;
Using system. Windows. forms;

Namespace picstart
{
Static class Program
{
/// <Summary>
/// Main entry point of the application.
/// </Summary>
[Stathread]
Static void main ()
{
// The following code calls an external program
System. Diagnostics. processstartinfo info = new system. Diagnostics. processstartinfo ();
Info. filename = "vmdotnet \ v2.0.50727 \ fetionvm.exe"; // The external program you want to call
Info. Arguments = "picprocessor.exe"; // call the parameters of an external program. This is the executable file of the image processing project. Note that it is not the executable file of the current project.
System. Diagnostics. Process proc;

Try
{
//
// Start an external program
//
Proc = system. Diagnostics. process. Start (Info );
}
Catch (system. componentmodel. win32exception E)
{
Console. writeline ("the specified program file cannot be found. \ R {0} ", e );
Return;
}
}
}
}

After this project is completed, we will generate this project. At this time, we can start to create the installation file of the program.

In the past, when we used vs2005 to install the installation package, we could choose. net Framework is integrated, but now we don't need it. Please remove all the corresponding options. If you still don't use the vs2005 installation and deployment functions, please visit this website. Http://www.vs2005.com/Setup/205/1/default.aspx

We can add both the picprocessor and picstart project to the setup of the newly created installation and deployment project, and set the shortcut for program startup to picstart.exe, the specific operation methods are shown in the above link. Then, generate the installation package. If the size of the generated installation package is preferred, vmdotnet will occupy about 10 MB of space, and the size of your program will be the size of the Installation File, more than 20 mb. net Framework is much smaller, and the installation speed is much faster. NET framework can also run on machines. Please try it. If you have any questions, please leave me a message. I usually go online every night and will reply to you in time!

Vmdotnet is actually packaging remotesoft. DOTNET. linker

Reprinted from: http://hi.baidu.com/ck436/blog/item/b91b5f8295b7e8a10cf4d256.html

 

Method 2: When I first learned C # four years ago, I always wanted to find a way to run the. Net program on a computer without the framework installed. Although some companies have released. net code is compiled into navtive code to break away from.. NET environment running, such as remotesoft DOTNET linker and xenocode postbuild, but the version has not been cracked. Every time the program compiled with them runs, a copyright information will be added. Recently, it was accidentally discovered that a method can truly remove the program. NET environment running without any copyright information added, will be used, source code, test programs released here: zooranié fó BBS. szblogs. comt yd Summary (generation 7
Zootañié fóbbs. szblogs. COMT ~yd Gao (20177
Program. The loader does not open any window and exits immediately after the real application is started. The code for the main function of the loader program (written in vc6.0) is as follows: *ñié fóbbs. szblogs. COMT ì YD ¯ (¤ 7)
Zootañié fóbbs. szblogs. COMT ~yd Gao (20177
Main Function
Zootañié fóbbs. szblogs. COMT ~yd Gao (20177

Int apientry winmain (hinstance,
Hinstance hprevinstance,
Lpstr lpcmdline,
Int ncmdshow)
...{
Tchar fwversion [version];
If (checkregistrykeyexistance (fwversion ))
...{
If (comparefwversions (fwversion, "2.0") // The Minimum Version requirement is 2.0.
...{
Runapplication (". \ app \ 9527.exe"); // directly run
}
Else
...{
// Put the application program in the appdirectory. The name of the program to be started is 9527.exe,
// 9527 Zhou xingchi's code in Tang bohu's qiuxiang
Runapplication (". \ framework \ vm.exe \". \ app \ 9527.exe \ ""); // runs through a virtual machine
}
}
Else
...{
Runapplication (". \ framework \ vm.exe \". \ app \ 9527.exe \ ""); // runs through a virtual machine

}
Return 0;
}

Zootañié fóbbs. szblogs. COMT ~yd Gao (20177
Zootañié fóbbs. szblogs. COMT ~yd Gao (20177
The installation code will not be pasted out. You can download the entire vc6 project file at the end of the article. Zootañié fóbbs. szblogs. COMT ~yd Gao (20177
Zootañié fóbbs. szblogs. COMT ~yd Gao (20177
The following is a summary of how to use it: î ñ ñié fóbbs. szblogs. COMT ~yd ← (Listen 7
1. Download my example program mongojuñié fóbbs. szblogs. COMT mongoyd regular (mongo7
2. Clear all the files in the app, such as ~añié fó bbs. szblogs. COMT ~yd ← (MMM 7
3. Copy your own .netexecutable program and related files to the append, and change the executable program name to 9527.exe (if you do not like this name, you can modify the loader program to recompile it) ~añié fóbbs. szblogs. COMT ~yd ← (Listen 7
4. Change the name of the main directory's serial tool .exe "to any name you want. (If you want to change the icon, we suggest you download my loader source program and re-compile it after modification.) languañié fóbbs. szblogs. COMT ~yd ← (later 7)
Zootañié fóbbs. szblogs. COMT ~yd Gao (20177
As a result, try it on a computer without. net installed. Good luck.

Related downloads:

Loader source code

Http://files.cnblogs.com/cctvfan90/vmloader.rar

 

In fact, the simplest way is to download the mobile mail-> extract the vmdotnetfolder and fetion.exe to your program running directory-> rename the exename of the program as fetionfx.exe and fetion. the ext name can be changed to your own program, and the database can be placed in... under \ vmdotnet \ v2.0.50727 \, place the referenced DLL in the running directory.

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.