Wix 目录如何工作?
我正在尝试构建一个 WIX 安装程序,它允许用户通过命令行参数指定安装路径。
<Property Id="IISROOTPATH">
<RegistrySearch Id="FindInetPubFolder" Root="HKLM" Key="SOFTWARE\Microsoft\InetStp" Name="PathWWWRoot" Type="directory" />
</Property>
...
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="IISROOTPATH">
<Directory Id="INSTALLPATH" Name="WebsiteFolder">
...
如果用户不传入任何参数,它将在注册表中查找 iisroot 文件夹,并将文件安装在名为“WebsiteFolder”的文件夹下,
但是为了让用户更改安装路径,他们必须传入绝对路径路径例如
INSTALLPATH="C:\InetPub\wwwroot\CustomWebsiteFolder"
这是如何工作的?然后它会忽略其他目录元素 TARGETDIR 和 IISROOTPATH 吗?
如何将 INSTALLPATH 更改为 WEBSITEFOLDERNAME,以便用户只需传入文件夹名称而不是绝对安装路径。因此强制用户始终安装到 inetpub 中?
I'm trying to build a WIX installer, which allows the user to specify the install path through command line arguments.
<Property Id="IISROOTPATH">
<RegistrySearch Id="FindInetPubFolder" Root="HKLM" Key="SOFTWARE\Microsoft\InetStp" Name="PathWWWRoot" Type="directory" />
</Property>
...
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="IISROOTPATH">
<Directory Id="INSTALLPATH" Name="WebsiteFolder">
...
If the user doesn't pass in any arguments, it will look up registry for the iisroot folder, and install the files under a folder called "WebsiteFolder"
But in order for the user to change the install path, they must pass in an absolute path eg
INSTALLPATH="C:\InetPub\wwwroot\CustomWebsiteFolder"
How does this work? does it then ignore the other Directory elements TARGETDIR and IISROOTPATH?
How can I change INSTALLPATH to just WEBSITEFOLDERNAME so the user is only required to pass in the folder name rather than the absolute install path. Thus forcing the user to always install into inetpub?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该了解 Directory 表 - Directory 元素背后的 MSI 概念。我见过的最好的解释是 一组 Rob文章(链接是第1部分,如果我没记错的话,有6部分)。
You should understand the Directory table - the MSI concept behind the Directory element. The best explanation I've ever met is a set of Rob's articles (the link is to the part 1, there are 6 parts, if I remember correctly).
要回答您的第二个问题:
显然,向“下一步”按钮添加条件是一个好主意,这样用户就不会使用默认值或将文件夹名称留空。
然后,这将允许您将根目录保留为 C:\Intetpub\wwwroot 并允许他们指定自定义文件夹。
To answer your second question:
Obviously it'll be a good idea to add conditions to the Next button so that the user doesn't use the default or leave the folder name blank.
This will then allow you to keep the root dir as C:\Intetpub\wwwroot and allow them to specify a custom folder.