How does VB. NET run on a machine without a. NET Framework?

Source: Internet
Author: User

Make your own installationProgram

In vs. net, we can create a "setup and deployment projects" project to flexibly and conveniently create a. Net program as a Windows installer file. For example, we can easily customize the following options:

1. Whether to place shortcuts on the desktop.

2. register your own file type. You can double-click the file to open it with your own program.

3. Registry Processing

On the following msdn site, we can get an example of creating our own installer through setup and deployment projects in vs. Net:Http://msdn.microsoft.com/library/en-us/vsintro7/html/vbconDeploymentScenarios.asp

Release. NET Framework

. NET Framework 1.0 provides an EXE file for re-deploying. Net: dotnetfx.exe. It contains the common language runtime and other content that is essential for. Net program running.

We can download this EXE file from the following site:Http://msdn.microsoft.com/downloads/sample.asp? Url =/MSDN-FILES/027/001/829/msdncompositedoc. xml

At the same time, we can find this file in vs. net installation CD or DVD.

We can use multiple methods to deploy the. NET Framework to the target machine by running dotnetfx.exe:

1. deployed through Microsoft Systems Management Server.

2. Deploy through active directory.

3. Use third-party tools.

For more information, seeArticle:
Http://msdn.microsoft.com/library/en-us/dnnetdep/html/redistdeploy.asp

Create your own native Installer

If we want to release our. Net program to the target machine, and we are not sure whether the target machine has installed. NET Framework, we need to design a piece of unmanagedCodeTo determine whether the. NET Framework is installed on the target machine. If not, run dotnetfx.exe to install. NET Framework, and then use Windows installer to install your own program.

On the following msdn page, we can get an unmanaged C ++ installation program and itsSource code:
Http://msdn.microsoft.com/downloads/default.asp? Url =/code/sample. asp? Url =/msdn-files/027/001/830/msdncompositedoc. xml

1. In csetaskclass, read "Settings. ini" to download your desired msiinstallation file and the dotnetfx.exe path.
Path and other settings. (For example, the. NET Framework language version)
Getcaptiontext (void)
Getdialogtext (void)
Geterrorcaptiontext (void)
Getininame (void)
Getproductname (void)
The parse () function is used to parse the settings. ini file.

2. In the main. cpp file, the global function fxinstallrequired () determines whether to install. NET Framework. fxinstallrequired()) dodododoand dotnetfx.exe.
HKLM/software/Microsoft/. netframework/policy/V1.0

3. If you need to install the. NET Framework, use the following command to install dotnetfx.exe: dotnetfx.exe/Q: A/C: "Install/L/Q" in strongswan execute (example"

4. Call the following command in the execcmd () global function to install your own MSI file: msiexec/I Reboot = reallysuppress

Usage

If we use the above native code as our own installer, we can combine our. Net program with it through the following steps:

1. Make your own. Net program into a Windows Installer (. MSI) file.

2. Open the "Settings. ini" file, set the MSI file path and file name for your own. Net program in the "Msi" key, and set the dotnetfx.exe path in the "fxinstallerpath" key. For more information about the parameters, see the following article:
Http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/dnnetdep/html/redistdeploy. asp

3. set "setup.exe", "settings. ini "," dotnetfx.exe "and your own MSI installation file are sent to the target machine, and then run" setup.exe ". The installer automatically checks whether there is any. net framwork. If not, run dotnetfx.exe first.

Summary

After completing the preceding steps, you can successfully deploy your. Net program to a machine without the. NET framwork environment.

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.