|
|
#1 |
|
Junior Member
Join Date: Dec 2011
Posts: 13
|
Good %time_of_day% to you gurus
I've decided to made an UI part of our installer more configurable (thus a bit more visually appealing) today and as part of that effort did some crazy experiments with sections to achieve an effect of flexibility.In short - the product is updated frequently and is complex so the sections part of a script is generated by an external program, besides there is a lot of variations of an installer so instead of making, say, 15 setup variations for each version released we decided to make sort of a "license" to exclude unnecessary "modules" from an installer. It works in a way: installer opens, usual stuff happens, then user prompted for a license file, which looks like <?xml version="1.0" encoding="utf-8" ?> <license> <module>ModuleOne</module> <module>AnotherModule</module> </license> it is read and put in a list, then user sees a section tree (which is being configured by license now) and so on. The machine-generated sections part looks like (simplified example): code: (I had an alternative earlier that made unnecessary modules unchecked, uncheckable and invisible but that produced a bad looking gray checkbox on a section group container, and irremovable "+" sign if all sections/modules of a section group were hidden. The solution above solves that) Uh, now, the question - is there a way to put that repeating part in a function somehow? The problem is with variable amount of instructions like File... I know it won't make any performance difference but I just want to make script look a bit less... messy
|
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,203
|
Look into macros to reduce repeated code.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|