WIX v3.11.2-安装到现有文件夹

发布于 2025-01-22 05:30:19 字数 262 浏览 0 评论 0原文

我正在尝试使用Wix Toolset创建.msi安装程序。安装程序旨在为软件安装一个插件。为了使此功能工作,必须将文件安装到AppData文件夹中的软件(例如/appdata/roaming/softwarename/addins/addins/addinname)中的软件中的各个文件夹。如何将安装文件夹设置为该路径以使其适用于所有机器?另外,如果安装人员可以运行检查并查找路径是否存在并进行安装,则如果是的,则将进行安装,或者取消安装(如果不是),那将是很棒的。 Wix工具集可以实现这一目标吗?提前致谢。

I'm trying to create an .msi installer using the WIX toolset. The installer is meant to install an addon for a piece of software. In order for this to work, the files must be installed to the respective folder of the software in the AppData folder (e.g. ../AppData/Roaming/SoftwareName/Addins/AddinName). How is it possible to set the install folder to that path so that it works for all machines? Also, it would be great if the installer could run a check and find whether the path exists and proceed to the installation if yes or cancel the installation if not. Is this something that can be achieved with the wix toolset? Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一瞬间的火花 2025-01-29 05:30:19

WIX具有进行各种搜索的能力,包括以下内容:

  1. 目录
  2. 文件
  3. 组件
  4. 注册表
  5. INI文件

您可以使用 DirectorySearch 在预定义的位置或其他任何地方搜索文件夹:

绝对路径搜索:综合

<Property Id=”NPP_Path”>
    <DirectorySearch Path=”C:\Program Files\Notepad++”
                 Depth=”0”
                 AssignToProperty=”yes”
                 Id=”nppFolderSearch” />
</Property>

搜索:综合搜索

<Property Id=”NPP_Path”>
    <DirectorySearch Path=”Notepad++”
                 Depth=”5”
                 AssignToProperty=”yes”
                 Id=”nppFolderSearch” />
</Property>

:后一个搜索更好;它将通过在所有可用的驱动器和目录中钻至5个子文件夹来搜索文件夹Notepad ++。但是,这将导致等待时间。更糟糕的是,在搜索隐藏的,受限的接线点(例如C:\ Documents and Settings)时,将丢弃错误。
在这些情况下,嵌套directorysearch彼此内部的元素告诉Windows Installer在哪里搜索是一个更好的解决方案:

<Property Id=”NPP_Path”>
    <DirectorySearch Path=”[ProgramFilesFolder]”
                 Depth=”0”
                 AssignToProperty=”no”
                 Id=”ProgramFilesFolderSearch” >
            <DirectorySearch Path=”Notepad++”
                             Depth=”5”
                              AssignToProperty=”yes”
                                  Id=”nppFolderSearch” />
    </DirectorySearch>
</Property>

最后一个示例搜索程序文件文件夹,di dim not 分配其结果到父属性,然后在外部搜索结果中搜索Notepad ++文件夹。

例如,可以嵌套三个DirectorySearch以找到Notepad ++的“插件”文件夹。

“路径”属性可以接受:

  • WIX属性
  • Windows Share(\ myShare \ myFolder)
  • 相对路径绝对路径
  • 绝对路径
  • folder folder name
  • )的形式)

noverusital noverusital变量以wix preprocessor语法($( env.allusersprofile 找不到父元素中的路径设置,它将跳过并使用默认的路径 - 每个附加驱动器的根目录。
每个DirectorySearch元素必须获得其唯一ID; Windows Installer使用这些ID属性将所有元素将其连接在一起,为一个有内聚的搜索。

Wix has the ability to do various searches including the following:

  1. Directory
  2. File
  3. Component
  4. Registry
  5. Ini files

You can use DirectorySearch to search for a folder either in a predefined location or everywhere:

Absolute path search:

<Property Id=”NPP_Path”>
    <DirectorySearch Path=”C:\Program Files\Notepad++”
                 Depth=”0”
                 AssignToProperty=”yes”
                 Id=”nppFolderSearch” />
</Property>

Comprehensive search:

<Property Id=”NPP_Path”>
    <DirectorySearch Path=”Notepad++”
                 Depth=”5”
                 AssignToProperty=”yes”
                 Id=”nppFolderSearch” />
</Property>

The latter search is better; it will search for folder Notepad++ by drilling down to 5 subfolders in all available drives and directories. However, this will cause a waiting time. Worse, an error will be thrown while searching through hidden, restricted junction points such as C:\Documents and Settings.
In these cases, nesting DirectorySearch elements inside one another to tell Windows Installer where to search is a better solution:

<Property Id=”NPP_Path”>
    <DirectorySearch Path=”[ProgramFilesFolder]”
                 Depth=”0”
                 AssignToProperty=”no”
                 Id=”ProgramFilesFolderSearch” >
            <DirectorySearch Path=”Notepad++”
                             Depth=”5”
                              AssignToProperty=”yes”
                                  Id=”nppFolderSearch” />
    </DirectorySearch>
</Property>

The last example searches the Program Files folder, does not assign its result to the parent property, then searches Notepad++ folder inside the result of the outer search.

As an example, three DirectorySearch could be nested to find the “Plugins” folder of notepad++.

“Path” attribute could accept:

  • WiX properties
  • Windows shares (\myshare\myFolder)
  • relative paths
  • absolute paths
  • folder names
  • environmental variables in the form of Wix preprocessor syntax ($(env.ALLUSERSPROFILE))

If the installer cannot find the path set in the parent element, it will skip it and use the default - every attached drive’s root directory.
Each DirectorySearch element must get its unique ID; Windows Installer uses these Id attributes to tie all of the elements together into one cohesive search.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文