Installshield2010 实现web部署和数据库安装示例 - 邀月周记 - CS...

来源:百度文库 编辑:神马文学网 时间:2024/05/01 23:06:51
 Installshield2010 实现web部署和数据库安装示例 收藏 此文于2010-05-21被推荐到CSDN首页
如何被推荐?
在前面两篇文章中,介绍了如何利用Installshield集成Framework在安装程序中。http://blog.csdn.net/downmoon/archive/2010/04/16/5494032.aspx http://blog.csdn.net/downmoon/archive/2010/02/27/5330935.aspx 今天做了下web部署和简单数据库的安装,部署过程没有编写一行代码,堪称傻瓜化。现将部署过程演示如下:
在vs2010 中,新建一Web Application,如下图: 
在InstallShield2010中新建一项目,如图:
  再IIS中新建一站点,可以用默认80端口,也可以自定义。
   在该站点下新建一应用程序,注意也可以是虚拟目录。   OK!下来是数据库部署,在上面的数据库项目中直接新建一SQL:内容如下:
view plaincopy to clipboardprint?
-- =============================================  
---- Script Template  
-----Generate By downmoon(邀月),3w@live.cn  
-- =============================================  
--Create database  
if exists(select * from master.dbo.sysdatabases where name = 'Demo2010_InstallShield')  
    begin 
        drop database Demo2010_InstallShield  
    end 
else 
    begin 
        Create database Demo2010_InstallShield  
    end 
go  
Use Demo2010_InstallShield  
go  
--Create table  
IF EXISTS (SELECT * FROM sys.tables          
            WHERE name = 'Demo2010_InstallShield_DemoTable')  
        DROP TABLE Demo2010_InstallShield_DemoTable;  
GO  
CREATE TABLE Demo2010_InstallShield_DemoTable  
(col1 int IDENTITY,  
 col2 datetime,  
 col3 char(10)  
 );  
GO  
--Insert into Demo Data  
DECLARE @num int  
SET @num = 1  
WHILE @num < 1000  
BEGIN 
  INSERT INTO Demo2010_InstallShield_DemoTable  
    SELECT GETDATE(), 'my message';  
  SET @num = @num + 1;  
END;  
GO  
----Select * from Demo2010_InstallShield_DemoTable; 
-- =============================================
---- Script Template
-----Generate By downmoon(邀月),3w@live.cn
-- =============================================
--Create database
if exists(select * from master.dbo.sysdatabases where name = 'Demo2010_InstallShield')
    begin
        drop database Demo2010_InstallShield
    end
else
    begin
        Create database Demo2010_InstallShield
    end
go
Use Demo2010_InstallShield
go
--Create table
IF EXISTS (SELECT * FROM sys.tables       
            WHERE name = 'Demo2010_InstallShield_DemoTable')
        DROP TABLE Demo2010_InstallShield_DemoTable;
GO
CREATE TABLE Demo2010_InstallShield_DemoTable
(col1 int IDENTITY,
 col2 datetime,
 col3 char(10)
 );
GO
--Insert into Demo Data
DECLARE @num int
SET @num = 1
WHILE @num < 1000
BEGIN
  INSERT INTO Demo2010_InstallShield_DemoTable
    SELECT GETDATE(), 'my message';
  SET @num = @num + 1;
END;
GO
----Select * from Demo2010_InstallShield_DemoTable;
在 installShield中新增一SQL,如图:
    可以设置数据库的相关选项,例如版本,可以手工指定。    OK!基本完成了!欣赏一下部署过程和成果吧!      修改SQL Server后,          总结:1、 注意installshield2010目前版本为sp1 with hotfix 52410,还不支持Framewrok 4的IIS站点的部署,非常遗憾!不过期待新版本!^_^ 2、注意此安装程序在卸载时,如果数据库连接不上,会提示出错而终止卸载程序,当然可以在制作安装程序时设置为“出错则自动跳到下一步”而修改默认配置。
 
另外,可以直接在vs2010中新建Installshield类型的项目,操作比较类似,在些略去,在兴趣的朋友可以一试。 附官方原版下载地址:InstallShield 2010 Premier
原版下载:http://saturn.installshield.com/product/is/2010/domestic/premier/installShield2010.exe  本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/downmoon/archive/2010/05/21/5613626.aspx