|
|
#1 |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
Uncheck Section IfFileExists
How do I unckeck a Section with IfFileExists?
|
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Feb 2006
Location: Pomerania
Posts: 16
|
Look at macros in Section.nsh file, probably you should use UnSelectSection macro.
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
Shouldn't this work?
code: |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
anyone?
|
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Not quite.
The Section needs to be above the Function and the ReverseSection line needs to look like this: !insertmacro ReverseSection ${SecTest} -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Actually, you should use the UnselectSection macro.
-Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
I did as you said, but it doesn't work.
|
|
|
|
|
|
#8 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Your code is logically faulty. You can't unselect a section while it running!
You should call your CheckInstall in the Components page leave function. -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
leave function? I need to run it before the component page load otherwise... it makes no sense. Call function needs to be in a Selection to function I read.
|
|
|
|
|
|
#10 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Sorry, I meant Pre function.
!define MUI_PAGE_CUSTOMFUNCTION_PRE ComponentsPagePre !insertmacro MUI_PAGE_COMPONENTS Function ComponentsPagePre ... -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#11 |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
Still no luck. Now it looks like this...
code: |
|
|
|
|
|
#12 |
|
Major Dude
|
IfFileExists "$WINDIR\NOTEPAD.EXE" Skip
use quotes its safer.
hand by comm@nder21 ---------- WiKi pages:CreateInternetShortcut|Enhanced FindWindow|Parse CSV-Data|Open/Close CD-Drive|Installer without Icon|Vista application compatibility |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
Scripting an installer is hopeless, and looking at the number of threads in this forum I can see I'm not the only one haveing a hard time. I'll just have to use the zip2exe wizard.
|
|
|
|
|
|
#14 |
|
Major Dude
Join Date: Jun 2001
Posts: 1,173
|
You just have to have a little patience, really... if all you need to have is an auto-extracting .zip file.. sure, zip2exe or Winzip's functionalities are just dandy if not preferable.
If you want a more complex system, NSIS is the way to go. If you could indicate whether Comm@nder21's last comment helped at all or not, we could have a closer look - as far as I can see things should work fine though. |
|
|
|
|
|
#15 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Just to confirm, I'm assuming that you want to uncheck the Section if Notepad doesn't exist?
-Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#16 |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
If the file already exists, then uncheck.
|
|
|
|
|
|
#17 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
You should read the docs again on IfFileExists. You're skipping your code if the file exists.
-Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#18 | |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
Documentation.
Quote:
WTF is 0 +2?
|
|
|
|
|
|
|
#19 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
The jumps are explained earlier in the manual. But a better method is explained even earlier, in the tutorial.
code: NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#20 |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
Thanks. I managed to figure it out though.
![]() code: Though I still don't know what 0 +2 is. And I don't care. The ^tutorial only said yadi yadi yada to me.
|
|
|
|
|
|
#21 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
0 means don't jump anywhere, i.e. carry on onto the next instruction. +2 would mean jump over the proceding instruction onto the one after (i.e. 2 instructions from the current statement).
+1 would be the same as 0. -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#22 |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
Ok so if I understand you correct, this code would do the same thing as the code above?
code: EDIT: Tried but it didn't work. Unselect was always run. |
|
|
|
|
|
#23 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
No, because macros are not one instruction. Macros often contain more than one instruction.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#24 |
|
Junior Member
Join Date: Sep 2005
Posts: 35
|
Ok. Thank you.
|
|
|
|
|
|
#25 |
|
Member
Join Date: May 2007
Posts: 50
|
code: It had another methods? |
|
|
|
|
|
#26 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Look at IfFileExists again.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#27 |
|
Member
Join Date: May 2007
Posts: 50
|
oh.yes!!!thanks
i know how to do it. code: |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|