简体   繁体   English

WiX:Change.msi 目录和 CustomAction 表,其中包含要由 .msp 补丁文件使用的更改

[英]WiX: Change .msi Directory and CustomAction table with changes to be used by .msp Patch file

with the Wix Toolset v3.11 I have created a.msi file for my application (let's say version 1.1) with a Directory element that targets the LocalAppDataFolder and puts a Temp folder underneath.使用 Wix 工具集 v3.11,我为我的应用程序(比如说 1.1 版)创建了一个 .msi 文件,其中包含一个以 LocalAppDataFolder 为目标的 Directory 元素,并在其下放置一个 Temp 文件夹。 This structure is used with a DirectoryRef element to put some files there that are accessed within a custom action on InstallFinalize.此结构与 DirectoryRef 元素一起使用,以将一些文件放在那里,这些文件可以在 InstallFinalize 上的自定义操作中访问。 Now I generated a Patch (version 1.2) that adds some files in the Temp folder.现在我生成了一个补丁(1.2 版),它在 Temp 文件夹中添加了一些文件。 But I want that folder to be in the TARGETDIR now.但我希望该文件夹现在位于 TARGETDIR 中。 So I changed所以我改变了

<Directory Id="LocalAppDataFolder">
  <Directory Id="APPDATA_TEMP" Name="Temp" />
</Directory>

to

<Directory Id="MY_TEMP_PATH" Name=".">
  <Directory Id="APPDATA_TEMP" Name="Temp" />
</Directory>

underneath the在下面

<Directory Id="TARGETDIR" Name="SourceDir">

structure.结构体。 For the Patch to be applied correctly I opened the.msi file that's referenced in the registry (under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\...\Products{GUID}\InstallProperties\LocalPackage ) with the Orca tool and edited the corresponding values in the Directory table.为了正确应用补丁,我使用 Orca 打开了注册表中引用的 .msi 文件(在HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\...\Products{GUID}\InstallProperties\LocalPackage 下)工具并编辑目录表中的相应值。 I also edited the CustomActions table to reference the new path as it is used as a parameter there.我还编辑了 CustomActions 表以引用新路径,因为它在那里用作参数。 So, now when I install the Patch it puts all the files (changed and new ones) in the LocalAppDataFolder as it did with the initial install.所以,现在当我安装补丁时,它会将所有文件(更改的和新的)放在 LocalAppDataFolder 中,就像初始安装一样。 The custom action is called with the correct parameter though.但是,使用正确的参数调用自定义操作。

Is there a way to change the "base" msi to target my new Temp folder or, alternatively, somehow tell the Patch to use the new folder regardless of the initial path?有没有办法将“基础”msi 更改为针对我的新临时文件夹,或者以某种方式告诉补丁使用新文件夹而不管初始路径如何?

The goal is to apply the patch without having to uninstall the application first.目标是应用补丁而无需先卸载应用程序。

Any help on how to achieve that is greatly appreciated.非常感谢任何有关如何实现这一目标的帮助。

Finally we found a solution.最后我们找到了解决方案。 So here's what solved our problem, should anyone ever come across something similar:所以这就是解决我们问题的方法,如果有人遇到过类似的事情:

We found the actual path of the LocalAppDataFolder in two locations in the registry: The first entry is located in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders .我们在注册表的两个位置找到了 LocalAppDataFolder 的实际路径:第一个条目位于HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders中。 The second one is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData...\Components .第二个是HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData...\Components The entry with the component ID that puts the files in the Temp folder holds exactly one value, which is the path to the first file in that component.将文件放入 Temp 文件夹的具有组件 ID 的条目仅包含一个值,即该组件中第一个文件的路径。 We changed both paths to our new temp folder.我们将两个路径都更改为新的临时文件夹。

Now the patch extracts the files correctly to the new temp folder and the custom action can process them further.现在补丁将文件正确地提取到新的临时文件夹中,并且自定义操作可以进一步处理它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM