如何使用Inno Setup将.sys文件安装到c:\ windows \ system32 \ drivers中? [英] How to install .sys file into c:\windows\system32\drivers with Inno Setup?

查看:491
本文介绍了如何使用Inno Setup将.sys文件安装到c:\ windows \ system32 \ drivers中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试简单地将.sys文件安装到

I try to simply install a .sys file into

Source: "C:\myproject\driver.sys"; DestDir: "{win}\system32\drivers"; 

运行设置后,我的driver.sys始终安装在

Once the setup ran, my driver.sys is always installed into

C:\Windows\SysWOW64\drivers

知道为什么吗?

推荐答案

默认情况下,{win}\system32 您可以使用 64bit标志来覆盖它:

You can override this using 64bit flag:

Source: "C:\myproject\driver.sys"; DestDir: "{win}\system32\drivers"; Flags: 64bit 

64位:当在SourceDestDir参数中使用...时,导致{sys}常量映射到64位系统目录,....是这的默认行为. 64位模式安装.

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.


或启用 64位模式安装.


Or enable 64-bit mode install.

[Setup]
ArchitecturesInstallIn64BitMode=x64 ia64

在64位模式下:

In 64-bit mode:

  • 在[目录],[文件],[InstallDelete],[Run],[UninstallDelete]和[UninstallRun]中使用时,由{sys}常量返回的System32路径默认情况下映射到64位系统目录. ]部分.这是因为安装/卸载会暂时禁用 WOW64文件系统重定向当这些部分访问文件/目录时.在其他地方,System32和{sys}映射到32位系统目录,就像在32位进程中一样.
  • 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.


正如上面提到的所有参考文献所述,您最好使用 {sys}常量代替{win}\system32:


As mentioned is all the references above, you should better use {sys} constant instead of {win}\system32:

Source: "C:\myproject\driver.sys"; DestDir: "{sys}\drivers"

{sys} 系统的System32目录.

{sys} The system's System32 directory.

例如:如果在条目上使用了{sys}\CTL3D32.DLL,并且系统的Windows系统目录为"C:\ WINDOWS \ SYSTEM",则安装或卸载会将其转换为"C:\ WINDOWS \ SYSTEM \ CTL3D32.DLL"

For example: If you used {sys}\CTL3D32.DLL on an entry and the system's Windows System directory is "C:\WINDOWS\SYSTEM", Setup or Uninstall will translate it to "C:\WINDOWS\SYSTEM\CTL3D32.DLL".

在64位Windows上,默认情况下,此常量返回的System32路径映射到包含32位系统文件的目录,就像在32位Windows上一样. (可以通过启用 64位模式来覆盖.)

On 64-bit Windows, by default, the System32 path returned by this constant maps to the directory containing 32-bit system files, just like on 32-bit Windows. (This can be overridden by enabling 64-bit mode.)

这篇关于如何使用Inno Setup将.sys文件安装到c:\ windows \ system32 \ drivers中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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