![](/img/trans.png)
[英]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.