Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Install some files only if an other section is activated (http://forums.winamp.com/showthread.php?t=258548)

Sp33dy G0nz4l3s 29th October 2006 21:16

Install some files only if an other section is activated
 
Hello, is it possible that some files in a section will be only installed if e.g. the section1 was activated?

Thank you
Marc

Afrow UK 29th October 2006 23:07

There are three options, the first being the base code, and the 2 others being macros which use the same code.

1.
code:
SectionGetFlags ${SEC01} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
StrCmp $R0 ${SF_SELECTED} 0 Skip

File ...
File ...

Skip:



2. Use SectionFlagIsSet macro from Sections.nsh with ${SF_SELECTED}

3. Use ${If} ${SectionIsSelected} with LogicLib.nsh

-Stu

Sp33dy G0nz4l3s 30th October 2006 09:50

Thank you Afrow UK :)

I've choosed the option 1 and it works.

Is it perhaps possible that the code checks if e.g. the Section1 and Section2 are activated?

Afrow UK 30th October 2006 09:55

Sure, the top bit would be like this:
code:
SectionGetFlags ${SEC01} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
StrCmp $R0 ${SF_SELECTED} 0 Skip
SectionGetFlags ${SEC02} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
StrCmp $R0 ${SF_SELECTED} 0 Skip



-Stu


All times are GMT. The time now is 04:17.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.