safl
16th October 2005 22:03 UTC
IfFileExists then macro
Hello,
I don't quite get the some of the basics :)
Is it not possible to do a:
IfFileExists "$INSTDIR\sc_update"
!insertmacro "Remove_${SEC01}"
It is in uninstall process, i just want to run remove macro if file is found.
Regards,
Simon
kichik
16th October 2005 22:12 UTC
Use LogicLib:
!include LogicLib.nsh
# ...
${If} ${FileExists} $INSTDIR\sc_update
!insertmacro Remove_${SEC01}
${EndIf}
safl
16th October 2005 23:40 UTC
Great works like a charm.
Is there any way to do something as simple for checking whether a section is check or not?
safl
17th October 2005 09:25 UTC
Sry for my horrible english.
What i want to do is execute 3 commands if a section is selected. i wan't to do this inside one section.
I've been scavaging the docs/forum but can't seem to find what i need.
I want to be able to something like:
IfSectionChecked {writeIniStr, writeIniStr, WriteIniStr}
safl
17th October 2005 10:09 UTC
I guess i should do some more reading..
I've tried with:
${If} ${SectionIsSelected} ${SEC03}
WriteIniStr DIR GROUP KEY VALUE
${EndIf}
But the value get's written regardless of the section is checked or not :(
kichik
17th October 2005 14:14 UTC
Make sure SEC03 has the correct value in there. Add:
!error ${SEC03}
If the output comes out as:
!error: ${SEC03}
then it's not defined and you need to move that code below the section definition.