Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 23rd April 2002, 12:24   #1
Schultz
Member
 
Join Date: Oct 2001
Posts: 71
SectionSetFlags bits

I read the documentation and tried playing around with it.. but i am failing to grasps how to actually modify the bits to Select/Deselect make Read-only / Non-read only. Could anyone explain to me how these work exactly? thanks..
Schultz is offline   Reply With Quote
Old 23rd April 2002, 18:35   #2
justin
Moderator Alumni
 
Join Date: Apr 2000
Location: USA
Posts: 315
This will set the second section as currently enabled:
PHP Code:
  SectionGetFlags 1 $R0
  IntOp $R0 $R0 
0x80000000
  SectionSetFlags 1 $R0 
This will set the second section as always disabled:
PHP Code:
  SectionSetFlags 1 0x40000000 
This will set the second section as always enabled:
PHP Code:
  SectionSetFlags 1 0xC0000000 
This will set the second section as enabled in the first 2 install types, and currently enabled:
PHP Code:
  SectionSetFlags 1 0x80000003 

Etc...

-Justin
justin is offline   Reply With Quote
Old 24th April 2002, 14:25   #3
Schultz
Member
 
Join Date: Oct 2001
Posts: 71
Ok now i am not sure about how to test and see if a section is enabled or not.. would you use the AND operade like
SectionGetFlags 1 $R0
IntOp $R1 $R0 & 0x80000000
and then do a test like this to see if its valid or not..? or am i way off bases and totaly failing to understand how it works..
Schultz is offline   Reply With Quote
Old 24th April 2002, 19:42   #4
justin
Moderator Alumni
 
Join Date: Apr 2000
Location: USA
Posts: 315
Yep you got it ...
IntOp $R1 $R0 & 0x80000000
IntCmp $R1 0 SectionNotEnabled
DetailPrint "Section is enabled"
SectionNotEnabled:

-Justin
justin is offline   Reply With Quote
Old 25th April 2002, 10:24   #5
Schultz
Member
 
Join Date: Oct 2001
Posts: 71
Justin,
I think i am getting it.. I am using this as a test script.. would this be the best way to work with it.? I am using 0x00000000 to make a Selection Disabled correct method right? here is the script
PHP Code:
Name "test"
OutFile "test.exe"
Caption "NSIS Testing Script"
ShowInstDetails show
ComponentText 
"Testing"

Section "crap"
   
GetDLLVersion $SYSDIRDVobSub.ax $$4
   GetDLLVersion 
"C:\Windows\System\DVobSub.ax" $$2
   DetailPrint 
"$3 $4, $1 $2"
   
IntOp $$& $4
   IntOp 
$$| $4
   DetailPrint 
"$0, $5"
   
IntOp $$& $2
   IntOp 
$$| $2
   DetailPrint 
"$0, $5"
   
SectionEnd

Section 
"VobSub for DirectShow"
DetailPrint "Blah Blah" 
SectionEnd

Section 
"Section 3"
   
DetailPrint "Blah Blah 2"
SectionEnd

Section 
"SubMux"
   
DetailPrint "Blah Blah 3"
SectionEnd

Function .onSelChange
   
;This does the check to see if the user (de)selected the SubMux and skips rest if not enabled
   SectionGetFlags 3 $R1
   IntOp $R2 $R1 
0x80000000
   IntCmp $R2 0 Done

   SectionGetFlags 1 $R1
   IntOp $R2 $R1 
0x80000000
   IntCmp $R2 0 NotEnabled
      Goto Done
   NotEnabled
:
      
MessageBox MB_YESNO "Submux needs VobSub for DirectShow installed to function properly would you like to also install VobSub for DirectShow?" IDNO DontInstall
         SectionSetFlags 1 0x80000000
         Goto Done
      DontInstall
:
         
SectionSetFlags 3 0x0000000
   Done
:
FunctionEnd 
thanks for all this added stuff in this release.. Love it now you can make dependances and change stuff at runtime.. ;o) Keep up the great work.
Schultz is offline   Reply With Quote
Reply
Go Back   Winamp 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