Problem with UnselectSection.
In the NSIS file I'm currently working on, I want it to check the registry to see if a certain file is installed on the computer or not, and if it is, I want the Section pertaining to that installed file to be visible in the Install Options window. But if it is not installed on the computer(registry key not found), I want that Section to not turn up in the Install Options window.
The problem I'm currently having(after trying several things), is that all the Sections are invisible in the Install Options window, either if the registry key is present or not.
So what am I doing wrong? Please fix the example script:
Function .onInit
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\File 1" "UninstallString"
StrCmp $0 "" +3
!insertmacro UnselectSection ${Sec00}
SectionSetText ${Sec00} ""
ReadRegStr $1 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\File 2" "UninstallString"
StrCmp $1 "" +3
!insertmacro UnselectSection ${Sec01}
SectionSetText ${Sec01} ""
FunctionEnd