Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Conditionally show dialog


2 replies to this topic

BRY

BRY
  • Members
  • 44 posts

Posted 29 April 2002 - 09:37

Hi folks,

I have created a custom dialog in my Basic MSI project, but it should only be displayed if a certain feature is selected. The dialog only contains options for THAT feature.

I have included this in the UI sequence, but then it is always displayed.
I have also tried to create a custom action to do this, but when I insert that into the UI sequence, I cannot get it to be included in the "Install" sequence.

Is there any way I can show it ONLY if the associated feature has been chosen?

Any help appreciated,
Thanks...
Bryan Dickson
[br]Senior Software Engineer
[br]Fugro-UDI Limited

hteichert

hteichert
  • Members
  • 158 posts

Posted 29 April 2002 - 10:22

Including dialogs for only one special feature is no problem with the exception of a lot of work (it would be really simple if MS would have created a better way for the whole process of back and forward in the dialogs  :( ).

OK, let's start:
The actions taken when clicking a button (Next, Back, ..) are defined via Events.
Let's assume you already have dialogs A and B in your sequence and you want your dialog NEW in between these to dialogs. The feature that NEW depends on shall be "MyFeature".

Before adding dialog NEW:

Event for button Next on dialog A:
Event       Argument   Condition
NewDialog   B          1


Event for button Back on dialog B:
Event       Argument   Condition
NewDialog   A          1


After adding dialog NEW:

Events for button Next on dialog A:
Event       Argument   Condition
NewDialog   B          Not ((&MyFeature=1) or (&MyFeature>=3))
NewDialog   NEW        (&MyFeature=1) or (&MyFeature>=3)


Event for button Next on dialog NEW:
Event       Argument   Condition
NewDialog   B          1


Event for button Back on dialog NEW:
Event       Argument   Condition
NewDialog   A          1


Events for button Back on dialog B:
Event       Argument   Condition
NewDialog   A          Not ((&MyFeature=1) or (&MyFeature>=3))
NewDialog   NEW        (&MyFeature=1) or (&MyFeature>=3)


The &MyFeature returns the action taken on the feature (how will it be after setup ran); the compare values mean:
1: INSTALLSTATE_ADVERTISED
2: INSTALLSTATE_ABSENT
3: INSTALLSTATE_LOCAL
4: INSTALLSTATE_SOURCE

Further info about conditions may be found by searching for "Conditional Statement Syntax" in the windows installer help (msi.chm, also delivered with ISWi or Developer).
h.teichert-ott

BRY

BRY
  • Members
  • 44 posts

Posted 29 April 2002 - 15:36

Thanks a lot - this works perfectly!

Cheers,
Bryan Dickson
[br]Senior Software Engineer
[br]Fugro-UDI Limited