Inno安装程序无法在x64上找到并执行ie4uinit.exe [英] Inno Setup unable to find and execute ie4uinit.exe on x64

查看:94
本文介绍了Inno安装程序无法在x64上找到并执行ie4uinit.exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用众所周知的有文档记录的方法来刷新Windows图标缓存,该方法针对窗口10以下和 ie4uinit.exe -Show 之下的任何内容调用 ie4uinit.exe -ClearIconCache >在Windows 10及更高版本上:

I am trying to refresh the Windows icon cache using the well known and documented method of calling ie4uinit.exe -ClearIconCache for anything below Window 10 and ie4uinit.exe -Show on Windows 10 and above:

[Run]
Filename: "{sys}\ie4uinit.exe"; Parameters: "-ClearIconCache"; StatusMsg: "Rebuilding Windows icon cache..."; Flags: runhidden; Check: not IsWindows10AndAbove
Filename: "{sys}\ie4uinit.exe"; Parameters: "-Show"; StatusMsg: "Rebuilding Windows icon cache..."; Flags: runhidden; Check: IsWindows10AndAbove

这两个命令在资源管理器中或命令提示符下运行时都能按预期工作.在x86系统上运行时,它们也可以在Inno Setup中正常工作.但是,在x64系统上,会产生以下错误:

Both commands work as expected when run in Explorer or at a command prompt. They also work correctly in Inno Setup when running on an x86 system. However, on an x64 system, the following error is produced:

使用 {sys} 常量的文件路径可以正确解析并且文件存在,并且可以在资源管理器和命令提示符下的目录列表中看到该文件:

The path to the file, using the {sys} constant, resolves correctly and the file exists and can be seen both in Explorer and in a directory listing at the command prompt:

通过命令提示符运行的上述代码的以下变体也以几乎相同的方式失败,尽管它是静默的,并且仅在安装日志中由退出代码1指示.

The following variation of the above code, running through the command prompt, also fails in much the same way, although it is silent and only indicated by an exit code of 1 in the install log.

[Run]
Filename: "{cmd}"; Parameters: "/c {sys}\ie4uinit.exe -ClearIconCache"; StatusMsg: "Rebuilding Windows icon cache..."; Flags: runhidden; Check: not IsWindows10AndAbove
Filename: "{cmd}"; Parameters: "/c {sys}\ie4uinit.exe -Show"; StatusMsg: "Rebuilding Windows icon cache..."; Flags: runhidden; Check: IsWindows10AndAbove

我已经阅读了清除图标缓存在Win 7中以编程方式-使用C#或Visual Basic 执行ie4uinit.exe-ClearIconCache,也提到了Inno Setup中的问题(朝下),并尝试了解决方法来复制文件并从中运行别处.但是,尝试使用 FileCopy 函数将文件复制到另一个位置,也未能在 C:\ Windows \ System32 中找到它.我还尝试使用 Exec 函数在 [Code] 部分中运行相同的命令,但这也无法在 C:\ Windows \ System32 .

I have already read clear icon cache in win 7 programmatically - execute ie4uinit.exe-ClearIconCache using C# or Visual Basic, which also has mention of this being a problem in Inno Setup (towards the bottom) and tried the workaround to copy the file and run it from elsewhere. However, attempting to copy the file to another location, using the FileCopy function, also failed to find it in C:\Windows\System32. I also tried running the same command in the [Code] section using the Exec function, but this also fails to find it in C:\Windows\System32.

我考虑过复制文件并将其安装到temp目录中以从那里运行,但是该文件在每个Windows版本上都是不同的版本,因此这并不是一个切实可行的解决方案,特别是因为系统文件,将来可能还会更改.

I considered making a copy of the file and installing it to the temp directory to run it from there, but this file is a different version on each Windows version, so this is not really a viable solution, especially as, being a system file, it may also change in the future.

以上问题的公认答案似乎是为任何CPU"而不是"x86"构建可执行文件.但是,我不确定是否可以在Inno Setup中完成此操作,并且不确定这样做是否会对安装程序的行为产生不可预见的副作用?

The accepted answer in the above question seems to be to build the executable for 'Any CPU' rather than 'x86'. However, I am not sure if this can be done in Inno Setup and also if doing so would have any unforeseen side effects on the installers behaviour?

在Inno Setup中有什么方法可以解决或解决此问题?

Is there any way to resolve or work around this in Inno Setup?

推荐答案

一个简单得多且更好的解决方案(感谢Martin的链接)是为x64使用两个重复的 [Run] 条目,其中检查:IsWin64 标记:64bit ,并在原始行中添加 Check:不是IsWin64 :

A far simpler and better solution (thanks for the links Martin) is to have two duplicated [Run] entries for x64 with Check: IsWin64 and Flags: 64bit and to add Check: not IsWin64 to the original lines:

[Run]
Filename: "{sys}\ie4uinit.exe"; Parameters: "-ClearIconCache"; StatusMsg: "Refreshing Windows icon cache..."; Flags: runhidden; Check: not IsWindows10AndAbove and not IsWin64
Filename: "{sys}\ie4uinit.exe"; Parameters: "-Show"; StatusMsg: "Refreshing Windows icon cache..."; Flags: runhidden; Check: IsWindows10AndAbove and not IsWin64
Filename: "{sys}\ie4uinit.exe"; Parameters: "-ClearIconCache"; StatusMsg: "Refreshing Windows icon cache..."; Flags: runhidden 64bit; Check: not IsWindows10AndAbove and IsWin64
Filename: "{sys}\ie4uinit.exe"; Parameters: "-Show"; StatusMsg: "Refreshing Windows icon cache..."; Flags: runhidden 64bit; Check: IsWindows10AndAbove and IsWin64

这篇关于Inno安装程序无法在x64上找到并执行ie4uinit.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆