Great.
Though there are a few things that look strange in your code fragments. Specifically you are reading your property value from CustomActionData, meaning you are in the the deferred action (e.g. after setup is completed). Often (but not always) the session object is 'disconnected' if it is accessed from the deferred action. Thus property cannot be set back to the session.
However it's only a part of the problem. Your 'ServiceName' property is not all in capital, maeaning it cannot be set from the outside (e.g. ExternalUI). Yes MSI is using this childish technique to make property 'public'. The all characters supposed to be capital.
The typical scenario for setting properties from ExternalUI is to collect user input prior the actual installation and then pass it to the MSI runtime. ExternalUI/WpfSetup sample does exactly that when user chooses (checkbox) if the "Documentation" feature should be installed.
If you do it this way your code can be as simple as:
Though there are a few things that look strange in your code fragments. Specifically you are reading your property value from CustomActionData, meaning you are in the the deferred action (e.g. after setup is completed). Often (but not always) the session object is 'disconnected' if it is accessed from the deferred action. Thus property cannot be set back to the session.
However it's only a part of the problem. Your 'ServiceName' property is not all in capital, maeaning it cannot be set from the outside (e.g. ExternalUI). Yes MSI is using this childish technique to make property 'public'. The all characters supposed to be capital.
The typical scenario for setting properties from ExternalUI is to collect user input prior the actual installation and then pass it to the MSI runtime. ExternalUI/WpfSetup sample does exactly that when user chooses (checkbox) if the "Documentation" feature should be installed.
If you do it this way your code can be as simple as:
publicvoid StartInstall() { base.StartInstall("SERVICENAME=" + svcNameCtrl.Text); }