Archive: Preselecting InstType and/or Sections (Again)


Preselecting InstType and/or Sections (Again)
Ok, I may not be the sharpest knife in the drawer, but after search for well over an hour in the forum, I still can't find my answer, here goes.

How can I save the InstType of the last install so that I can preselect that InstType the next time the user is upgrading?

Additionally, how can I do the same with the Setions?

I know I can write to the reg or ini, but I couldn't find a complete example that says:

- read registry
- if value, preselect insttype
- if insttype change, write registry
- install

FYI, I've already got code in the .onInit set flags for a Silent install.

Any help would be very much so appreciated.

Thanks,
Mel


First thing first, you can't select an installation type, you can only select sections and by that force NSIS to use the desired installation type.

If you don't have custom type then you can simply add a hidden section for each installation type that will set the registry key. If you do have custom type it will be a bit trickier. For that you have to either write 1 to an INI or the registry for each section that was selected inside the section itself or iterate on all of the sections using SectionGetFlags and prepering a string of zeros and ones. When starting the installer next time you can set the section flags according to this list.