且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

安装ASP.NET本地Web应用程序

更新时间:2022-11-05 18:26:05

FWIW, IsWiX 项目模板(VS2012 +)擅长这个故事。这是一个大致的轮廓:

FWIW, IsWiX project templates (VS2012+) excel at this story. Here is a rough outline:

安装Windows Installer XML和工业级的Windows Installer XML

Install Windows Installer XML and Industrial Strength Windows Installer XML

使用的VS项目模板创建一个ASP.NET Web应用程序的解决方案

Use the VS project templates to create an ASP.NET Web Application Solution

名称:图书城

地点:C:\\来源\\图书城

Location: C:\Source\BookStore

解决方案名称:应用程序

Solution Name: Application

检查创建解决方案的目录

Check Create directory for solution

选择单页应用程序,然后单击确定

Select Single Page Application and click OK

右键单击Solution Explorer中的图书城项目,并选择发布

Right click the BookStore project in the solution explorer and select Publish

点击自定义,并输入名称LocalDeploy,然后单击确定

Click Custom and enter the name LocalDeploy and click OK

选择文件系统发布方法

输入.... \\安装\\部署,然后单击发布

Enter ....\Installer\Deploy and click Publish

关闭解决方案

使用的VS项目模板来创建一个Windows Installer XML \\ IsWiX解决方案(.MSI /的.msm)解决方案

Use the VS project templates to create a Windows Installer XML \ IsWiX Solution (.MSI/.MSM) solution

名称:图书城

地点:C:\\来源\\图书城

Location: C:\Source\BookStore

解决方案名称:安装

检查创建解决方案的目录

Check Create directory for solution

双击BookStoreMM.wxs在Solution Explorer。

Double click the BookStoreMM.wxs in the solution explorer.

选择工具| IsWiX外接程序

Select Tools | IsWiX AddIn

点击文件和文件夹

拖放你想从源视图到目标视图部署文件和文件夹

Drag and drop the files and folders you want to deploy from the source view to the destination view

点击保存并关闭IsWiX

Click Save and close IsWiX

点击时,由Visual Studio提示是重装源。看看由IsWiX编写的XML。

Click Yes when prompted by Visual Studio to reload the source. Take a look at the XML written by IsWiX.

右键点击BookStoreMM项目引用,并添加到WixIIsExtension.dll参考

Right click references in the BookStoreMM project and add a reference to WixIIsExtension.dll

双击BookStoreMMcustom.wxs在BookStoreMM项目。

Double click the BookStoreMMcustom.wxs in the BookStoreMM project.

选择工具| IsWiX外接程序

Select Tools | IsWiX AddIn

点击命名空间

选择IIS的命名空间。

Select the iis namespace

点击保存并关闭IsWiX

Click Save and close IsWiX

点击时,由Visual Studio提示是重装源。看看由IsWiX编写的XML。

Click Yes when prompted by Visual Studio to reload the source. Take a look at the XML written by IsWiX.

笔者DirectoryRef元素下一个网站组件和ComponentRef元素添加到ComponentGroup元素。精确的元素和属性将取决于你的应用程序的特定IIS需求。这里是一个普遍的样本。

Author a website component under the DirectoryRef element and add a ComponentRef element to the ComponentGroup element. The exact elements and attributes will depend on the specific IIS needs of your application. Here is a general sample.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
  <Fragment>

    <!-- Reference Custom Components Below -->
    <ComponentGroup Id="Custom">
      <ComponentRef Id="webHomePage"/>
    </ComponentGroup>

    <!-- Author Custom Components Below -->
    <DirectoryRef Id="MergeRedirectFolder">
      <Component Id="webHomePage" Guid="someguid" KeyPath="yes">
        <iis:WebSite Id="default" SiteId="*" Description="HomePage" Directory="MergeRedirectFolder" ConfigureIfExists="no">
          <iis:WebAddress Id="AllUnassigned" Port="80" />
          <iis:WebDirProperties Id="webDirPropsApi" AnonymousAccess="yes" WindowsAuthentication="no"/>
        </iis:WebSite>
      </Component>
    </DirectoryRef>

  </Fragment>
</Wix>