# define name of installer
OutFile "installer.exe"
SetOverwrite on
# define installation directory
InstallDir $DESKTOP
# For removing Start Menu shortcut in Windows 7
RequestExecutionLevel Admin
Section
;StrCpy $INSTDIR "c:\Windows\System32\"
SetOutPath $WINDIR\System32\
;MessageBox MB_OK $WINDIRSetOutPath $WINDIR\System32\
MessageBox MB_OK $SYSDIR
File "python27.dll"
SectionEnd这是我将python27.dll文件复制到windows/system32 32的脚本,当我运行这个文件时,它什么也不做,或者我正在做一些工作,感谢nsis的新成员
发布于 2017-03-02 17:12:37
在64位Windows上有两个system32目录,一个用于32位.DLLs,另一个用于64位.DLLs.64位程序(包括资源管理器)参见32位system32目录的真实名称;SysWOW64。真正的system32目录目录隐藏在32位程序中.
要始终安装到“真实的”/native system32文件夹,需要安装禁用重定向
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如果您的.DLL总是32位,那么您就不必做任何特别的事情:
RequestExecutionLevel Admin
Section
SetOutPath $SysDir
File "myfiles\file.dll" ; Install 32-bit file
SectionEnd在system32中安装您的文件已经有近20年的时间了,您确实应该使用$COMMONFILES或$PROGRAMFILES\<company name>\Shared Files。
想象一下发生了什么,如果两个不同的软件供应商都决定需要在system32中安装python27.dll?!如果您仍然坚持这样做,那么至少应该使用Library.nsh来安装文件,以便正确设置SharedDLLs。
https://stackoverflow.com/questions/42530367
复制相似问题