table of Contents
This article makes your own installer release .NET Framework makes its own Native installer usage method summary
-------------------------------------------------- ------------------------------
Herein
1. Use vs.net to create an installer.
2. How to deploy .NET Framework to the target machine.
3. How to use Native Codes to make .NET Framework and your own installer as a unified installer. This program does not install .NET Framework automatically if you don't have .NET Framework on the target machine, then automatically install the author's own procedure.
-------------------------------------------------- ------------------------------
Make your own installer
In VS.NET, we can build our .NET program as a Windows Installer file by building a "Setup and Deployment Projects project) project, very flexible. 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. Registry processing
In the following MSDN site, 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/vbcondeploymentsscenarios.asp
-------------------------------------------------- ------------------------------
Publish .NET Framework
.NET Framework 1.0 provides an exe file to redeploy .NET: DotNetfx.exe. It contains the incomplete content 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/msdncompositeoc.xml
At the same time, we can also find the file in the VS.NET installation CD or DVD.
We can deploy .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.
For specific information, we can see the following article:
Http://msdn.microsoft.com/library/en-us/dnnetdep/html/redistdeploy.asp
-------------------------------------------------- ------------------------------
Make your own Native installer
If we want to post your .NET program on the target machine, we are not sure if the target machine has already installed .NET Framework, then we need to design a unmanaged code to determine if the target machine 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 uses UNMANAGED C and its source code:
Http://msdn.microsoft.com/downloads/default.asp?url=/code/sample.asp?url=/msdn-files/027/001/830/msdncompositeDoc.xml
1. In CSETTINGS CLASS, you get your own MSI installation files and DotNetfx.exe path by reading "Settings.ini", and other settings. (Such as the language version of .NET Framework)
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 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.0
3. If you need to install .NET Framework, call the following command Silent installation DotNetfx.exe in the global function execcmd ():
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
-------------------------------------------------- ------------------------------
Instructions
If we use the Native code above as its own installer, we can combine your own .NET program with it by 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.asp
3. Install "Setup.exe", "Settings.ini", "DOTNETFX.EXE" and your own MSI installation files, send "setup.exe" and run "setup.exe", and the installer automatically detects if 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.
-------------------------------------------------- ------------------------------
to sum up
With the above steps, you can successfully deploy your own .NET program to a machine that is not installed .NET FRAMWORK environment.
Below is the development guide on 9CBS
Combined with the application uses the setup.exe installation boot program example
The operation performed by the SETUP.EXE installation boot program is automatically. However, to make Setup.exe you can use applications, you must create a custom settings.ini file that provides the application-related necessary information. In addition, it is recommended that your deployment has a readme file, providing users with minimum formulation requirements for installation applications and DotNetfx.exe via this file. The following topics provide details on creating settings.ini and readme files.
Create a settings.ini file
Setup.exe Installation Boot Program example uses external files settings.ini to determine the following:
· DOTNETFX.EXE and the location of the host application.
· To check the language version of the .NET Framework.
• To use the custom string of the Setup.exe dialog.
The default location of Settings.ini is in the same folder with setup.exe. You are responsible for creating a settings.ini file, which makes the setup.exe installation boot program example can be used with your application. You can copy the settings.ini file provided with the setup.exe installation boot program sample, then edit the file as needed to specify the correct value for the application.
Specify the location of DotNetfx.exe and host applications
Setup.exe Installation Booter Example Requirements DOTNETFX.EXE and host .NET Framework applications are located relative to Setup.exe. Setup.exe Installation Booter examples use external files settings.ini to determine the location of DotNetfx.exe and host applications. You can copy the Settings.ini files provided with the example and then edit the file to point to the location of the .NET Framework host application and DotNetfx.exe.
The following settings.ini file example illustrates how to point to a host .NET Framework application, a host .NET Framework application, and DotNetFx.exe's Windows installation package (.msi file).
The following example settings.ini file points to the Windows installation package of the .NET Framework application MySetup.msi and DotNetfx.exe with setup.exe on the same folder. Single quotes "'" for comment unmatched rows.
[Bootstrap]
MSI = MySetup.msi
'LanguageDirectory =
ProductName = My Application
'DialogText =
CAPTIONTEXT = My ApplicationErrorCaptionText = My Application Error
FxinstallerPath = C: / MyProjectFolder /
The following example settings.ini file points to the Windows installation package of .NET Framework application MySetup.msi and DotNetfx.exe, located in network sharing, in the same location.
[Bootstrap]
MSI = // mynetworkshare / myprojectfolder / mysetup.msi
'LanguageDirectory =
ProductName = My Application
'DialogText =
CAPTIONTEXT = My Application
ErrorCaptionText = My Application Error
FxinstallerPath = // mynetworkshare / myProjectFolder /
The following example settings.ini file points to the Windows installation package of the .NET Framework application MySetup.msi and DotNetfx.exe with setup.exe on the same computer but different folders.
[Bootstrap]
MSI = C: /myinstallerfiles/mysetup.msi
'LanguageDirectory =
ProductName = My Application
'DialogText =
CAPTIONTEXT = My Application
ErrorCaptionText = My Application Error
FxinstallerPath = C: / MyExecutables /
The following example settings.ini file points to the WINDOWS installation package of the DotNetfx.exe with the setup.exe's different folders on the same CD.
[Bootstrap]
MSI = MyInstallerfiles / MySetup.msi
'LanguageDirectory =
ProductName = My Application
'DialogText =
CAPTIONTEXT = My Application
ErrorCaptionText = My Application Error
FxinstallerPath = MyExecutables /
Specified language version
If you want setup.exe to check the internal version number and language version of the .NET Framework, you must specify the area name of the language in the settings.ini file. If no regional name is specified, by default setup.exe will check if there is an English language version.
The following table lists the available language versions and the corresponding regional names to be specified in the settings.ini file. Regional names are not case sensitive.
Language Regional Name Chinese (Simplified) CHS Chinese (Traditional) CHT French Fr German De Italian IT Japanese Ja Korean Ko Spanish ES
The following example settings.ini file indicates that setup.exe checks the French version of DotNetfx.exe.
[Bootstrap]
MSI = MySetup.msi
LanguageDirectory = fr
ProductName = My Application
'DialogText =
CAPTIONTEXT = My ApplicationErrorCaptionText = My Application Error
FxinstallerPath = C: / MyProjectFolder /
Customize strings for setup.exe dialogs
You can edit the following variables in the Settings.ini file to customize the strings displayed in the Setup.exe dialog.
ProductName
Specifies the name of the .NET Framework application that setup.exe will be installed. The product name you specified is used to customize the text in the dialog box displayed after starting setup.exe. For example, if you specify the productName as "My Application", the dialog box text is "To start the 'my application installer', click 'OK'. To exit without installing, please click" cancel'".
If you do not have a custom CAPTIONTEXT variable, ProductName is also used to customize the title bar of the dialog shown after SETUP.EXE startup. For example, if you specify ProductName as "My App,", the title bar displays "My Application Installer". If you customize ProductName and CAPTIONTEXT, CAPTIONTEXT is used to customize the title bar text in this dialog.
ProductName is also used to customize the title bar text in the successful dialog box that completes the installation application. If you don't have a custom productName, the Default Text Application Installer is displayed.
Dialogtext
Specifies the custom text displayed in the dialog that is displayed after Setup.exe. If you don't have custom Dialogtext, display the default text "To start the 'application installer', click 'OK'. To exit without installing, click 'Cancel'.
CaptionText
Specifies the custom text displayed in the title bar that is going to start after setup.exe startup. If you don't have a custom CAPTIONTEXT, you will display productName. If there is no custom productName, the default text "Application Installer" is displayed.
ErrorCaptionText
Specifies the custom text to be displayed in the title bar of the setup.exe error dialog. If you don't have a custom errorCAPTIONTEXT, the default text "Application Installer Error" is displayed.
Create a readme file for the installer
It is recommended that your distribution has a readme file that lists the minimum configuration requirements for computers that can be successfully run successfully. Depending on the requirements before installation, at least Microsoft Windows 98 or higher containing Internet Explorer 5.01 or higher is listed. MDAC 2.6 or higher should also be listed and indicate that it is not required for installation, but is required to provide a .NET Framework application for data access. Details of minimum configuration requirements for installing DOTNETFX.EXE,