作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 IfFileExists 函数,但我认为它只包含跳转后的第一行。我怎样才能做一些类似于 C 的事情,比如 {..../.../....}?!
IfFileExists "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe" StartUpExists PastStartUpExists
StartUpExists:
StrCpy $Text "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe"
PastStartUpExists:
nsDialogs::Create 1018
Pop $Dialog
nsDialogs::SelectFileDialog open "$PROGRAMFILES\InduSoft Web Studio v7.0\Bin\RunStartUp.exe" "*.exe"
Pop $Text
${NSD_CreateText} 0 13u 100% -13u $Text
Pop $Text
${NSD_CreateText} 0
${NSD_GetText} $Text $0
CreateShortCut "$SMPROGRAMS\Advanlab\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
CreateShortCut "$SMPROGRAMS\Advanlab\Uninstall.lnk" "$INSTDIR\uninst.exe"
CreateShortCut "$SMPROGRAMS\Advanlab\Advanlab.lnk" "$0"
CreateShortCut "$DESKTOP\Advanlab.lnk" "$0"
最佳答案
IfFileExists
的语法是
IfFileExists file_to_check offset_or_label_if_exists [offset_or_label_if_not_exists]
IfFileExists "$INSTDIR\file.txt" file_found file_not_found
file_found:
StrCpy $0 "the file was found"
goto end_of_test ;<== important for not continuing on the else branch
file_not_found:
StrCpy $0 "the file was NOT found"
end_of_test:
IfFileExists
之后您可以使用 0 偏移量而不是无用的标签:
IfFileExists "$INSTDIR\file.txt" 0 file_not_found
StrCpy $0 "the file was found"
goto end_of_test ;<== important for not continuing on the else branch
file_not_found:
StrCpy $0 "the file was NOT found"
end_of_test:
关于NSIS IfFileExists - 不止一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12423137/
我是一名优秀的程序员,十分优秀!