安装到 {sys} 的文件/DLL 未出现在 C:\Windows\system32 中

2024-04-16

我不知道为什么,但是当我尝试将文件从安装目录复制到system32,尽管在 Inno Setup 中显示安装成功,但它未能执行此操作。这是我的代码:

[Files]
; specifies what files will be included in the installation
Source: "{src}\..\elt.properties"; DestDir: "C:\elt"; Flags: ignoreversion
Source: "{src}\..\msvcr120.dll"; DestDir: {sys}; Flags: onlyifdoesntexist; 

我还想包含我的日志输出,因为我觉得文件的时间如此之晚很奇怪,我是在 2016 年 7 月 8 日上午 11 点左右写下这篇文章的

[11:49:36.526]   -- File entry --
[11:49:36.528]   Dest filename: C:\Windows\system32\msvcr120.dll
[11:49:36.529]   Time stamp of our file: 2013-10-04 23:58:24.000
[11:49:36.530]   Installing the file.
[11:49:36.566]   Successfully installed the file.

默认情况下{sys} (system32) 被重定向 https://learn.microsoft.com/en-us/windows/win32/winprog64/file-system-redirector to {win}\SysWOW64由 32 位应用程序的操作系统(例如 Inno Setup)执行。

如果您的 DLL(或者更确切地说应用程序)是 32 位的,您实际上需要重定向。这SysWOW64 is the System32相当于 Windows 64 位上的 Windows 32 位模拟。也可以看看Inno Setup 以 32 位模式安装到 SysWOW64 https://stackoverflow.com/q/29583694/850848.


如果您不希望重定向(因为您的 DLL/应用程序是 64 位),您可以使用以下命令覆盖重定向64bit flag https://jrsoftware.org/ishelp/index.php?topic=filessection:

Source: "..."; DestDir: "{sys}"; Flags: 64bit 

64bit: 导致{sys}用于映射到 64 位系统目录的常量Source and DestDir参数,...这是默认行为64位模式 https://jrsoftware.org/ishelp/index.php?topic=32vs64bitinstalls安装。


或启用64位模式 https://jrsoftware.org/ishelp/index.php?topic=32vs64bitinstalls安装。

[Setup]
ArchitecturesInstallIn64BitMode=x64 ia64

在 64 位模式下:

  • 返回的 System32 路径{sys}当在 [Dirs]、[Files]、[InstallDelete]、[Run]、[UninstallDelete] 和 [UninstallRun] 部分中使用时,常量默认映射到 64 位系统目录。这是因为安装/卸载暂时禁用WOW64 文件系统重定向 https://learn.microsoft.com/en-us/windows/win32/winprog64/file-system-redirector当这些部分访问文件/目录时。在其他地方,System32 和{sys}映射到 32 位系统目录,这在 32 位进程中是正常的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

安装到 {sys} 的文件/DLL 未出现在 C:\Windows\system32 中 的相关文章

随机推荐