Newbie: Needs Help With Component Sections 1 over 4
Newbie: This it my first week 1/2 using Nullsoft and i have hit a brickwall
I need help with the Components Page Sections. I have 4 Sections each one is unique, but only 1 Section can installed, if two or more Sections are installed the last on that was writen to the haard drive is used. But that one may not be the one that is needed. So basically I need the Sections to swich off with only one Section or none being selected in the Components Page of my installer.
One way i know of to do this is like this. (But it only covers 2 Sections.) And I need it to cover 4 Sections. Please Help
;-----------------------
Function .onSelChange
Push $0
StrCmp $R9 ${sec1}
SectionGetFlags ${sec1} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 done done
StrCpy $R9 ${sec1}
SectionGetFlags ${sec2} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${sec2} $0
Goto done
check_sec1:
SectionGetFlags ${sec2} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 done done
StrCpy $R9 ${sec2}
SectionGetFlags ${sec1} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${sec1} $0
done:
FunctionEnd
;-----------------------
An summery of what I have tryed to do so far is hopefully at the bottum of the page in .nsi format [Note] The .nsi file was Compiled with Venis IX.
Here is Summery.nsi
;----------------------
;AUTHOR:PCEnhancer
;REQUIRES:Windows 2000/XP
BrandingText "Cool v1.2"
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;General
;Name and file
!define APPNAME "Cool"
!define APPNAMEANDVERSION "Cool v1.2"
Name "${APPNAMEANDVERSION}"
OutFile "Cool Need Help.exe"
;Default installation folder
InstallDir "$DESKTOP\Cool"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
;--------------------------------
;Variables
Var MUI_TEMP
;--------------------------------
;Interface Configuration
!define MUI_BGCOLOR 000000
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_COMPONENTSPAGE_TEXT_COMPLIST ""
!define MUI_COMPONENTSPAGE_TEXT_INSTTYPE ""
;--------------------------------
;Pages
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
;!insertmacro MUI_PAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
;Set Section properties
SetOverwrite on
ShowInstDetails "show"
;--------------------------------
SubSection /e "Install Cool Cursors [ACTIVE]" "Hello"
Section "Install Cursors as [ACTIVE]" sec1
SectionEnd
;--------------------------------
Section "Install Cursors Burnt as [ACTIVE]" sec2
;Wright Data "Cool Cursors" to Registry
SectionEnd
;--------------------------------
Section "Install Cursors Solid as [ACTIVE]" sec3
;Wright Data "Cool Cursors" to Registry
SectionEnd
;--------------------------------
Section "Install Cursors Burnt Solid as [ACTIVE]" sec4
SectionEnd
SubSectionEnd
;-------------------------------------------------------
;HERE IS THE PROBLEM!!!!!!!!
;--------------------------------------
Function .onInit
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK "The installer is already running."
Abort
;------------------------
Push $0
StrCpy $R9 ${sec1} ; Gotta remember which section we are at now...
SectionGetFlags ${sec1} $0
IntOp $0 $0 | ${SF_SELECTED}
SectionSetFlags ${sec1} $0
SectionGetFlags ${sec2} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${sec2} $0
SectionGetFlags ${sec3} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${sec3} $0
SectionGetFlags ${sec4} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${sec4} $0
Pop $0
FunctionEnd
;I Need Help With This Right Here.
;-------------------------------------------
Function .onSelChange
Push $0
StrCmp $R9 ${sec1} check_sec1
SectionGetFlags ${sec1} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 done done
StrCpy $R9 ${sec1}
SectionGetFlags ${sec2} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${sec2} $0
Goto done
check_sec1:
SectionGetFlags ${sec2} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 done done
StrCpy $R9 ${sec2}
SectionGetFlags ${sec1} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${sec1} $0
Goto done
;done:
;-------------------------------------------
Pop $0
Push $0
StrCmp $R9 ${sec3} check_sec3
SectionGetFlags ${sec3} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 done done
StrCpy $R9 ${sec3}
SectionGetFlags ${sec4} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${sec4} $0
Goto done
check_sec3:
SectionGetFlags ${sec4} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 done done
StrCpy $R9 ${sec4}
SectionGetFlags ${sec3} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${sec3} $0
done:
Pop $0
FunctionEnd