Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Problem using SetSectionInInstType (http://forums.winamp.com/showthread.php?t=173838)

Steven Franklin 18th March 2004 13:30

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 13:33

Where did you add this command? Try the .onInit function.

Steven Franklin 18th March 2004 13:34

thats were im using it,

Function .onInit
!insertmacro SetSectionInInstType "${name}" "${INSTTYPE_1}"
!insertmacro SetSectionInInstType "${name}" "${INSTTYPE_2}"
!insertmacro
FunctionEnd

:-(

Joost Verburg 18th March 2004 15:52

Can you attach a script without file links that reproduces the problem?

Steven Franklin 18th March 2004 15:59

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 16:15

If you want to modify the installation type you will probably have to call SetCurInstType after the changes.

Steven Franklin 18th March 2004 16:21

thats got it thanks for you quick reply


All times are GMT. The time now is 04:26.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.