Web安装项目中的虚拟目录 [英] Virtual Directory in Web Setup Project

查看:147
本文介绍了Web安装项目中的虚拟目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web安装项目,默认情况下在文本框安装程序屏幕中显示虚拟目录.我希望虚拟目录名称不能由用户编辑,并且始终默认为我在msi中设置的名称.如何实现?

解决方案

如果您不希望用户更改虚拟目录,则只需从用户界面中删除安装地址"对话框即可.

  1. 右键单击安装程序项目,然后 选择用户界面".
  2. 展开开始"节点.
  3. 右键单击安装地址".
  4. 选择删除"

如果要为通常由安装地址对话框选择的网站,虚拟目录和应用程序池使用不同的参数,则可以使用自定义操作进行覆盖,如其他人所述.

但是,根据我的经验,自定义操作不能帮助用户设置默认值,因为它们会执行 之后 对话框,要求用户输入.

设置一些默认值(如果需要,在对话框中用户可以覆盖这些默认值)的最简单方法是执行以下操作.

  1. 删除欢迎页面.
  2. 添加文本框"对话框(例如文本框(A)")
  3. 将所有文本框的可见性"属性更改为false,以便不显示任何文本框.
  4. 更改BannerBitmap和BodyText属性,使其看起来有点受欢迎 页面.
  5. 在编辑***< n> 属性"中设置要覆盖的必要属性 并在编辑 < n> ***值"中设置默认值.

最有用的属性(IMHO)是.

TARGETDIR-将文件复制到的位置.
TARGETVDIR-在指定站点中创建的虚拟目录.
TARGETAPPPOOL-要使用的应用程序池(注意:此必须存在,将不会创建)
TARGETSITE-要在其中创建虚拟目录的网站(注意:这是网站的 元数据库值 ...例如:"/LM/W3svc/2.另外请注意,该站点必须存在.

可以在此处找到完整的安装程序属性列表.

如果您真的想更好地控制IIS安装程序,建议您将项目更改为标准Windows Installer项目,并创建自定义Install操作,以便可以以编程方式创建AppPools.在此处.开始理解以编程方式创建这些东西的好地方./p>

这样做的最大原因是自定义操作在提示后 运行,但是必须在 之前创建应用程序池和网站 ,安装程序会提示.

I have a web setup project which by default shows the virtual directory in the textbox installer screen. I wish that the virtual directory name cannot be edited by the user and always defaults to the one I have setup in my msi. How can this be achieved?

解决方案

If you don't want the user to change the virtual directory you can simply remove the "Installation Address" dialog from the User Interface.

  1. Right Click installer project and select "User Interface".
  2. Expand the "Start" node.
  3. Right click on "Installation Address".
  4. Select "Delete"

If you want different parameters for the Web site, virtual directory, application pool that is normally selected by the installation address dialog you can override with a custom action as others have described.

However, in my experience custom actions do not help with setting defaults that the user can change because they execute After the dialogs that ask for user input.

The easiest way to set some defaults that the user can override if necessary in a dialog is to do the following.

  1. Remove the Welcome Page.
  2. Add a Textboxes dialog (for example "Textboxes (A)")
  3. Change Visible properties for all the textboxes to false so no textboxes are shown.
  4. Change the BannerBitmap and BodyText property so it looks somewhat like a welcome page.
  5. Set the necessary properties you want to override in the "Edit***<n>Property" and set the default value in the "Edit<n>***Value".

The most useful properties (IMHO) are.

TARGETDIR - Where the files are to be copied.
TARGETVDIR - The Virtual Directory to be created in the specified site.
TARGETAPPPOOL - The application pool to use (NOTE: This must exist, it won't be created)
TARGETSITE - The website where the virtual directory is to be created (NOTE: This is the metabase value for the web site... For example: "/LM/W3svc/2". Also note that the site must exist).

There is a full list of properties for the installer can be found here.

If you really want better control over the IIS setup I would suggest changing your project to a standard Windows Installer project and creating custom Install actions so that you can programatically create AppPools. A good place to start to understand programmaticly creating these things is here.

The biggest reason for doing it this way is that custom actions run after prompting but the app pool and web sites must be created before the installer can prompt.

这篇关于Web安装项目中的虚拟目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆