Old 16th October 2005, 21:03   #1
safl
Junior Member
 
Join Date: Oct 2005
Posts: 13
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
safl is offline   Reply With Quote
Old 16th October 2005, 21:12   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Use LogicLib:
code:
!include LogicLib.nsh
# ...
${If} ${FileExists} $INSTDIR\sc_update
!insertmacro Remove_${SEC01}
${EndIf}


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 16th October 2005, 22:40   #3
safl
Junior Member
 
Join Date: Oct 2005
Posts: 13
Great works like a charm.
Is there any way to do something as simple for checking whether a section is check or not?
safl is offline   Reply With Quote
Old 17th October 2005, 08:25   #4
safl
Junior Member
 
Join Date: Oct 2005
Posts: 13
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 is offline   Reply With Quote
Old 17th October 2005, 09:09   #5
safl
Junior Member
 
Join Date: Oct 2005
Posts: 13
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
safl is offline   Reply With Quote
Old 17th October 2005, 13:14   #6
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Make sure SEC03 has the correct value in there. Add:
code:
!error ${SEC03}
If the output comes out as:
Quote:
!error: ${SEC03}
then it's not defined and you need to move that code below the section definition.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump