Yes you have to read the reg value and set it to the INSTALLDIR property. Doing this you will mimic passing this property value from command line.
Though ManagedProject.Load event is not good because it is called after the UI is initialized. You will need to set this property from ManagedProject.UILoaded event for ManagedUI. And for the native MSI UI it has to be a custom action scheduled before UI loaded:
Please note that in older releases ManagedUI had a problem initializing the installdir text box. Thus please use the vary latest release where it's fixed.
Though ManagedProject.Load event is not good because it is called after the UI is initialized. You will need to set this property from ManagedProject.UILoaded event for ManagedUI. And for the native MSI UI it has to be a custom action scheduled before UI loaded:
//Native MSI UIvar project = new Project("MySetup", new ManagedAction("SetInstallDir", Return.check, When.Before, Step.LaunchConditions, Condition.NOT_Installed, Sequence.InstallUISequence), ... [CustomAction] publicstatic ActionResult SetInstallDir(Session session) { session["INSTALLDIR"] = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\7-Zip") .GetValue("Path") .ToString(); return ActionResult.Success; }
//ManagedUIvar project = new ManagedProject("MySetup", ... project.UILoaded += project_UIInit; ... staticvoid project_UIInit(SetupEventArgs e) { e.Session["INSTALLDIR"] = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\7-Zip") .GetValue("Path") .ToString(); }