MSI CustomActions scheduling can be quite tricky. Indeed BeforeInstall doesn't change the the actual property value as it is somehow became "immutable". Though Load event works OK and the changed IP value is carried to the AfterInstall correctly. If Load is not suitable for you and you need more precise CA scheduling then indeed you may have too do everything in custom actions not events.
This is the full code sample that works for your scenario:
On unrelated note. May I ask you to use code formatting in your posts. Reading non formatted code is quite difficult. I hope you understand. Thank you.
The markdown formatting rules are here: http://codeplex.codeplex.com/wikipage?title=Markdown&referringTitle=Documentation
This is the full code sample that works for your scenario:
staticvoid Main() { var project = new ManagedProject("ManagedSetup", new Property("IP", "85")); project.DefaultDeferredProperties += ",IP"; project.UI = WUI.WixUI_ProgressOnly; project.Load += msi_Load; project.AfterInstall += msi_AfterInstall; project.BuildMsi(); } staticvoid msi_Load(SetupEventArgs e) { e.Session["IP"] = "test"; } staticvoid msi_AfterInstall(SetupEventArgs e) { MessageBox.Show(e.Session.Property("IP"), "msi_AfterInstall"); }
On unrelated note. May I ask you to use code formatting in your posts. Reading non formatted code is quite difficult. I hope you understand. Thank you.
The markdown formatting rules are here: http://codeplex.codeplex.com/wikipage?title=Markdown&referringTitle=Documentation