我不知道为什么,但是当我尝试将文件从我的安装目录复制到system32
时,虽然它在Inno Setup中读作成功安装,但却无法这样做。这是我的代码:
[Files]
; specifies what files will be included in the installation
Source: "{src}\..\elt.properties"; DestDir: "C:\elt"; Flags: ignoreversion; BeforeInstall: SetProgressMax(10);
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.
答案 0 :(得分:4)
默认情况下,操作系统为32位应用程序(如Inno Setup)提供{sys}
(system32
)is redirected到{win}\SysWOW64
。
如果你的DLL是32位,你实际上想要重定向。 SysWOW64
是Windows 64位上Windows 32位仿真的System32
等效项。另请参阅Inno Setup install to SysWOW64 in 32Bit mode。
如果您不想重定向(因为您的DLL是64位),您可以使用64bit
flag覆盖重定向:
Source: "..."; DestDir: "{sys}"; Flags: 64bit
64位:在
{sys}
和Source
参数中使用时,导致DestDir
常量映射到64位系统目录,....这是64-bit mode安装中的默认行为。
或启用64-bit mode安装。
[Setup]
ArchitecturesInstallIn64BitMode=x64 ia64
在64位模式下:
- 默认情况下,
{sys}
常量返回的System32路径在[Dirs],[Files],[InstallDelete],[Run],[UninstallDelete]中使用时会映射到64位系统目录, [UninstallRun]部分。这是因为当这些部分访问文件/目录时,安装/卸载会暂时禁用WOW64 file system redirection。在其他地方,System32和{sys}
映射到32位系统目录,这在32位进程中是正常的。