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

Feature Conditions


8 replies to this topic

Gareth at Serif

Gareth at Serif
  • Full Members
  • 85 posts

Posted 08 February 2005 - 11:53

Hello chaps,

I'm currently building an installation for a video editing package and at one point in the install the user is given two radio buttons to choose NTSC or PAL for their default video format. This sets a variable called SETUP_LANGUAGE to either NTSC or PAL as you might expect.

How can I use this variable in the Feature Condition Builder in DevStudio 9 to select both different components to be installed and different registry entries depending on that choice?

I have tried the obvious things such as 'SETUP_LANGUAGE="NTSC"' and similar, but clicking 'OK' gives a runtime error... Line: 15, Error: Object required: 'infoContent'.

Any assistance would be greatly appreciated.

Regards,
Gareth

Gareth at Serif

Gareth at Serif
  • Full Members
  • 85 posts

Posted 08 February 2005 - 14:49

I've moved on a bit from there - I now have a condition with the percent character '%SETUP_LANGUAGE="NTSC"' but while the error message no longer occurs the contents of the feature are not being installed.

Can anyone shed some light onto what I might be doing wrong?

Regards,
Gareth

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 09 February 2005 - 14:56

I'm a bit confused. Do you have this code in a script custom action? If yes, in which scripting language? And where do you call the custom action?

Gareth at Serif

Gareth at Serif
  • Full Members
  • 85 posts

Posted 10 February 2005 - 11:32

Thanks for your reply - the condition was just part of the component, but the variable referenced in the condition was set by the localisation dialog.

I have resolved the matter with a custom action, which I imagine would have been your next recommendation judging by your question.

One thing I found interesting that my first attempt was to set the NTSC and PAL features to not install and then use the custom action to set the appropriate one to install, but this never worked no matter how I tried it. As soon as I set the features to install by default and then disabled the appropriate one in the custom action (exactly opposite to the original attempt) and it worked perfectly. I can't rightly see the difference between the two solutions though... ah, well. So long as it works I'm happy, just curious why.

Regards,
Gareth

Gareth at Serif

Gareth at Serif
  • Full Members
  • 85 posts

Posted 10 February 2005 - 16:26

This does create a whole new problem though... having set a feature for the user to see called "Video" and a pair of hidden features called "NTSC" and "PAL" that are installed as required. By this method the feature appears to have an install size of 0kb, which is somewhat misleading to the user and far from ideal...

I'd love to know of a way to either link features so that their size is added up together or some kind of script command to manually add feature costs together... for example, getfeaturecost of NTSC and setfeaturecost of Video to match, but the later command doesn't seem to exist unless I've missed something.

Your thoughts would be most valuable,
Gareth

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 10 February 2005 - 17:03

My question was related to the error message that includes a line number. Therefore you must be using some script (msi is a relational database and doesn't have line numbers)

The feature size should say something like "This feature requires 0 KB. It has subfeatures that require X KB)".

Feature conditions are evaluated during the CostFinalize standard action, which happens before the dialogs are displayed. But you can use AddLocal and Remove control events to select and deselect features when user clicks the button on the language selection dialog.

BTW why are you using SETUP_LANGUAGE to store NTSC or PAL? Wouldn't VIDEO_FORMAT be better variable name?

Gareth at Serif

Gareth at Serif
  • Full Members
  • 85 posts

Posted 10 February 2005 - 19:13

The line number was on an error dialog in DevStudio 9, not in my install - it came up as soon as I clicked on any Condition property that had conditions within (and when I set conditions). If I had a feature, for example, with no conditions then I could select the property just fine. It was a strange effect, but no longer effects me due to using my own script as per your advise for the conditional install of these two features.

The feature size information simply says "This feature requires 0KB" and says nothing of subfeatures (there aren't any) and as far as the user is concerned should not be aware of any either, but if the 'Video' feature is selected to be installed it'd be ideal if the information updated to say "This feature requires 837Mb" instead of continuing to say 0KB. I realise it says 0KB because there are no files in the feature and would like to make that calculation manually based on the cost of the NTSC and PAL features being hidden from the user in a custom action.

Ideally all I want to do is run a custom action attached to the 'Next' button on the localisation dialog to tell the Video feature how big it really is and override how big DevStudio 9 thinks it is before the custom options dialog is drawn.

Is this possible? I've been searching around for most of the day for an answer.

Regards,
Gareth

PS - As for the use of SETUP_LANGUAGE instead of VIDEO_FORMAT - all other installs I've done have asked for US or Europe during the install to set default paper sizes (A4 or US Letter) and have simply re-used the code for convenience sake :-) I didn't write them, my predecessor did... I'm just learning and trying to keep it simple, ie. if it worked before, don't change it.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 10 February 2005 - 20:28

QUOTE
The feature size information simply says "This feature requires 0KB" and says nothing of subfeatures (there aren't any)

Oh, I thought that NTSC and PAL were sub-features of Video.

You could use the ReserveCost table in Power Editor to specify extra disk space requirement for the Video feature. However in this case the user is required to actually have that much ADDITIONAL space available, otherwise setup will not continue.

Gareth at Serif

Gareth at Serif
  • Full Members
  • 85 posts

Posted 11 February 2005 - 12:45

You have in fact given me the perfect solution - by dropping either the NTSC or PAL feature into the Video feature to become a hidden sub-feature the feature cost is pretty much spot-on since both NTSC and PAL features are of similar size... and the appearance of the custom dialog hasn't changed. So far it seems to work just fine so my thanks goes out to you.

Regards,
Gareth