This document describes how to useInstallShieldInstall and uninstall the database, andInstallShield 11.5 premier EditionAndInstallShield 12 premier EditionEnvironment. (AboutInstallShieldSuch a well-known InstallationProgramI will not introduce the production tools much.)
(InInstallShieldPackage in. NET FrameworkSee about Using InstallShield to deploy. NET Framework) Zhang Lei. Live
1. Open "SQL scripts View", 1
Figure 1. Open the SQL Script View
2
, Create a connection, assuming"Masterconnection", According to the figure2And Graph3Set the connection attributes.
Figure 2 establish a connection
Figure 3 set connection attributes
3In theMasterconnection", CreateScript, Attribute settings4,ScriptThe content is as follows:
1 Use Master
2
3 If Not Exists ( Select *
4
5 From Master. DBO. sysdatabases
6
7 Where Name = ' Relaybookkeeping ' )
8
9 Create Database ' Relaybookkeeping '
10
11 Go
12
Note:RelaybookkeepingIs the database we need to create.
Figure 4CreateScript
4, New Connection"Relaybookkeepingconnection", According to the figure5SetGeneralAttribute.RequirementsAttribute settings3.
Figure 5 set connection attributes
5In theRelaybookkeepingconnectionCreate your own database script.6.
Figure 6 add your own database script
6, Delete the database when you uninstall the program.
Procedure1,2,3. Create a connection,GeneralOn the properties page, set the database nameMaster. Then addScriptFile,RuntimeWhen the property is set to uninstall, the content is:
Use Master
Drop DatabaseRelaybookkeeping
Go
[Edit the following content at]
I saw in my help today that I installed SQL Server and Oracle. Post at the end.
Creating a sample project that will create a SQL Server catalog by running customized SQL script
Task
The following describes how to create a sample project that will create a SQL Server catalog on the target machine by running customized SQL script:
- Create a new InstallShield project.
-
- Go toProperty ManagerView.
-
- Create a new property named "is_sqlserver_database2 ".
-
- Go toSQL scriptsView.
-
- Create a new connection and call it "newconnection1 ".
-
- Click newconnection1 In the explorer, and select the General tab.
-
- Specify "testsqlserver" as the target server name, and clearCreate catalog if absentOption.
-
- SelectServer AuthenticationOption and specify "sa" asLogin IDAnd leavePasswordField blank.
-
- ClickRequirementsTab.
- Select the SQL Server check box and clear the Oracle and MySQL check boxes as the target databases.
-
- Right-clickNewconnection1In the explorer, and chooseNew script.
-
- Rename the new script "newscript1 ".
-
- SelectNewscript1In the explorer, and clickScriptTab.
-
- Add the following script:
Create Database [testdb] On (name = n' testdb', filename = n' c: \ Program Files \ Microsoft SQL Server \ MSSQL \ data \ testdb. MDF ', size = 3, filegrowth = 10%) log on (name = n' testdb_log', filename = n' C: \ Program Files \ Microsoft SQL Server \ MSSQL \ data \ testdb. ldf', size = 1, filegrowth = 10%)
Collate SQL _latin1_general_cp1_ci_as
-
- ClickRuntimeTab, selectRun script during login, And then clear the other script execution options.
-
- Create a new connection inSQL scriptsView, and call it "newconnection2 ".
-
- ClickNewconnection2In the explorer, and selectAdvancedTab.
-
- FromTarget catalog property nameBox, choose is_sqlserver_database2.
-
- ClickGeneralTab.
-
- Specify "testsqlserver" as the target server name and "testdb" as the catalog name, and then clearCreate catalog if absentOption.
- SelectServer AuthenticationOption and specify "sa" asLogin IDAnd leavePasswordField blank.
-
- ClickRequirementsTab.
-
- SelectSQL ServerCheck box and clearOracleAndMySQLCheck boxes as the target databases.
-
- Right-clickNewconnection2In the explorer, and chooseNew script.
-
- Rename the new script "newscript2 ".
-
- SelectNewscript2In the explorer, and clickScriptTab.
-
- Add the following script:
Create Table testtable (testcolumn1 char not null primary key)
-
- Click the runtime tab, select run script during install, and then clear the other script execution options.
Creating a sample project that will create an oracle catalog by running customized SQL script
Task
The following describes how to create a sample project that will create an oracle catalog on the target machine by running customized SQL script:
-
- Create a new InstallShield project.
-
- Go toProperty ManagerView.
-
- Create a new property named "is_sqlserver_database2 ".
-
- Go toSQL scriptsView.
- Create a new connection and call it "newconnection1 ".
-
- ClickNewconnection1In the explorer, and selectGeneralTab.
-
- Specify "// sch01jsmith.macrvision.com: 1521/orcl" as the target server name, and clearCreate catalog if absentOption.
-
- SelectServer AuthenticationOption and specify "Scott" as the login ID and "Scott" as the password.
-
- ClickRequirementsTab.
-
- SelectOracleCheck box and clearSQL ServerAndMySQLCheck boxes as the target databases.
- Right-clickNewconnection1In the explorer, and chooseNew script.
-
- Rename the new script "newscript1 ".
-
- SelectNewscript1In the explorer, and clickScriptTab.
-
- Add the following script:
Create tablespace test_ts logging datafile '/muddle/Oracle/STs/test01.dbf' size 64 K autoextend on next 2 m maxsize Unlimited
Go
Create user test_user identified by mypswd default tablespace test_ts quota unlimited on test_ts
Go
Grant connect to test_user
Go
Grant DBA to test_user
Go
Alter user test_user default role all
Go
-
- ClickRuntimeTab, selectRun script during login, And then clear the other script execution options.
-
- Create a new connection inSQL scriptsView, and call it "newconnection2 ".
-
- ClickNewconnection2In the explorer, and selectAdvancedTab.
-
- FromTarget catalog property nameBox, choose is_sqlserver_database2.
- ClickGeneralTab.
-
- Specify "// sch01jsmith.mac rvision.com: 1521/orcl" as the target server name and "test_user" as the catalog name, and then clearCreate catalog if absent Option.
-
- SelectServer AuthenticationOption and specify "test_user" as the login ID and "mypswd" as the password.
-
- ClickRequirementsTab.
-
- SelectOracleCheck box and clearSQL ServerAndMySQLCheck boxes as the target databases.
-
- Right-clickNewconnection2In the explorer, and chooseNew script.
- Rename the new script "newscript2 ".
-
- Select newscript2 In the explorer, and click the script tab.
-
- Add the following script:
Create Table testtable (testcolumn1 char not null primary key)
-
- ClickRuntimeTab, selectRun script during install, And then clear the other script execution options.
-->
-->
-->
-->