Change or Add new Script Location
Please let our ADS show!
This sites offers only FREE software and it's supported by a few advertisement boxes (no intrusive popups).
Please:
- disable your AdBlocker by adding CoolSoft website to whitelist
- give the proper cookie consent
- enable JavaScript for this website
This seconds wait is to let you update your browser configuration...
Ok, I've done the required changes... now show me your content!- nickdollahz
- Posts: 5
- Joined: 3 Ott 2018 - 15:39
- coolsoft
- Posts: 1978
- Joined: 25 Mar 2012 - 01:19
I think that the show/skip logic for a page should stay outside the page itself, i.e. in your main script.
The page script should contain everything related to the page itself but it's the caller that's in charge of deciding if that page should be include in setup flow or not.
Beware to not mix roles: the if clause that decides if the page should be shown should be outside the object itself; of course a page should be able to decide which of its controls must be visible but should not decide of its whole existance.
If you still want to go that way you could use this workaround:
- set GenerateShowFunction property to False (this will not generate the default fnc_xxx_Show function)
- create your own fnc_xxx_Show function (with the Abort logic) by using the HeaderCustomScript property
- coolsoft
- Posts: 1978
- Joined: 25 Mar 2012 - 01:19
PS: the GenerateShowFunction dialog property will be available in next 1.4.3 version.
UPDATE: version 1.4.3 released.
- nickdollahz
- Posts: 5
- Joined: 3 Ott 2018 - 15:39
That workaround is working great. Saving a ton of time not having to redo that everytime I adjust the page.
Thanks for that!
I am curious though if there is a better way to do it.
I think what you are referring to would be to either use Page or PageEx to specify a different function that will determine if the page will display or not.
Page fnc_CustomPage_Pre fncCustomPage_Leave ... Function fnc_CustomPage_Pre ;Skip Page if first InstallType GetCurInstType $1 ${If} $1 == 0 Abort ${EndIf} Call fnc_CustomPage_Show FunctionEnd or PageEx custom fnc_CustomPage_Pre fnc_CustomPage_Show fnc_CustomPage_Leave PageExEnd Function fnc_CustomPage_Pre ;Skip Page if first InstallType GetCurInstType $1 ${If} $1 == 0 Abort ${EndIf} FunctionEnd
- coolsoft
- Posts: 1978
- Joined: 25 Mar 2012 - 01:19
Yes, sort of.
And you should keep your show/abort logic outside the dialog files.
Navigazione
Login
Clicca qui per supportare il mio lavoro con PayPal
oppure offrimi un caffè