Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
482 views
in Technique[技术] by (71.8m points)

inno setup - File/DLL installed to {sys} does not appear in C:Windowssystem32

I don't know why, but when I try to copy a file from my install directory to system32, it fails to do so although it reads as successfully installing in Inno Setup. Here is my code:

[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; 

I also wanted to include my log output as I thought it was strange that the time was so off for the file, I am writing this around 11 am on July 8 2016

[11:49:36.526]   -- File entry --
[11:49:36.528]   Dest filename: C:Windowssystem32msvcr120.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.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

By default the {sys} (system32) is redirected to {win}SysWOW64 by the OS for 32-bit applications (like Inno Setup).

If your DLL is 32-bit, you actually want the redirection. The SysWOW64 is the System32 equivalent for Windows 32-bit emulation on Windows 64-bit. See also Inno Setup install to SysWOW64 in 32Bit mode.


If you do not want the redirection (because your DLL is 64-bit), you can override the redirect using the 64bit flag:

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

64bit: Causes the {sys} constant to map to the 64-bit System directory when used in the Source and DestDir parameters, .... This is the default behavior in a 64-bit mode install.


Or enable 64-bit mode install.

[Setup]
ArchitecturesInstallIn64BitMode=x64 ia64

In 64-bit mode:

  • The System32 path returned by the {sys} constant maps to the 64-bit System directory by default when used in the [Dirs], [Files], [InstallDelete], [Run], [UninstallDelete], and [UninstallRun] sections. This is because Setup/Uninstall temporarily disables WOW64 file system redirection when files/directories are accessed by those sections. Elsewhere, System32 and {sys} map to the 32-bit System directory, as is normal in a 32-bit process.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...