Skip to content
⌘ NSIS Forum Archive

I want disable a section as standard

11 posts

stp#

I want disable a section as standard

I want disable a section as a default.
But the user should be able to enable the section.

How can I switch off the section as a default ??
Thanks
Peter
Joost Verburg#
!include "Sections.nsh"

Section "bla" SecName

SectionEnd

Function .onInit

Push $R0

SectionGetFlags ${SecName} $R0
IntOp $R0 $R0 - ${SF_SELECTED}
SectionSetFlags ${SecName} $R0

Pop $R0

FunctionEnd
stp#
The sections is always select with a checkbox !

The changes does not work !!
I dont know why !

Peter
stp#
xx

Sorry , but the I have problems with the attach !
May be the firewall !!



Section "Additional COLDSAW-Software" Section3 /Unchecked
WriteINIStr "$INSTDIR\config.ini" "modes" "picos_type" 2

StrCpy $8 'R2'
DELETE d:\DATABASE\${CUSTOMER}\MIDISSRV.INI
RENAME d:\DATABASE\${CUSTOMER}\MIDISSRV2.INI d:\DATABASE\${CUSTOMER}\MIDISSRV.INI
SectionEnd


Section "Additional COOLEX-Software" Section4 /Unchecked
WriteINIStr "$INSTDIR\config.ini" "modes" "picos_type" 3
StrCpy $8 'R11'
DELETE d:\DATABASE\${CUSTOMER}\MIDISSRV.INI
RENAME d:\DATABASE\${CUSTOMER}\MIDISSRV3.INI d:\DATABASE\${CUSTOMER}\MIDISSRV.INI
SectionEnd


; ******* 5 ***************************************************************************************


Function .onInit
Push $R0
SectionGetFlags ${Section3} $R0
IntOp $R0 $R0 - ${SF_SELECTED}
SectionSetFlags ${Section3} $R0
Pop $R0

Push $R0
SectionGetFlags ${Section4} $R0
IntOp $R0 $R0 - ${SF_SELECTED}
SectionSetFlags ${Section4} $R0
Pop $R0
Joost Verburg#edited
Try this:

!include "Sections.nsh"


Section "Additional COLDSAW-Software" Section3

WriteINIStr "$INSTDIR\config.ini" "modes" "picos_type" 2

StrCpy $8 'R2'
DELETE d:\DATABASE\${CUSTOMER}\MIDISSRV.INI
RENAME d:\DATABASE\${CUSTOMER}\MIDISSRV2.INI d:\DATABASE\${CUSTOMER}\MIDISSRV.INI

SectionEnd


Section "Additional COOLEX-Software" Section4

WriteINIStr "$INSTDIR\config.ini" "modes" "picos_type" 3
StrCpy $8 'R11'
DELETE d:\DATABASE\${CUSTOMER}\MIDISSRV.INI
RENAME d:\DATABASE\${CUSTOMER}\MIDISSRV3.INI d:\DATABASE\${CUSTOMER}\MIDISSRV.INI

SectionEnd


Function .onInit

Push $R0

SectionGetFlags ${Section3} $R0
IntOp $R0 $R0 - ${SF_SELECTED}
SectionSetFlags ${Section3} $R0

SectionGetFlags ${Section4} $R0
IntOp $R0 $R0 - ${SF_SELECTED}
SectionSetFlags ${Section4} $R0

Pop $R0

FunctionEnd