我们有一个ASP。NET 2.0应用程序,可作为试用版下载。因此,我们无法控制将安装它的环境。尽管我们努力生产一个可靠的安装程序,我们仍然收到很多用户报告问题。
我们使用web部署项目生成编译过的。net文件。然后我们使用输出并在VS 2010部署项目中运行它来生成一个msi安装程序。
下面是我们遇到的几个问题:
- 似乎msi安装程序不能很好地与IIS7一起工作。在为了使其正确安装,IIS6兼容性需要
- 即使"RemovePreviousVersions"被设置为true,安装程序几乎从不卸载以前的版本,只是抛出一个错误,说应用程序已经安装。
我们以前尝试过使用InnoSetup安装程序。它在一定程度上起作用,但我们遇到了安装的应用程序连接到错误的应用程序池的问题,并且从未找到通过InnoSetup脚本定义应用程序池的方法。
谁能给我一个明确的清单,你需要得到一个ASP。. NET应用程序在具有未知配置的Windows XP或更高版本的机器上运行?例如,检查. net 2.0是否安装,检查II6是否安装,将文件复制到x,创建虚拟目录等。更棒的是,有没有人知道一个安装程序(或InnoSetup扩展)可以为你做大部分的安装?
为了在开发或生产服务器上部署该版本,请按照以下步骤操作。
- Install Web Deployment MSI.
- 右键单击解决方案资源管理器下的项目并添加web部署项目(这里我没有使用转换为web应用程序或发布)
- 然后编译文件。这将在您的项目目录中创建一个文件夹,其中包含要部署到服务器上的所需文件。
- 备份您的虚拟目录,并删除虚拟目录以及inetpub中的文件。
- 转到Inet mgr,在run中输入inetmgr,按enter键。
- 在默认网站下,创建一个虚拟目录,将部署的文件保存在inetpub中,并在浏览器中查看。
- 允许适当的访问,如读取、运行脚本和浏览。这就是
标记它作为你的答案,如果你发现它有用,让我知道…
您可以使用Installshield来开发满足您需求的安装程序。它有所有的功能,支持创建和删除虚拟目录取决于IIS,复制数据到目标系统,验证操作系统等。
如果您使用外部.dll(程序集),那么您也必须部署它们。例如:如果应用程序使用Crystal reports(CR),则必须在生产机器上安装CR运行时包。还要确保您的所有文件都已导入到您的项目中,并且您的应用程序不会在本地机器中(在您的项目目录之外)查找其文件。
在审查了所有选项后,我决定保留msi安装程序,但在inno安装脚本中添加先决条件检查。
脚本
procedure DialogInfo(const Msg: String);
begin
MsgBox(Msg , mbInformation, mb_OK);
end;
function IISInstalled: Boolean;
begin
Result := RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWAREMicrosoftInetStp');
end;
function GetIISMajorVersion: Integer;
var
Vers: Cardinal;
begin
if (IISInstalled) and
(RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWAREMicrosoftInetStp', 'MajorVersion', Vers)) then
Result := Vers
else
Result :=0;
end;
function IISManagementConsoleInstalled: Boolean;
var
IIS: Variant;
begin
try
IIS := CreateOleObject('IISNamespace');
Result := TRUE;
except
Result := FALSE;
end;
end;
function WindowsMinorVersion: Integer;
var
Version: TWindowsVersion;
begin
GetWindowsVersionEx(Version);
Result := Version.Minor;
end;
function WindowsMajorVersion: Integer;
var
Version: TWindowsVersion;
begin
GetWindowsVersionEx(Version);
Result := Version.Major;
end;
function WindowsServer: Boolean;
var
Version: TWindowsVersion;
begin
GetWindowsVersionEx(Version);
Result := Version.ProductType = VER_NT_SERVER;
end;
function IsWindows7: Boolean;
begin
Result := (WindowsMajorVersion = 6) and (WindowsMinorVersion = 1) and (not WindowsServer);
end;
function IsWindowsVista: Boolean;
begin
Result := (WindowsMajorVersion = 6) and (WindowsMinorVersion = 0) and (not WindowsServer);
end;
function IsWindowsXP: Boolean;
begin
Result := (WindowsMajorVersion = 5) and (WindowsMinorVersion = 1) and (not WindowsServer);
end;
function IsWinServer2003: Boolean;
begin
Result := (WindowsMajorVersion = 5) and (WindowsMinorVersion = 2) and (WindowsServer);
end;
function IsWinServer2008: Boolean;
begin
Result := (WindowsMajorVersion = 6) and ((WindowsMinorVersion = 0) or (WindowsMinorVersion = 1)) and (WindowsServer);
end;
function IsHomeEdition: Boolean;
var
Version: TWindowsVersion;
begin
GetWindowsVersionEx(Version);
Result := Version.SuiteMask AND VER_SUITE_PERSONAL <> 0 ;
end;
function CheckIISPrerequisites: Boolean;
var
IISVersion: Integer;
Msg: String;
begin
Result := FALSE;
case GetIISMajorVersion of
0:
begin
if IsHomeEdition then
Msg := 'The Easy-IP Web Server requires Internet Information Services (IIS). IIS cannot be installed on the Home edition of Windows.'
else
begin
Msg := 'The Easy-IP Web Server requires Internet Information Services to be enabled on this machine. To enable IIS: ' +#10 + #10;
if IsWindowsXP then
Msg := Msg + '1) Open Control Panel then Add or Remove Programs.' + #10 +
'2) Click on Add/Remove Windows Components.' + #10 +
'3) Find Internet Information Services (IIS) amd check it.' + #10 +
'4) Click Next then Finish.' else
if IsWinServer2003 then
Msg := Msg + '1) Open Manage Your Server' + #10 +
'2) Click on Add or Remove a Role.' + #10 +
'3) Click Next.' + #10 +
'4) Select Application server (IIS, ASP.NET)' + #10 +
'5) Click Next.' + #10 +
'6) Check Enable ASP.NET.' + #10 +
'7) Click Next, then Next again.' else
if IsWinServer2008 then
Msg := Msg + '1) Open Server Manager.' + #10 +
'2) Click on Roles.' + #10 +
'3) Click Add Roles.' + #10 +
'4) When the Wizard appears, click Next.' + #10 +
'5) Find Web Server(IIS) and check it.' + #10 +
'6) Click Next twice.' + #10 +
'7) Find Application Development and check it.' + #10 +
'8) Find IIS 6 Management Compatibility (under Management Tools) and check it along with all it''s children.' + #10 +
'9) Click Next, then Install.'
else
// Vista, Win7 or later
Msg := Msg + '1) Open Control Panel then Programs and Features.' + #10 +
'2) Click on Turn Windows Features on or off.' + #10 +
'3) Check Internet Information Services.' + #10 +
'4) Under the Internet Information Services node, expand Web Management Tools and check IIS Management Console.' + #10 +
'5) Click OK.';
end;
end;
5, 6:
begin
Result := IISManagementConsoleInstalled;
if not Result then
Msg := 'Unable to install the Easy-IP Web Server as the IIS Management Console could not be initiated. Please contact support@easy-ip.net for more information.';
end;
7:
begin
Result := IISManagementConsoleInstalled;
if not Result then
begin
Msg := 'Internet Information Services is installed, but in order to install the Easy-IP Web Server, you must also enable the IIS Management Console. To enable the IIS Management Console:' + #10 + #10;
if WindowsServer then
Msg := Msg + '1) Open Server Manager and click on Roles.' + #10 +
'2) Under Web Server (IIS), click Add Role Services.' + #10 +
'3) Find Application Development and make sure it''s checked.' + #10 +
'4) Find IIS 6 Management Compatibility (under Management Tools) and check it along with all it''s children.' + #10 +
'5) Click Next, then Install.'
else
Msg := Msg + '1) Open Control Panel then Programs and Features.' + #10 +
'2) Click on Turn Windows Features on or off.' + #10 +
'3) Under the Internet Information Services node, expand Web Management Tools then check IIS Management Console.' + #10 +
'4) Click OK.';
end;
end;
end; // of case
if not Result then
DialogInfo(Msg);
end;
Windows PI与Windows XP SP3+(及更高版本)一起工作,并为web开发服务器提供了先决条件。
http://www.microsoft.com/web/downloads/platform.aspx举手-我自己没有尝试过,但我会给它一个开发服务器。也许你会感兴趣