InstallScript 项目在升级时出现错误 1706

发布于 2024-09-07 09:08:43 字数 1193 浏览 6 评论 0原文

我有一个在InstallShield 2010 中从头开始编写的InstallScript 项目。它包含三个本机InstallShield 对象和四个包装MSM 文件的InstallShield 合并模块持有者对象。

当我最初测试该项目时,它在干净的环境中安装得很好,但是当我尝试升级到较新的版本时,四个合并模块持有者对象中的每一个都生成了“错误 1706。找不到产品 XXXX 的有效源”消息。

我在网上做了一些挖掘,发现这是一个 Windows Installer 错误,发生这种情况是因为即使原始安装介质消失后,MSI 文件也必须存在于计算机上。确保这一点的推荐方法是在“合并模块持有者对象”属性对话框中勾选“在本地缓存 msi 包”复选框。

我勾选了所有四个合并模块的复选框并重新测试,但这并没有解决问题。然后我查看了这些合并模块实际放置在硬盘上的位置。属性对话框显示 ,在运行时解析为 C:\Program Files\InstallShield Installation Information\{Product GUID}。查看测试机器,似乎所有四个合并模块都写入同一个位置,从而覆盖彼此的 MSI 文件。

为了解决这个问题,我编辑了每个合并模块,将其自身缓存到唯一的路径 \{Name}。我再次编译并测试,我可以看到每个合并模块现在确实将其自身保存到一个唯一的子文件夹中。但是,当我升级时,所有四个错误 1706 消息仍然出现。

有人有什么想法吗?我确信我错过了一些明显的东西,但它似乎没有记录在任何地方。 :-)

更新:

根据 InstallShield 论坛上的大量帖子,InstallShield 每次构建 InstallScript 项目时都会为每个嵌入式 MSI 生成一个全新的产品 G​​UID。在更新过程中,InstallShield 引擎会用较新的版本覆盖目标计算机上缓存的每个 MSI 文件,但是当执行它们时,Windows Installer 会说“嘿,这是一个新产品,旧产品的 MSI 在哪里,以便我可以卸载它吗?”,因此出现错误。

是否可以告诉 InstallShield 在每次构建时不要为每个嵌入式 MSI 重新生成产品 GUID?这种行为肯定是对将合并模块嵌入 InstallScript 项目的整个想法的嘲笑吗? :-(

I have an InstallScript project written from scratch in InstallShield 2010. It contains, amongst other things, three native InstallShield objects and four InstallShield Merge Module Holder Objects which wrap MSM files.

When I originally tested the project, it installed fine on a clean environment, but when I tried upgrading to a newer version, each of the four Merge Module Holder Objects produced an "Error 1706. No valid source can be found for product XXXX" message.

I did some digging on the net and found that this is a Windows Installer error, and it occurs because the MSI file has to exist on the machine even after the original install media is gone. The recommended way to ensure that is to tick the "cache the msi package locally" checkbox in the Merge Module Holder Object property dialog.

I ticked that box for all four merge modules and re-tested, but that did not solve the problem. I then looked at where these merge modules were actually being put on the hard disk. The property dialog said <DISK1TARGET>, which resolves to C:\Program Files\InstallShield Installation Information\{Product GUID} at runtime. Looking at the test machine, it seemed as though all four merge modules were writing to the same place, thereby overwriting each other's MSI files.

To get round that, I edited each merge module to cache itself to a unique path, <DISK1TARGET>\{Name}. I compiled and tested again, and I can see that each merge module does now indeed save itself to a unique subfolder. However, all four Error 1706 messages are still appearing when I upgrade.

Does anyone have any ideas? I'm sure I'm missing something obvious, but it doesn't appear to be documented anywhere. :-)

UPDATE:

According to lots of posts on InstallShield forums, it appears that InstallShield generates a brand new product GUID for each embedded MSI every time it builds the InstallScript project. During the update process, the InstallShield engine overwrites each MSI file cached on the target machine with the newer version, but when it comes to execute them, Windows Installer says "hey, this is a new product, where's the old product's MSI so that I can uninstall it?", hence the error.

Is it possible to tell InstallShield to not re-generate the product GUID for each embedded MSI on every build? Surely this behaviour makes a mockery of the whole idea of embedding merge modules into InstallScript projects? :-(

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

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

发布评论

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

评论(1

飘然心甜 2024-09-14 09:08:43

我通过以下方法完成了这项工作:

  1. 获取与我们已有的 MSM 相对应的独立 MSI 设置。幸运的是,这对他们所有人来说都是可能的。
  2. 将 MSI 作为可安装组件包含在 InstallScript 项目中,安装到目标上合适的临时位置。
  3. 在相关的 _Installed 事件中,外壳到 msiexec.exe 并使用 /i运行 MSI 文件/qb 开关。
  4. 在相关的 _UnInstalling 事件中,外壳到 msiexec.exe 并使用 /x 开关运行 MSI 文件。

这感觉有点“错误”,但效果很好,所以我很乐意就此结束,除非有人有更好的想法。

I got this working by:

  1. Obtaining standalone MSI setups corresponding to the MSMs that we already had. Fortunately this was possible for all of them.
  2. Including the MSIs as installable components in the InstallScript project, installed to a suitable temporary location on the target.
  3. In the relevant <feature>_Installed event, shell out to msiexec.exe and run the MSI file with the /i and /qb switches.
  4. In the relevant <feature>_UnInstalling event, shell out to msiexec.exe and run the MSI file with the /x switch.

This feels a bit "wrong", but it works very well, so I'm happy to leave it at that unless anyone has any better ideas.

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