Deploy the. NET program to a machine without. NET Framwork installed.

Source: Internet
Author: User
Content 1. Use VS. NET to create an installer. 2. How to deploy. NET Framework to the target machine. 3. How to use Native code to make. NET Framework and your own installer into a unified installer. If no. NET Framework is installed on the target machine, the. NET Framework is automatically installed and then the author's program is automatically installed. Create your own Installer in VS. NET. You can create a "Setup and Deployment Projects" project to flexibly and conveniently create your. 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 in the following MSDN site, we can get an example of creating your own installer through Setup and Deployment Projects in VS. NET: http://msdn.microsoft.com/library/en-us/vsintro7/html/vbconDeploymentScenarios.asp The release of. NET Framework. NET Framework 1.0 provides an exe file for re-deploying. NET: Dotnetfx.exe. It contains the Common Language Runtime and Other. NET programs. 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 is also available in VS. NET installation CD or DVD. We can use multiple methods to deploy the. NET Framework to the target machine through dotnetfx.exe: 1. Deploy it through Microsoft Systems Management Server. 2. Deploy through Active Directory. 3. Use third-party tools. For more information, see the following article: http://msdn.microsoft.com/library/en-us/dnnetdep/html/redistdeploy.asp Create your own native installer.. Net Program released to the target machine, and we are not sure whether the target machine has been installed. net Framework, then we need to design a piece of unmanaged code to determine whether the target machine is installed.. NET Framework. If not, install dotnetfx.exe.. NET Framework, and then use Windows installer to install your own program. On the following msdn web page, we can get an unmanaged C ++ Implementation of the installer and its source code: http://msdn.microsoft.com/downloads/default.asp? Url =/code/sample. asp? Url =/msdn-files/027/001/830/msdncompositedoc. xml1. in csetaskclass, read "Settings. ini" to download your msiinstallation file, dotnetfx.exe path, and other settings. (For example, the. NET Framework language version) The getcaptiontext (void) getdialogtext (void) geterrorcaptiontext (void) getininame (void) getproductname (void) 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.03. to install the. NET Framework, use the following command to install dotnetfx.exe: dotnetfx.exe/Q: A/C: "Install/L/Q" 4 in zookeeper execute. Run the following command in the execcmd () global function to install your own MSI file: msiexec/I <your MSI file> Reboot = reallysuppress If we use the above native code as our own installer, we can use the following steps to install our own.. Net program and it are combined: 1. put your own. net program to become 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. Specific parameter information, you can get from the following article: http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/dnnetdep/html/redistdeploy. asp3. 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. After completing the preceding steps, you can successfully deploy your. Net program to a machine without the. NET framwork environment. After completing the preceding steps, you can successfully deploy your. Net program to a machine without the. NET framwork environment.

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.