Topic: For Bonk: how to have a components menu with the NSIS installer  (Read 9696 times)

0 Members and 1 Guest are viewing this topic.

Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
HOW TO SETUP THE NSIS INSTALLER'S COMPONENTS MENU

Hey bonk, here's how it's done.


1- You need to specify that you're going to have a components 'page'. Pages are set with some default values which you are probably currently using. You can override this and have your own custom pages come up.

So somewhere at the beginning of the installer script, before the first "Section" is defined.. before the license part, if any, also.

Code: [Select]
;--------------------------------
;Page license
Page components
Page directory
Page instfiles

UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------


Good. That will enforce a components page to come up. Read up 'Pages' in the docs if you want custom pages for yourself.


2- You may need to have some 'predefined' groups for checkboxes. In my case, I had only 1 predefined group. The other, 'custom', was added automatically. This came right after the Pages definition for me..

Code: [Select]
;COMPONENTS --------------------------------
  InstType "EAW Campaigns for OP"
;  InstType /NOCUSTOM
;  InstType /COMPONENTSONLYONCUSTOM
;------------------------------

This will make a default setting be available. "Custom" will be the other setting. You can have as many such 'predefined groups' as you like. I think you may need just 1. Please note the commented out options I am not using.


3- next, the trick. Have separate "Sections" for each component you want to install. NAME THEM.

ie:
Code: [Select]
Section "Base SFC:EAW Story Campaigns for OP"
(...)
SectionEnd

Section "EAW Sulu Bonus Missions"
(...)
SectionEnd


Each section will generate an entry within the components menu with the name given to the section.


4- Components on by default.

Within each section you want the component to be 'on' be default, do this:
Code: [Select]
Section "Base SFC:EAW Story Campaigns for OP"
SectionIn 1 RO


The "1" number defined here means the first InstType you defined way above. For that InstType, this thing's checked on. The "RO" means Read-Only. Unable to remove that check. Check the docs on "SectionIn" if you have other questions. ;)
 


Result: the above example should give you a components page where the default InstType is given. The first component should be 'on' and can't be changed. The second component did not have a defined "SectionIn" setting, so is not 'on' by default.


-- Luc
Code: [Select]


Author: OP+ Mod
Maintainer: Coopace
Author: Fests+ for OP
Creator: SFC-OP Mini Updater
Maintainer: SFC-EAW for OP Campaigns
Kitbash: SFC2 models

Offline NuclearWessels

  • Evil Dave
  • Serverkit Development Team
  • Lt. Commander
  • *
  • Posts: 1249
  • Scripter and general nuisance
    • NukeDocs
Re: For Bonk: how to have a components menu with the NSIS installer
« Reply #1 on: August 05, 2004, 08:35:41 pm »

Kewl!  (Searches calendar for a chance to play with it ;) )

dave

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: For Bonk: how to have a components menu with the NSIS installer
« Reply #2 on: August 05, 2004, 10:57:57 pm »
Thanks bunches FireSoul! I can try making different optional texture sets and the like. Lots of other possibilities too.

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: For Bonk: how to have a components menu with the NSIS installer
« Reply #3 on: February 19, 2005, 09:52:18 pm »
Looking at implementing this with the download plugin to provide an update option/function for campaign installers... and a generic campaign installer...

EDIT: the script for the current test of this idea is attached... using NSISdl and GenPat/VPatch... made some good progress with NSIS working on this...if anyone's interested -  let me know if you see any errors - glaring or subtle...

EDIT#2: attachment updated twice since original posting... modified my strategy to avoid the complexity and size of handling multiple patches in one file... :

Quote
all the patches will be relative to the first lists you sent me and those files will be included in the mod folder for patching purposes (disk use limits this strategy, ok for specs files anyway)

this will make it simplest for patch creation purposes and minimise the size of the patch file downloads by eliminating the need for multiple patch versions... as a side benefit I can determine the time of the last patch from the installed files in code I might use in later installers...

This way you cant miss an update.. the patch is always relative to the original file... perhaps there is a better way to go about it, but I figure this is a good start.  ;D

This will download and install the latest patch whether the client is up to date or not too... looking for a way for NSISdl to get the date of the posted patch file... might need to add to the plugin(?)

EDIT #3: Fixed installation directory detection in post-setup actions this morning (was unfinished...)... updated to NSIS 2.05 too... (sections and components fixes...)

going to keep looking at other patch strategies... and see if I can get it to check the patch file date before downloading...

EDIT#4: Fixed the annoying way I had the setup action selection working... feels natural now...

EDIT#5: Finally figured out the background image thing...

« Last Edit: February 22, 2005, 01:36:36 am by Bonk »