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

AddLocal problem


6 replies to this topic

marvelfj

marvelfj
  • Members
  • 9 posts

Posted 13 May 2006 - 20:29

hi Stefan,
you always suggest to use AddLocal and Remove event to hide feature at runtime dialog. but i have a problem using AddLocal event or it can be say that i don't know how to use it.

i have 2 feature :
- feature1 -> i set installlevel to 0(never install this feature) so it doesn't appears at feature dialog.
- feature2 -> i set installlevel to 3(normal) so it appears ot feature dialog.

i put the event at next button on a dialog before select feature dialog.

- dialog1
- dialog2 -> i put the event at next button on this dialog.
- select feature dialog

i put this into next button :
event : AddLocal
argument : feature1
condition : 1

when i run the installation, after i click next button in dialog2. the feature1 in select feature still doesn't appears!! do you know what is wrong with my step ?? how i should set the installlevel of feature1 so i can show it at runtime dialog?? i have a plan after this work, i will change the condition base on user input.
Thanks stefan, i thing you have a great forum website!!


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 15 May 2006 - 16:20

You can use AddLocal to select (and Remove to un-select) any feature that is not disabled. If you set a feature's InstallLevel to 0 it is invisible, unselected and disabled and cannot be enabled using AddLocal.

If you want a feature that is invisible but can be selected using AddLocal then you could set it to invisible (i.e. Display = 0). But this is a static setting, you cannot change this at runtime.

marvelfj

marvelfj
  • Members
  • 9 posts

Posted 17 May 2006 - 08:49

Thanks stefan now i understand AddLocal only can do select (and remove to un-select ) but do you suggestion how to hide feature in select feature dialog using conditional properti :

let say : i have 2 feature related with 2 property

"feature1" related with property show1 = 1
"feature2" related with property show2 = 1

in runtime/userdialog, if "show1" property is change into 2 value i want the "feature1" appears, otherwise if "show1" the value is still 1 then i want to disappears/hide "feature1". If i could not using Addlocal/Remove and CostInitialize with condition table because it can't be run in win 9X, do you have suggestion so i disappears/hide feature in runtime/userdialog ?? do you have another method ?? Thanks before.








Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 17 May 2006 - 10:29

As I mentioned before: you cannot change the visibility of a feature in the feature tree dialog at runtime. Your options:
- don't use the feature tree dialog, but a custom dialog with a couple of check boxes for instance
- don't use Windows Installer's user interface but build your own external UI. There is a little documentation in the MSI SDK, but this is a non-trivial task that would require a lot of work and effort on your part.


marvelfj

marvelfj
  • Members
  • 9 posts

Posted 18 May 2006 - 09:07

Thanks stefan now i know what i will gonna do. but i have another question related with property in table, how can i re-write/update property in table?? i mean... I have a property in product -> properties lets named "show1" and i set into 1. During the run time/user dialog i change the value of "show1" into 2. After finish installation, i run my setup again then choose maintenance mode. i try to show "show1" value in a editfield/text, its appears that the value of "show1" is still 1, is that mean when i change value of "show1" in installation mode its not update the value in property table ???. how can i update/change/rewrite property in table so when i run into maintenance mode i get the updated value from "show1" ?? ( so in intallation mode after i change "show1" value into 2 then in maintenance mode i hope to get value 2 from "show1" ).
Thanks stefan for your kind.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 19 May 2006 - 15:39

Properties are like variables in other programming languages. Their value only exists as long as the program runs, and is lost when its finished. If you want to persist property values you need to write them to disk, e.g. to regitsry, and read them when your setup starts the next time. You can easily do this using the Registry table (for writing) and the AppSearch and RegLocator tables (for reading).

marvelfj

marvelfj
  • Members
  • 9 posts

Posted 20 May 2006 - 20:15

Ok thanks stefan for your information.
now i will find out more about AppSearch and regLocator, because i dont have any experience using that things biggrin.gif. Thanks and have a nice day.