Web 安装项目中的虚拟目录
我有一个网络安装项目,默认情况下在文本框安装程序屏幕中显示虚拟目录。 我希望用户无法编辑虚拟目录名称,并且始终默认为我在 msi 中设置的虚拟目录名称。 如何才能实现这一目标?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
如果您不希望用户更改虚拟目录,您只需从用户界面中删除“安装地址”对话框即可。
选择“用户界面”。
如果您想要通常由安装地址对话框选择的网站、虚拟目录、应用程序池的不同参数,您可以使用自定义操作进行覆盖,如其他人所述。
但是,根据我的经验,自定义操作无助于设置用户可以更改的默认值,因为它们在要求用户输入的对话框之后执行。
设置用户可以根据需要在对话框中覆盖的一些默认值的最简单方法是执行以下操作。
页。
并在“编辑
最有用的属性(恕我直言)是。
TARGETDIR - 文件要复制到的位置。
TARGETVDIR - 要在指定站点中创建的虚拟目录。
TARGETAPPPOOL - 要使用的应用程序池(注意:它必须存在,不会被创建)
TARGETSITE - 要创建虚拟目录的网站(注意:这是网站的元数据库值...例如:“/LM/W3svc/ 2"。另请注意,该站点必须存在)。
您可以在此处找到安装程序的完整属性列表。
如果您确实想要更好地控制 IIS 设置,我建议将您的项目更改为标准 Windows Installer 项目并创建自定义安装操作,以便您可以以编程方式创建 AppPools。 此处是了解以编程方式创建这些内容的好地方。
这样做的最大原因是自定义操作在提示之后运行,但应用程序池和网站必须在之前创建安装程序会提示。
If you don't want the user to change the virtual directory you can simply remove the "Installation Address" dialog from the User Interface.
select "User Interface".
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.
page.
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.
理论上听起来不错,但据我所知,不起作用,至少对于设置 AppPool 不起作用。 我有一个自定义操作来在我的 vs2008 Web 设置项目中设置应用程序池(顺便说一下,当使用 VS2005 构建安装程序时,它可以正常工作)。
安装程序在没有对话框的情况下运行(删除了安装地址 UI 节点),但虚拟目录上设置的 AppPool 最终成为 DefaultAppPool。
我的助手类中的其他自定义操作确实可以运行和工作。
所以肯定还需要一些其他的魔法咒语。
谢谢。
Sounds good in theory but near as I can tell, doesn't work, at least not for setting AppPool. I have a custom action to set the apppool (which by the way works fine when the installer is built with VS2005) in my vs2008 web setup project.
The installer runs with no dialog (removed the installation address UI node) but the AppPool set on the virtual directory ends up being DefaultAppPool.
Other custom actions in my helper class do run and work.
So there must be some other magic incantations needed.
Thanks.
为了使用 Context.Parameters 获取虚拟目录,
希望这对您有帮助:)
In order to get the Virtual Directory using Context.Parameters
Hope this helped you :)
Org不允许开源,或者GPL开源。
解决方案:
* 编辑自定义操作(右键>查看>自定义操作)以修复虚拟目录和路径
将 customactiondata 更改
为
:您可能只需从用户界面中删除安装地址,然后设置一个将信息传递到自定义安装的组件
Org does not allow open source, or GPL open source.
Solutions:
* edit the custom action (right click>view>custom action) to fix the virtual directory and path
Change the customactiondata:
To:
You might just delete the Installation Address from user interface, and setup a component that passes information to the custom install
选择您的安装项目,查看> 编辑> 用户界面,选择安装地址对话框,然后将其删除。
编辑:
正如 Shay 指出的那样,用户可以从命令行覆盖默认安装位置。 要覆盖此设置,您应该在 InstallExecuteSequence 中设置 TARGETDIR 属性。 不幸的是,您无法从 Visual Studio 更改此顺序,您必须使用 Orca:
Select your setup project, View > Editors > User Interface, select the Installation Address dialogs, and delete them.
EDIT:
As Shay points out, users can override the default install location from the command line. To override this, you should set the TARGETDIR property in your InstallExecuteSequence. Unfortunately, you cannot change this sequence from Visual Studio, you have to use Orca:
切换到 Wix 并使用他们的 网络扩展
Switch to Wix and use their Web Extensions
低技术解决方案:在notepad++中编辑vdproj文件以设置虚拟目录并从用户界面编辑器中删除“安装地址”对话框。
Lo-tech solution: edit the vdproj file in notepad++ to set the virtual directory and remove the Installation Address dialog from the User Interface Editor.
对于我来说,在 VS
右键单击安装项目
查看 -> 文件系统
Web 应用程序文件夹(位于左窗格中)
在属性窗口中(右侧、底部)
虚拟目录(最后一个)
在这里您可以更改/设置IIS上的默认路径,即可以安装的目标目录。
For me in VS
Right click on setup project
View -> File System
Web Application Folder (in the left pane)
in the property window (to the right, bottom)
Virtual Directory (the last one)
Here you can change/set the default path on IIS i.e. target directory which can be installed.