windows 为什么 InstallShield 无法找到文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7877241/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 18:20:37  来源:igfitidea点击:

Why would InstallShield be unable to find a file?

windowsinstallerinstallshield

提问by DNS

I have an InstallShield (InstallScript) installation, created using IS2009, that's built automatically every night, and has been used successfully for years. A few days ago, installs started failing; progress reaches 99%, then an error dialog comes up claiming that there was an error installing a particular file; the specific message is "The system cannot find the file specified".

我有一个 InstallShield (InstallScript) 安装,使用 IS2009 创建,每晚自动构建,并且已成功使用多年。几天前,安装开始失败;进度达到 99%,然后出现一个错误对话框,声称安装特定文件时出错;具体消息是“系统找不到指定的文件”。

  1. Reproducible on both WinXP and Win7.

  2. This isn't due to any change in the installer; those files have been untouched for weeks/months

  3. It's the same file every time, though it has some text appended to its name, and has an .rra extension; from what I've read, this is the temporary file that IS extracts to the Windows temp folder prior to moving it to its final destination.

  4. Other files in the same folder and of the same type are installed successfully. It's also not the last file to be installed; when the error is dismissed, the install quits and other files both in the same folder and elsewhere are missing as well.

  5. The file is a regular dynamic file link that is part of a Feature; it's not being manipulated with InstallScript or anything else that could introduce external problems. There's no difference in linking between that file and many others that are installed successfully.

  6. No errors during installer build; IS appears to find the files just fine, and I opened the built cab to verify that the file is inside.

  7. No errors or related info appear in the .ilg log file or Windows event logs on the target machine.

  8. I tried deleting the IS projects and all temporary build files, then checked out fresh copies from version control and rebuilt from scratch, but the problem persists.

  1. 可在 WinXP 和 Win7 上重现。

  2. 这不是由于安装程序中的任何更改;这些文件已经数周/数月未动过

  3. 每次都是同一个文件,尽管它的名称后面附加了一些文本,并且扩展名为 .rra;从我读过的内容来看,这是 IS 在将其移动到最终目的地之前提取到 Windows 临时文件夹的临时文件。

  4. 其他同文件夹同类型文件安装成功。它也不是要安装的最后一个文件;当错误被解除时,安装会退出,并且同一文件夹和其他地方的其他文件也会丢失。

  5. 该文件是作为功能一部分的常规动态文件链接;它不会被 InstallScript 或任何其他可能引入外部问题的东西操纵。该文件与许多其他已成功安装的文件之间的链接没有区别。

  6. 安装程序构建期间没有错误;IS 似乎找到了很好的文件,我打开了构建的 cab 以验证文件是否在里面。

  7. 目标计算机上的 .ilg 日志文件或 Windows 事件日志中没有出现错误或相关信息。

  8. 我尝试删除 IS 项目和所有临时构建文件,然后从版本控制中检出新副本并从头开始重建,但问题仍然存在。

How could this happen, and where else might I look in tracking down the cause?

这怎么会发生,我还能在哪里寻找原因?

采纳答案by DNS

It turns out that InstallShield scans for files with identical content and, to reduce installer file size, includes only one of the files. On install, the master file is written to disk as an rra, and then copied to create any other files with the same content.

事实证明,InstallShield 会扫描具有相同内容的文件,并且为了减小安装程序文件的大小,只包含其中一个文件。安装时,主文件作为 rra 写入磁盘,然后复制以创建具有相同内容的任何其他文件。

In our case, we had recently added a new file, in a different location and with a different name, that had exactly the same content as an existing one. We remove the folder containing the original file as part of the install, assuming that nothing touches it until later in the install. But once the other file was introduced, InstallShield started writing the rra version to the folder early in the install, before the delete action. The delete removed the rra, which InstallShield was then unable to find when its turn actually arrived.

在我们的例子中,我们最近添加了一个新文件,位于不同的位置并具有不同的名称,其内容与现有文件完全相同。作为安装的一部分,我们删除包含原始文件的文件夹,假设在安装后期之前没有任何内容涉及它。但是,一旦引入了另一个文件,InstallShield 就开始在安装的早期、删除操作之前将 rra 版本写入文件夹。删除删除了 rra,当轮到它时,InstallShield 无法找到它。

Hopefully this helps someone else down the road, since this particular InstallShield behavior, and the use of rra files in general, does not appear to be documented anywhere.

希望这可以帮助其他人,因为这种特殊的 InstallShield 行为以及一般的 rra 文件的使用似乎没有记录在任何地方。