当前位置: 首页 > news >正文

[转帖] 使用 InstallShield 安装和卸载SQL Server 数据库

很不想转,因为既然可以google到,转帖纯粹是多此一举的事情,自己要看,可以保存网页或者添加到收藏夹里。但是真的很失望于许多人只会在群里拼命地抛问题,但是却学不会自己去google一下。甚至告诉了他们在哪里可以找到,还会跑来问详细的用法。自己去试验一下真的就那么难么?

甚至现在,连现成的答案都不想看了,要求我录教学视频,要求我远程协助,唉~

 

原帖地址:

http://www.cnblogs.com/zhangleixp/archive/2006/11/11/installshielddatabase.html

 

本文主要介绍使用Installshield 进行数据库的安装和卸载,并在InstallShield 11.5 Premier Edition 和Installshield 12 Premier Edition 环境中测试通过。(关于InstallShield 这样一个大名鼎鼎的安装程序制作工具我就不多介绍了。)

(在 Installshield 中打包 .NET Framework 参见:《关于使用 Installshield 部署 .NET Framework》)张磊.LIVE

1、打开“SQL Scripts view”,如图1


图1.  打开SQL Script View 视图

2、建立一个连接,假定为“MasterConnection”,按照图2和图3设置该连接的属性。


图2 建立连接

图3 设置连接的属性

3、在“MasterConnection”下,新建一个Script,属性的设置如图4,script 的内容如下:

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

注:RelayBookkeeping是我们需要创建的数据库。


图4 新建一个Script

4、新建连接“RelayBookkeepingConnection”,按照图5设置General属性。Requirements属性的设置参照图3的一样。


图5 设置连接的属性

5、在“RelayBookkeepingConnection”下,新建你自己的数据库脚本。如图6。


图6 添加自己的数据库脚本

6、卸载程序时删除数据库。

操作方法和和新建数据库(步骤1,2,3)类似。建立一个连接,General 属性页中,设置数据库名为Master。然后添加一个Script文件,Runtime属性设置为卸载时,内容为:

USE Master 
DROP DATABASE RelayBookkeeping
GO



[以下内容编辑于2006-11-13 17:00]
今天在帮助里看到的,一篇是安装SQL Server的,一篇是ORACLE的。帖在到后面。

Creating a Sample Project that Will Create a SQL Server Catalog by Running Customized SQL Script

Task

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:

  1. Create a new InstallShield project.
  2. Go to the Property Manager view.
  3. Create a new property named "IS_SQLSERVER_DATABASE2".
  4. Go to the SQL Scripts view.
  5. Create a new connection and call it "NewConnection1".
  6. Click NewConnection1 in the explorer, and select the General tab.
  7. Specify "TESTSQLSERVER" as the Target Server Name, and clear the Create Catalog If Absent option.
  8. Select the Server Authentication option and specify "sa" as the Login ID and leave the Password field blank.
  9. Click the Requirements tab.
  10. Select the SQL Server check box and clear the Oracle and MySQL check boxes as the target databases.
  11. Right-click NewConnection1 in the explorer, and choose New Script.
  12. Rename the new script "NewScript1".
  13. Select NewScript1 in the explorer, and click the Script tab.
  14. 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
        
  15. Click the Runtime tab, select Run Script During Login, and then clear the other script execution options.
  16. Create a new connection in the SQL Scripts view, and call it "NewConnection2".
  17. Click NewConnection2 in the explorer, and select the Advanced tab.
  18. From the Target Catalog Property Name box, choose IS_SQLSERVER_DATABASE2.
  19. Click the General tab.
  20. Specify "TESTSQLSERVER" as the Target Server Name and "TestDB" as the Catalog Name, and then clear the Create Catalog If Absent option.
  21. Select the Server Authentication option and specify "sa" as the Login ID and leave the Password field blank.
  22. Click the Requirements tab.
  23. Select the SQL Server check box and clear the Oracle and MySQL check boxes as the target databases.
  24. Right-click NewConnection2 in the explorer, and choose New Script.
  25. Rename the new script "NewScript2".
  26. Select NewScript2 in the explorer, and click the Script tab.
  27. Add the following script:
    CREATE TABLE TestTable (TestColumn1 CHAR NOT NULL PRIMARY KEY)
        
  28. 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

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:

  1. Create a new InstallShield project.
  2. Go to the Property Manager view.
  3. Create a new property named "IS_SQLSERVER_DATABASE2".
  4. Go to the SQL Scripts view.
  5. Create a new connection and call it "NewConnection1".
  6. Click NewConnection1 in the explorer, and select the General tab.
  7. Specify "//sch01jsmith.macrvision.com:1521/orcl" as the Target Server Name, and clear the Create Catalog If Absent option.
  8. Select the Server Authentication option and specify "Scott" as the login ID and "Scott" as the password.
  9. Click the Requirements tab.
  10. Select the Oracle check box and clear the SQL Server and MySQL check boxes as the target databases.
  11. Right-click NewConnection1 in the explorer, and choose New Script.
  12. Rename the new script "NewScript1".
  13. Select NewScript1 in the explorer, and click the Script tab.
  14. Add the following script:
    CREATE TABLESPACE TEST_TS LOGGING DATAFILE ' /muddle/oracle/sts/
        test01.dbf ' SIZE 64K AUTOEXTEND ON NEXT 2M 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
        
  15. Click the Runtime tab, select Run Script During Login, and then clear the other script execution options.
  16. Create a new connection in the SQL Scripts view, and call it "NewConnection2".
  17. Click NewConnection2 in the explorer, and select the Advanced tab.
  18. From the Target Catalog Property Name box, choose IS_SQLSERVER_DATABASE2.
  19. Click the General tab.
  20. Specify "//sch01jsmith.macrvision.com:1521/orcl" as the Target Server Name and "TEST_USER" as the Catalog Name, and then clear the Create Catalog If Absent option.
  21. Select the Server Authentication option and specify "TEST_USER" as the Login ID and "MYPSWD" as the password.
  22. Click the Requirements tab.
  23. Select the Oracle check box and clear the SQL Server and MySQL check boxes as the target databases.
  24. Right-click NewConnection2 in the explorer, and choose New Script.
  25. Rename the new script "NewScript2".
  26. Select NewScript2 in the explorer, and click the Script tab.
  27. Add the following script:
    CREATE TABLE TestTable (TestColumn1 CHAR NOT NULL PRIMARY KEY)
        
  28. Click the Runtime tab, select Run Script During Install, and then clear the other script execution options.

转载于:https://www.cnblogs.com/Cindy_weiwei/archive/2010/06/07/1753347.html

相关文章:

  • Spring Cloud微服务如何设计异常处理机制?
  • SpringCloud 之 Bus消息总线
  • 26步打造高访问量网站[经典]
  • Silverlight 4中把DataGrid数据导出Excel—附源码下载
  • 类加载、反射
  • Ubuntu 中的编程语言(上)
  • 17.Merge Two Binary Trees(合并两个二叉树)
  • 03与08组策略区别
  • [Pytorch] pytorch笔记 三
  • 五子棋游戏
  • TMG 2010 部署与入门配置
  • 搭建自己的code-push-server服务器
  • Hyper-V 配置网络 (高级篇)
  • HTTP劫持和DNS劫持
  • 关于语言的争论
  • 【编码】-360实习笔试编程题(二)-2016.03.29
  • Akka系列(七):Actor持久化之Akka persistence
  • Centos6.8 使用rpm安装mysql5.7
  • extjs4学习之配置
  • hadoop入门学习教程--DKHadoop完整安装步骤
  • Java|序列化异常StreamCorruptedException的解决方法
  • mockjs让前端开发独立于后端
  • Python爬虫--- 1.3 BS4库的解析器
  • SAP云平台里Global Account和Sub Account的关系
  • Spring思维导图,让Spring不再难懂(mvc篇)
  • Theano - 导数
  • UEditor初始化失败(实例已存在,但视图未渲染出来,单页化)
  • vuex 笔记整理
  • 前端面试总结(at, md)
  • 如何编写一个可升级的智能合约
  • 如何利用MongoDB打造TOP榜小程序
  • 一加3T解锁OEM、刷入TWRP、第三方ROM以及ROOT
  • 因为阿里,他们成了“杭漂”
  • 正则表达式小结
  • 看到一个关于网页设计的文章分享过来!大家看看!
  • media数据库操作,可以进行增删改查,实现回收站,隐私照片功能 SharedPreferences存储地址:
  • ​​​​​​​Installing ROS on the Raspberry Pi
  • ​ssh免密码登录设置及问题总结
  • #我与Java虚拟机的故事#连载07:我放弃了对JVM的进一步学习
  • $.proxy和$.extend
  • %3cscript放入php,跟bWAPP学WEB安全(PHP代码)--XSS跨站脚本攻击
  • (poj1.3.2)1791(构造法模拟)
  • (超简单)使用vuepress搭建自己的博客并部署到github pages上
  • (附源码)node.js知识分享网站 毕业设计 202038
  • (附源码)springboot车辆管理系统 毕业设计 031034
  • (简单有案例)前端实现主题切换、动态换肤的两种简单方式
  • (南京观海微电子)——I3C协议介绍
  • (实战篇)如何缓存数据
  • (原+转)Ubuntu16.04软件中心闪退及wifi消失
  • (转) ns2/nam与nam实现相关的文件
  • (转载)(官方)UE4--图像编程----着色器开发
  • .netcore 如何获取系统中所有session_ASP.NET Core如何解决分布式Session一致性问题
  • .NET应用架构设计:原则、模式与实践 目录预览
  • .考试倒计时43天!来提分啦!
  • /var/log/cvslog 太大