- NSIS Discussion
- SectionSetFlags doesn't set the correct InstType mode
Archive: SectionSetFlags doesn't set the correct InstType mode
Konrad
3rd February 2003 21:48 UTC
SectionSetFlags doesn't set the correct InstType mode
If I call SectionSetFlags to select/deselect items from the MUI_CUSTOMFUNCTION_COMPONENTS_LEAVE function and then call Abort to stay at the components page, it'll set the correct selection, but won't set the correct install-type from the combo-box according to the new selection! Seems to be a bug...
kichik
4th February 2003 09:09 UTC
Does it change the install type in the combo-box to something wrong or just doesn't change it?
Konrad
4th February 2003 10:43 UTC
It just doesn't change the item in the combo-box!
kichik
4th February 2003 10:45 UTC
OK. Will be fixed.
glory_man
28th September 2004 12:24 UTC
In .onInit I read from registry installed sections & SectionSetFlags sets component page contents.
But combo-box shows always the first install type ("Full" for example) even if selected components are for "Custom" type or other.
kichik
28th September 2004 19:17 UTC
Use SetCurInstType <insttype number> for now.
glory_man
29th September 2004 15:09 UTC
On initalization I check if my software installed or not. If not - I use SetCurInstType 0 ("Full"). If yes - use script written by THRaSH from http://nsis.sourceforge.net/archive/...instances=0,64 to implement Add/Remove functionality in the installer. But now even if selected components are for "Custom" type, combo-box shows "Full".
Users can choose 5 from 10 components (for example) which do not approach under one of InstallTypes. What I shall have to do?
kichik
29th September 2004 15:16 UTC
If the first install type is "Full", you got what you asked for.
If you want to choose the "Custom" install type, use:
SetCurInstType ${NSIS_MAX_INST_TYPES}
glory_man
29th September 2004 15:37 UTC
Installer does not know what InstallType the user has chosen during the previous installation. It can read only structure of components.
Probably I cannot explain on Eglish.
kichik
29th September 2004 15:42 UTC
For that you can use GetCurInstType.
glory_man
29th September 2004 16:21 UTC
OK. I use GetCurInstType. Result is stored in variable. What can I do whith variable? Write it in registry; on initalization read it and SetCurInstType <variable>. But in this case it is manual work.
I thought that the NSIS itself can define IstallType on the chosen components. In fact when I on components page choose elements - IstallType define automatically. For this purpose I should define only what element where enters using SectionIn.
kichik
29th September 2004 16:24 UTC
It should figure out which install type to choose according to the selected components, but currently it doesn't. It will be fixed. For now, you should use GetCurInstType and SetCurInstType.
kichik
11th January 2005 16:54 UTC
The original issue is fixed in the latest CVS version.
glory_man
11th January 2005 17:10 UTC
The original issue is fixed in the latest CVS version.
There is no need to use GetCurInstType and SetCurInstType for refresh InstallType?
kichik
11th January 2005 17:12 UTC
No, it should no longer be needed to call GetCurInstType and SetCurInstType.
glory_man
11th January 2005 17:31 UTC
:) Cool!
When will the release be ready?
kichik
11th January 2005 17:33 UTC
Next month. You can download it from CVS, compile and test. If you don't want to mess with CVS, there's a snapshot which updates every couple of hours. It doesn't contain updated compiled binaries, just the new source code.
NHOCSUNG
13th January 2005 16:20 UTC
I got a question about CVS wut it does??
Glory_man if you set flags on Component Leave, wut would happened when you click back like Start menu back Directory Page to Component page .....
I set flags on first .OnInit.... i have to write regDWORD
into Regsitry... look like this
Section Section1
WriteRegDWORD "REG_KEY" "section1" 1
WriteRegDWORD "REG_KEY" "section2" 0
WriteRegDWORD "REG_KEY" "section3" 0
SectionEnd
Section Section2
WriteRegDWORD "REG_KEY" "section2" 1
SectionEnd
Section Section3
WriteRegDWORD "REG_KEY" "section3" 1
SectionEnd
Function .Oninit
ReadRegStr $0 "REG_KEY" "section1"
SectionSetFlags ${section1} $0
ReadRegStr $0 "REG_KEY" "section2"
SectionSetFlags ${section1} $0
ReadRegStr $0 "REG_KEY" "section3"
SectionSetFlags ${section1} $0
...
SetCurInstType...
Functionend
That work i think
glory_man
13th January 2005 17:18 UTC
if you set flags on Component Leave
If you look at THraSH's exapmle you will see that sections flags are set in .onInit-function -
!insertmacro SectionList "InitSection"
After components choosing and istallation (in -FinishComponents section) I write components status to registry. After that - finish page displayed where I could not press Back-button.
All work fine.
Generally speaking I correspond with THraSH. This example will be updated in the near future.