3

我在用:

; Set output path to the installation directory.
SetOutPath $INSTDIR\

SetOverwrite on

; Put file there
File "ACC\*.APP"

覆盖文件,但如果文件不能被覆盖,那么我希望安装程序退出,怎么做?

是否需要使用错误标志值?但是怎么做?

4

1 回答 1

5

如果覆盖模式设置为“尝试”且无法覆盖文件,或者如果覆盖模式设置为“开启”且无法覆盖文件且用户选择忽略,则 File 命令设置错误标志

!include LogicLib.nsh
Section
ClearErrors
SetOverwrite try
SetOutPath $INSTDIR
File "ACC\*.APP"
${If} ${Errors}
  Quit
${EndIf}
SectionEnd
于 2011-05-13T12:28:10.813 回答