我有一个使用HM编辑创建的安装程序。如果我的检查发现它未安装,我希望能够取消隐藏名为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}发布于 2012-09-10 18:13:46
要隐藏节,您必须将change its name转换为空字符串。
要选中/取消选中某个部分,应使用sections.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要取消隐藏,您可以给它一个非空的名称,但在默认情况下显示它,并在需要时隐藏它,通常工作较少……
https://stackoverflow.com/questions/12349173
复制相似问题