VB. NET installation and deployment 1). Create a deployment project
1. Point to "add project" on the "file" menu and select "new project ".
2. In the "Add new project" dialog box, select "Install and deploy Project" in the "project type" pane, and select "Install Project" in the "template" pane ". In the Name box, type setup1.
3. Click OK to close the dialog box.
4. The project is added to Solution Explorer and opened in the file system editor.
5. In the "properties" window, select ProductName properties and type the information management system.
VB. NET installation and deployment 2). Add the output of the main program project to the deployment project
1. In the file system Editor, select Application folder ". On the "operations" menu, point to "add" and select "project output ".
2. In the "add project output group" dialog box, select "your program" from the "project" drop-down list ".
3. Click OK to close the dialog box.
4. Select the "main output" and "Content File" groups from the list, and click "OK ".
VB. NET installation and deployment 3). Create the installer class
1. Point to "new" on the "file" menu and select "project ".
2. In the "new project" dialog box, select "Visual Basic Project" in the "project type" pane and select "class library" in the "template" pane ". In the "name" box, type installDB.
3. Click Open to close the dialog box.
4. Select "Add new project" from the "project" menu ".
5. In the "Add new project" dialog box, select "Installer class ". In the "name" box, type installDB.
6. Click OK to close the dialog box.
7. The detailed code is attached.
VB. NET installation and deployment 4). create custom installation dialog box
1. Select the "setup1" project in Solution Explorer. On the "View" menu, point to "Editor" and select "User Interface ".
2. In the User Interface Editor, select the "Start" node under "installation. On the "operations" menu, select "add dialog box ".
3. In the "add dialog box", select the "License Agreement" dialog box and click "OK" to close the dialog box.
4. In the Add dialog box, select the text box (A) and click OK to close the dialog box.
5. On the "operations" menu, select "Move Up ". Repeat this step until the "text box (A)" dialog box is located on the "Install Folder" node.
6. In the "properties" window, select the BannerText attribute and type: Install database.
7. Select the BodyText attribute and type: the installer will install the database on the target machine.
8. Select the Edit1Label attribute and type: Database Name:
9. Select the Edit1Property property and type CUSTOMTEXTA1
10. Select the Edit1Value attribute and type dbservers.
11. Select the Edit2Label attribute and type: Server Name:
12. Select the Edit2Property property and type CUSTOMTEXTA2
13. Select the Edit2Value attribute and type: (local)
14. Select the Edit3Label attribute and type: User Name:
15. Select the Edit3Value attribute and type: sa
16. Select the Edit3Property property and type CUSTOMTEXTA3
17. Select the Edit4Label attribute and type: password:
18. Select the Edit4Property property and type CUSTOMTEXTA4
19. Select the Edit2Visible, Edit3Visible, and Edit4Visible attributes and set them to true.
VB. NET installation and deployment 5). create custom operations
1. Select the "setup1" project in Solution Explorer. On the "View" menu, point to "Editor" and select "Custom operations ".
2. Select the "Install" node in the Custom operation editor. On the "operations" menu, select "add custom operation ".
3. In the "select project items" dialog box, double-click "application folder ".
4. Select "primary output from installDB (activity)" and click "OK" to close the dialog box.
5. in the "properties" window, select the CustomActionData attribute and type "/dbname = [CUSTOMTEXTA1]/server = [CUSTOMTEXTA2]/user = [CUSTOMTEXTA3]/pwd = [CUSTOMTEXTA4]/targetdir =" [TARGETDIR] "".
Appendix:/targetdir = "[TARGETDIR]" is the target path after installation. To obtain the path after installation in the installDB class, we set this parameter.
VB. NET installation and deployment 6). Add a file
1. back up SQL Server to a file DB. add dat to the "setup1" project (right-click the database in the Enterprise Manager> all jobs> back up the database and back up it into a file named DB. dat)
2. Add the Installation File LisenceFile. rtf to the "setup1" project.
3. In the User Interface Editor, select the license agreement and set the LisenceFile attribute to the LisenceFile. rtf file.
4. Generally, dependencies are automatically added to "detected dependencies". If not, manually add them to Step 5)
Crystal_Managed2003.msm (if there is a crystal Report) dotnetfxredist_x86.msm (. net must be required )... (if any other dll is referenced) 5. if a crystal report is used, manually add the file to be included: Project --> Add --> Merge Module (add your program file) (including dotNetFramework and MDAC27) at: C: under Program FilesCommon FilesMerge Modules, * is required
The specific functions are as follows:
(Managed component MSM processes distribution of all managed components, including Windows form viewer, Web form viewer, and all Crystal Decisions namespaces)
* Crystal_Managed2003.msm
Crystal_Managed2003_chs.msm
(For all other files required for running the report, the database accesses the MSM to process the distribution. These include database, export, and chart drivers .)
* Crystal_Database_access2003.msm
Crystal_Database_access2003_chs.msm
(KeyCode MSM processes the installation of the Crystal Decisions key number. Note that the merging module is added; otherwise, the "MergeMouduleProperties" attribute is not available)
* Crystal_regwiz2003.msm
(If the report file uses the dataset object of ADO. NET, the VC_User_CRT71_RTL_X86 _ ---. msm and VC_User_STL71_RTL_X86 _ ---. msm modules must also be included in the installation project. In addition, the "Module Retargetable Folder" item of the File Installation attribute of the two modules must be changed to the system directory)
VC_User_CRT71_RTL_X86 _ ---. msm VC_User_STL71_RTL_X86 _ ---. msm (many people often encounter query errors. Add this)
6. open solution --> right-click the attribute of Crystal_regwiz2003.msm, and fill in the "License Key" in "MergeMouduleProperties": aap5gks1_gde100ds (this is the registration code used to generate the Crystal Report !)
VB. NET installation and deployment 7). added the uninstall function during packaging:
Method 1:
1. Upload the msiexec.exe file in the package object (generally found in c: windowssystem32)
2. Upload the program file in the file system, press "right" on "msiexec.exe", select "Uninstall" to create a shortcut, and rename the shortcut to "Uninstall ".
3. Change the Arguments of this shortcut to "/x {product id}", and the value of product id is the ProductCode validation value of the packaging destination.
Method 2: (recommended)
1. Complete the installation package, and write down the ProductCode (select the solution Resource Manager root directory such as setup1, and then view the property tag, not the right-click attribute ).
2.use vs.netto create a new console program uninst.exe File
Power by: landlordh for 2000, xp, 2003 Module uninstall Sub Main () Dim myProcess As Process = New Process If System. environment. OSVersion. toString. indexOf ("NT 5") Then myProcess. change Start ("msiexec", "/X {2B65D4A9-C146-4808-AB4B-321FB0779559}") to your own ProductCode End If myProcess. close () End Sub End Module 3.add the exefiles in the binlog of the console program to the package program file, and create the uninst.exe shortcut in the program group.
VB. NET installation and deployment 8). Add the. net environment and MDAC features during packaging:
PluginInstaller of MS. after the msi plug-in is installed, it is automatically packed with the self-contained packaging tool vb.net.. net framework environment, and then set the following steps to package MDAC. use the Setup project to install MDAC
1. Make sure that the Visual Studio. NET Framework Bootstrap plug-in is installed.
2. Select the Setup project in Solution Explorer. From the View menu, point to the Editor and select Launch Conditions ).
3. Select the Requirements on Target Machine node. From the Action menu, select Add Registry Launch Condition (Add Registry search ).
4. Select Search for RegistryEntry1. In the Properties window, select the RegKey attribute and type SoftwareMicrosoftDataAccess.
5. Select the Root attribute and vsdrrHKLM.
6. Select the Value Attribute and type FullInstallVer.
7. Select the Property and type MDACSEARCH.
8. In Launch Conditions Editor (startup condition), add the Condition1 node. Select the Condition1 node, select the Condition attribute in the Properties window, and select MDACSEARCH> = "2.6 ".
9. Select the Setup project in Solution Explorer. On the Project menu, select Properties.
10. Set the Bootstrapper attribute to Windows Installer Bootstrapper (Windows Installer ).