Deploy the .NET program to the machine where the .NET FRAMWORK is installed.

xiaoxiao2021-03-06  38

Making your own installer In VS.NET, we can build your .NET program as a Windows Installer file by building the "Setup and Deployment Projects project) project. For example, we can make it easy to customize the following: 1. Whether to place shortcuts on the desktop. 2. Register your own file type, you can use your own program by double-clicking the file. 3. The process of the registry is in the MSDN site below, we can get an example of making your own installer through Setup and Deployment Projects in vs.net: http://msdn.microsoft.com/library/en-us/vsintro7/ HTML / VBCONDEPLOYMENTSCENARIOS.ASP

-------------------------------------------------- ------------------------------

Publish .NET Framework.NET Framework 1.0 provides an exe file to redeploy .NET: DotNetfx.exe. It contains the incompetence of Common Language Runtime and other .NET programs. We can download the exe file from the following site: http://msdn.microsoft.com/downloads/sample.asp? Url = / msdn-files / 027/001/829 / msdncompositeDoc.xml, we can also in VS The file is found in the .NET installation CD or DVD. We can deploy the .NET Framework to the target machine by running DOTNETFX.EXE: 1. Deploy by Microsoft Systems Management Server. 2. Deploy by Active Directory. 3. Use third-party tools. Specific information, we can see the following article: http://msdn.microsoft.com/library/en-us/dnnetdep/html/redistDeploy.asp

-------------------------------------------------- ------------------------------

Making your own native installer If we have to post your .NET program on the target machine, we don't sure if the target machine has already installed .NET Framework, then we need to design a unmanaged code to determine the target machine. Whether it is installed .NET Framework, if not, run DOTNETFX.EXE to install .NET Framework, then use Windows Installer to install your own program. On the MSDN's next page, we can get an installer that implements unmanaged C and its source code: http://msdn.microsoft.com/downloads/default.asp? Url = / code / sample.asp? URL = / MSDN-Files / 027/001/830 / MSDNCompositeDoc.xml1. In CSETTINGS CLASS, you get your own MSI installation files and DotNetfx.exe path by reading "Settings.ini", and other settings. (Such as .NET Framework language version) getCaptionText (void) getDialogtext (void) getRrorcaptiontext (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 or not to install .NET Framework. FxInstallRequired () on the target machine will detect the version and language settings of the following registry key values ​​and dotnetfx.exe. HKLM / Software / Microsoft / .Netframework / Policy / V1.03. If you need to install .NET Framework, call the following command Silent installation DOTNETFX.EXE: DOTNETFX.EXE / Q: A / C: "Install / L / Q" 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 Native Code above as its own installer, then we can combine your own .NET program and it together with 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 of your .NET program in "MSI" Key; set the path to DotNetfx.exe in "FxInstallerPath" key. For 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. Put "Setup. Exe "," Settings.ini "," DOTNETFX.EXE "and your own MSI installation file, send it to the target machine, then run" setup.exe ", the installer automatically detects whether there is .NET FRAMWORK, if not, The DOTNETFX.EXE will be run first. With the above steps, you can successfully deploy your own .NET program to a machine that is not installed .NET FRAMWORK environment. -------------------------------------------------- ------------------------------

Summary Through the above steps, you can successfully deploy your own .NET program to a machine that is not installed .NET FRAMWORK environment.

转载请注明原文地址:https://www.9cbs.com/read-66353.html

New Post(0)