.:: CODE SNIPPET ::.

"Your time is limited, so don't waste it living someone else's life"

Simply control selected components in NSIS component page


This is really a simple way to control the constraint between component in the NSIS component page

Function .onSelChange
	Pop $0
	${Switch} $0
		${Case} 0
			SectionSetFlags ${SEC_GUI} 0
			SectionSetFlags ${SEC_CONS} 1
			${Break}
		${Case} 1
			SectionSetFlags ${SEC_DS} 0
			SectionSetFlags ${SEC_SIM_MACH4} 0
			SectionSetFlags ${SEC_SIM_PM1} 0
			SectionSetFlags ${SEC_SIM_PM2} 0
			SectionSetFlags ${SEC_SIM_PM3} 0
          
			SectionSetFlags ${SEC_MACH4} 0
			SectionSetFlags ${SEC_PM1} 0
			SectionSetFlags ${SEC_PM2} 0
			SectionSetFlags ${SEC_PM3} 0
			SectionSetFlags ${SEC_CONS} 0
			${Break}
		${Case} 2
			SectionSetFlags ${SEC_DS} 1
			SectionSetFlags ${SEC_GUI} 0
			
			SectionSetFlags ${SEC_MACH4} 0
			SectionSetFlags ${SEC_PM1} 0
			SectionSetFlags ${SEC_PM2} 0
			SectionSetFlags ${SEC_PM3} 0
			${Break}
		${Case} 3
			SectionSetFlags ${SEC_DS} 1
			SectionSetFlags ${SEC_GUI} 0
			
			SectionSetFlags ${SEC_MACH4} 0
			SectionSetFlags ${SEC_PM1} 0
			SectionSetFlags ${SEC_PM2} 0
			SectionSetFlags ${SEC_PM3} 0
			${Break}
		${Case} 4
			SectionSetFlags ${SEC_DS} 1
			SectionSetFlags ${SEC_GUI} 0
			
			SectionSetFlags ${SEC_MACH4} 0
			SectionSetFlags ${SEC_PM1} 0
			SectionSetFlags ${SEC_PM2} 0
			SectionSetFlags ${SEC_PM3} 0
			${Break}
		${Case} 5
		${Case} 6
		${Case} 7
		${Case} 8
			SectionSetFlags ${SEC_DS} 1
			SectionSetFlags ${SEC_GUI} 0
			SectionSetFlags ${SEC_CONS} 0
			${Break}
		${Case} 9
		${Case} 10
		${Case} 11
		${Case} 12
		${Case} 13
		${Case} 14
			SectionSetFlags ${SEC_DS} 1
			SectionSetFlags ${SEC_GUI} 0
			${Break}
	${EndSwitch}
FunctionEnd
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: