Steven Franklin
18th March 2004 14:30 UTC
Problem using SetSectionInInstType
Hi,
Im trying to use SetSectionInInstType to allow the installer to select the options it "thinks" you should used depending on what it finds on the users system. This works fine except for when the page is first displayed, it is still in its default state.
Let me explain, i have a section that will be enabled/disabled in different types depending on files on the OS. By default this is unselected. If i set it to selected using SetSectionInInstType, then when the page is first displayed this option isnt selected (its still in the default). If i navigate through the options and return to the first it is now working correctly.
Any body any ideas
Joost Verburg
18th March 2004 14:33 UTC
Where did you add this command? Try the .onInit function.
Steven Franklin
18th March 2004 14:34 UTC
thats were im using it,
Function .onInit
!insertmacro SetSectionInInstType "${name}" "${INSTTYPE_1}"
!insertmacro SetSectionInInstType "${name}" "${INSTTYPE_2}"
!insertmacro
FunctionEnd
:-(
Joost Verburg
18th March 2004 16:52 UTC
Can you attach a script without file links that reproduces the problem?
Steven Franklin
18th March 2004 16:59 UTC
This is the simplest i can make the script that shows it
!include "MUI.nsh"
!include "Sections.nsh"
OutFile "C:\forum1.exe"
InstType "Type1"
InstType "Type2"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Name "Test setup"
Section "Section1" sec1
SectionEnd
Section "Section2" sec2
SectionEnd
Function .onInit
!insertmacro SetSectionInInstType "${sec1}" "${INSTTYPE_1}"
!insertmacro SetSectionInInstType "${sec2}" "${INSTTYPE_1}"
FunctionEnd
Joost Verburg
18th March 2004 17:15 UTC
If you want to modify the installation type you will probably have to call SetCurInstType after the changes.
Steven Franklin
18th March 2004 17:21 UTC
thats got it thanks for you quick reply