[英]getimagesize is not working on windows 7 but it is working on xp
[英]FileCopy of NSIS installer not working in Windows 7 but working in Windows XP
我正在使用NSIS安装程序的FileCopy将文件夹及其所有子文件从源复制到目标。 这适用于XP但不适用于Windows 7.当我在Windows 7上运行安装程序时,FileCopy对话框甚至不会出现,它只是被跳过。 但在Windows XP中,它正确显示“复制文件”对话框并成功。 有什么问题? 请帮忙。
!define FileCopy `!insertmacro FileCopy`
!macro FileCopy FilePath TargetDir
CreateDirectory `${TargetDir}`
CopyFiles `${FilePath}` `${TargetDir}`
!macroend
${FileCopy} 'C:\ACCBK\*.*' '$INSTDIR\ACCBK\'
要确保安装程序以管理员身份运行,请使用以下代码:
RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on)
!include LogicLib.nsh
Function .onInit
UserInfo::GetAccountType
pop $0
${If} $0 != "admin" ;Require admin rights on NT4+
MessageBox mb_iconstop "Administrator rights required!"
SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
Quit
${EndIf}
FunctionEnd
如果这是问题,这意味着它实际上在XP上也被破坏了(真的是任何版本的NT),你只是忘了测试非管理员。
CopyFiles只调用SHFileOperation,但XP和Vista之间可能会有一些重大变化当然......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.