mhatkinson
Posts: 32
Joined: Tue Apr 08, 2008 5:36 pm

Service Name and event sequence

I've created a dialog that allows users to set a custom Property called EnvironmentName and this dialog is invoked early on in the 'First Time Install' set of dialogs. The default value of EnvironmentName is "ProductionEnvironment".

I also create and start a new Service and use the EnvironmentName as part of the name of the new Service. However, the service always seems to get the default value for EnvironmentName instead of the one that the user has set. Looking at the log file, it appears that the Services are dealt with quite a while after my custom dialog is invoked.

Is there better way to do this? Or is there a way to set the name of the Service dynamically at a certain piont in the process?

thanks,
Mark
Quadiago
Posts: 71
Joined: Thu May 31, 2007 9:07 am

Re: Service Name and event sequence

Hi there

I think your problem is that you're using a private property. Private properties don't get preserved from the UI sequence to the execute sequence. Try using a public property (ie. having a name consisting of capital letters). In your case, ENVIRONMENTNAME or something similar.
mhatkinson
Posts: 32
Joined: Tue Apr 08, 2008 5:36 pm

Re: Service Name and event sequence

Ahh, interesting.
Something I was also trying to do was change the ProductName in order to have multiple installations of the same version of an app. For example, I tried to make the ProductName ,for example, "Prodcut1", "Product2", etc from the default "Product"
I realize this is probably not advisable for a number of reasons, but is that kind of the same thing? ProductName is private?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Service Name and event sequence

Hi,
Something I was also trying to do was change the ProductName in order to have multiple installations of the same version of an app.
Please note that this is not supported by Windows Installer. An installation package can have only one instance, therefore your would have to create a different package for each instance.
ProductName is private?
Yes, the "ProductName" property is private. However, it is not recommended to modify it during the installation. Also, the difference between ProductName and your property is that it is set at the beginning of the installation and its value doesn't change during the installation.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”