Archive: Program structure


Program structure
I want to write my installer so that it executes a section "main" and if the user gave the right input then it can bring up a page, and continue on. Well the compiler tells me I can't put a page in a section. Does that mean i need to break the sections apart and put the page in the middle? How should you structure this?


I don't know what the right user's input is, probably this interaction could be performed within a function before the main installation (extract files) begins, instead of a section.
Pages executed in the order they appear on the script, sections executed within InstFiles page, so it's obvious that the preferable usage of sections is to have them perform the main installation's activities, and use functions for all other.
Especially user's interaction activities, and dependences on when to display or skip a page, should be performed within page's custom functions pre show leave.


This function is the calling of a password dialog box. It is incase the user has a proxy or firewall or nat service which requires a login. My installation can detect such a requirement, but that code is in a section which reads an INI file. If it reads the INI file and finds case of a login needed, i want to popup such a box. If not, I don't want to use one at all.

And I have tried to call the page from a function, but of course the function is called from a section so that doesn't compile.


My installation can detect such a requirement, but that code is in a section which reads an INI file. If it reads the INI file and finds case of a login needed...
You'd need to perform this operation in a custom page's create_function, and in case login needed continue to show the page, else skip the page.

http://nsis.sourceforge.net/File:Auth.zip
http://nsis.sourceforge.net/PassDialog_plug-in
- simple auth plug-ins you can use in sections. Inetc/InetLoad also can popup IE auth. dialog if authorization request comes from proxy|server and login/apssword not encoded in URL.