Installshield2010 實(shí)現web部署和數據庫安裝示例 - 邀月周記 - CS...
Installshield2010 實(shí)現web部署和數據庫安裝示例 收藏 此文于2010-05-21被推薦到CSDN首頁(yè)
如何被推薦?
在前面兩篇文章中,介紹了如何利用Installshield集成Framework在安裝程序中。
今天做了下web部署和簡(jiǎn)單數據庫的安裝,部署過(guò)程沒(méi)有編寫(xiě)一行代碼,堪稱(chēng)傻瓜化?,F將部署過(guò)程演示如下:
在vs2010 中,新建一Web Application,如下圖:
在InstallShield2010中新建一項目,如圖:
再I(mǎi)IS中新建一站點(diǎn),可以用默認80端口,也可以自定義。
在該站點(diǎn)下新建一應用程序,注意也可以是虛擬目錄。
OK!下來(lái)是數據庫部署,在上面的數據庫項目中直接新建一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,如圖:
可以設置數據庫的相關(guān)選項,例如版本,可以手工指定。
OK!基本完成了!欣賞一下部署過(guò)程和成果吧!
修改SQL Server后,
總結:
1、 注意installshield2010目前版本為sp1 with hotfix 52410,還不支持Framewrok 4的IIS站點(diǎn)的部署,非常遺憾!不過(guò)期待新版本!^_^
2、注意此安裝程序在卸載時(shí),如果數據庫連接不上,會(huì )提示出錯而終止卸載程序,當然可以在制作安裝程序時(shí)設置為“出錯則自動(dòng)跳到下一步”而修改默認配置。
另外,可以直接在vs2010中新建Installshield類(lèi)型的項目,操作比較類(lèi)似,在些略去,在興趣的朋友可以一試。
附官方原版下載地址:
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請
點(diǎn)擊舉報。