Python 2.7 nsis无法将文件复制到system32

Python 2.7 nsis无法将文件复制到system32,python-2.7,nsis,Python 2.7,Nsis,这是我将python27.dll文件复制到windows/system32的脚本 当我运行这个文件时,它什么也不做,或者我正在做一些工作 提前感谢64位Windows上的nsis新增功能,一个用于32位.dll,另一个用于64位.dll。64位程序(包括Explorer)查看32位system32目录的真实名称;SysWOW64。真正的system32目录对32位程序是隐藏的 要始终安装到“real”/native system32文件夹,您需要: 如果.DLL始终为32位,则无需执行任何特殊操

这是我将python27.dll文件复制到windows/system32的脚本 当我运行这个文件时,它什么也不做,或者我正在做一些工作
提前感谢64位Windows上的nsis新增功能,一个用于32位.dll,另一个用于64位.dll。64位程序(包括Explorer)查看32位system32目录的真实名称;SysWOW64。真正的system32目录对32位程序是隐藏的

要始终安装到“real”/native system32文件夹,您需要:

如果.DLL始终为32位,则无需执行任何特殊操作:

RequestExecutionLevel Admin
!include x64.nsh

Section
SetOutPath $SysDir

${If} ${RunningX64}
${DisableX64FSRedirection}
File "myfiles\64\file.dll" ; Install 64-bit file on 64-bit Windows
${EnableX64FSRedirection}

${Else}

File "myfiles\32\file.dll" ; Install 32-bit file on 32-bit Windows

${EndIf}
SectionEnd
在system32中安装您的文件已经有近20年的历史了,您确实应该使用
$COMMONFILES
$PROGRAMFILES\\Shared files


想象一下,不同的软件供应商都决定在system32中安装python27.dll会发生什么?!如果您仍然坚持这样做,那么您至少应该使用来安装文件,以便正确设置
SharedDLS

我认为这不是一个好的解决方案,请尝试告知用户您应用程序的先决条件,并提示他安装适合您应用程序的python版本。您可以在安装程序中包含官方python安装程序,以便用户可以直接安装它,或者如果用户选中安装它,您可以启动它。不要忘了检查这个版本是否已经存在,或者是否有任何其他版本可以运行你的应用程序。希望这有帮助。如果必须遵循您的方法:
Section“nameofssection”SetOutPath$SYSDIR File“python27.dll”SectionEnd
OutFile“installer.exe”SetOverwrite on#define installation dir$DESKTOP#用于删除Windows 7 RequestExecutionLevel管理中的开始菜单快捷方式!包括MUI2.nsh!包括UAC.nsh#start default section section“nameofssection”SetOutPath$SYSDIR File“python27.dll”section end It nothing如果您能解释更多有关nsisIs 64位Windows的新信息,我如何在脚本中使用官方python安装?
RequestExecutionLevel Admin
!include x64.nsh

Section
SetOutPath $SysDir

${If} ${RunningX64}
${DisableX64FSRedirection}
File "myfiles\64\file.dll" ; Install 64-bit file on 64-bit Windows
${EnableX64FSRedirection}

${Else}

File "myfiles\32\file.dll" ; Install 32-bit file on 32-bit Windows

${EndIf}
SectionEnd
RequestExecutionLevel Admin

Section
SetOutPath $SysDir
File "myfiles\file.dll" ; Install 32-bit file
SectionEnd