0

我有一个使用 HM NIS Edit 创建的安装程序。如果我的检查发现它没有安装,我希望能够取消隐藏名为 VDF 的部分。并在安装时隐藏它,也不执行该嵌入安装程序。

我希望我说清楚了。

这是功能:

Function .onInit #Check's wether the installer is in your installation folder. onInit means that it checks for that even before the installer is initialized.
  ${If} ${FileExists} "$EXEDIR\VDF2012-17.0.22.8.Client.exe"
    MessageBox MB_OK "VDF found"

  ${Else}
    MessageBox MB_OK "The Visual DataFlex setup was not found in the installation folder. However the installation of $(^Name) will still continue."

  ${EndIf}
4

1 回答 1

1

要隐藏某个部分,您必须将其名称更改为空字符串。

要选中/取消选中某个部分,您应该使用 section.nsh 中的辅助

!include sections.nsh

Section "VDF" SID_VDF
#Install VDF
SectionEnd

Function .onInit
${IfNot} ${FileExists} "$EXEDIR\VDF2012-17.0.22.8.Client.exe"
  !insertmacro UnselectSection ${SID_VDF}
  SectionSetText ${SID_VDF} ""
${EndIf}
FunctionEnd

要取消隐藏,您可以给它一个非空名称,但默认情况下显示它并在需要时隐藏它通常会减少工作量......

于 2012-09-10T10:13:46.097 回答