This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Problems with Multi-instance functionality
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 19, 2010
07:07 PM
Problems with Multi-instance functionality
Hello All,
I have a couple of problems when using the multi-instance functionality with a Basic MSI installation:
1) to differentiate the service display names for my multi-instance app in Services, I'm using " [InstanceId]" in the Display Name field for defining the service. The first time, this works fine, as the InstanceId property populates the name: " 0". However, when I install a second instance, " 1" overwrites the first instance name.
2) The [InstanceId] property apparently does not get resolved in time to display in the status boxes, Add/Remove programs, etc. (One sees the actual property [InstanceId] appended to the Product Name.) Is there a way to resolve this property earlier in the installation?
I should mention that I'm using the [InstanceId] property because the number of instances installed to a machine is indeterminate--defining a set number of instances in the Multiple Instances view isn't an option.
I could get round 2) by defining some number of instances that no user is likely to install. Surely there's a way to resolve the first problem? Thanks to anyone who has dealt with this or knows of a fix.
I have a couple of problems when using the multi-instance functionality with a Basic MSI installation:
1) to differentiate the service display names for my multi-instance app in Services, I'm using "
2) The [InstanceId] property apparently does not get resolved in time to display in the status boxes, Add/Remove programs, etc. (One sees the actual property [InstanceId] appended to the Product Name.) Is there a way to resolve this property earlier in the installation?
I should mention that I'm using the [InstanceId] property because the number of instances installed to a machine is indeterminate--defining a set number of instances in the Multiple Instances view isn't an option.
I could get round 2) by defining some number of instances that no user is likely to install. Surely there's a way to resolve the first problem? Thanks to anyone who has dealt with this or knows of a fix.
(11) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 22, 2010
05:51 PM
For the service, the Name field would also need to use the instance ID. Otherwise, the internal name of the service will be identical to the existing service, and it will then update that one. (Note that field is the tree item label in the Services for a component.)
For your second issue, properties are resolved at whatever point they are referenced. Note that you cannot embed one property reference ([PropertyName]) as the value of another property, such as the ProductName property. Any properties present in the property table are not resolved by Windows Installer to avoid circular property references (see http://msdn.microsoft.com/en-us/library/aa370908(VS.85).aspx). If you need to set one property that is in the property table with the value of another property, a set property custom action would be needed to resolve any embedded properties. In the case of updating the ProductName property, a set property custom action can be created with the following information:
Property Name: ProductName
Property Value: My Product Name - [InstanceId]
This would need to be sequenced early in the install UI and install execute sequences because a property like ProductName is private and will not have its value passed from the UI to execute sequence.
For your second issue, properties are resolved at whatever point they are referenced. Note that you cannot embed one property reference ([PropertyName]) as the value of another property, such as the ProductName property. Any properties present in the property table are not resolved by Windows Installer to avoid circular property references (see http://msdn.microsoft.com/en-us/library/aa370908(VS.85).aspx). If you need to set one property that is in the property table with the value of another property, a set property custom action would be needed to resolve any embedded properties. In the case of updating the ProductName property, a set property custom action can be created with the following information:
Property Name: ProductName
Property Value: My Product Name - [InstanceId]
This would need to be sequenced early in the install UI and install execute sequences because a property like ProductName is private and will not have its value passed from the UI to execute sequence.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 23, 2010
04:36 PM
Josh,
On the first issue, I'm confused: the name field that you refer to, it is the name one gives the service under Component > Advanced Settings > Services > Service Name? I can't enter spaces or the brackets for a property name in that case...
Thanks for your explanation on the second point.
On the first issue, I'm confused: the name field that you refer to, it is the name one gives the service under Component > Advanced Settings > Services > Service Name? I can't enter spaces or the brackets for a property name in that case...
Thanks for your explanation on the second point.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 23, 2010
05:14 PM
You can edit the service internal name directly in the Name columns of ServiceInstall and ServiceControl tables (these names must match between tables) from the Direct Editor if spaces in the internal service name are necessary. Otherwise, a name such as 'myservice[InstanceId]' should work fine when renaming the service in the Components view.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 23, 2010
06:40 PM
Great, directly editing the tables did the trick.
Josh, many thanks for your help.
Josh, many thanks for your help.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 08, 2010
12:54 PM
Hi joshstechnij,
By the answer u give in here i was able to fix a major problem for many ppl, tank u very much, but before make a release of this multi - instances - services i need to ensure that everything works flowless :D, but i m having problems with the uninstall, basically doesn´t work.
I was having 1 Service and install and uninstall perfect, now i add the multi-instance ability and the uninstall give the message "Esta accion solo es valida para los productos que estan instalados actualmente"(This action is not valid for the products that are currently installed) after uninstalling the "Service1" and trying to uninstall the second.
But "Service1" and "Service2" remaing in the Windows Services control panel and the his directorys.
Tnks in advance.
By the answer u give in here i was able to fix a major problem for many ppl, tank u very much, but before make a release of this multi - instances - services i need to ensure that everything works flowless :D, but i m having problems with the uninstall, basically doesn´t work.
I was having 1 Service and install and uninstall perfect, now i add the multi-instance ability and the uninstall give the message "Esta accion solo es valida para los productos que estan instalados actualmente"(This action is not valid for the products that are currently installed) after uninstalling the "Service1" and trying to uninstall the second.
But "Service1" and "Service2" remaing in the Windows Services control panel and the his directorys.
Tnks in advance.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2010
12:06 PM
Hi,
What I did to get the services to uninstall is to set a Condition for the component that installs/uninstalls your service. So, for example, in the case of the first instance, use "InstanceId=0" in the "Condition" field for that component; "InstanceId=1" for the second instance, etc. (I defined a component for each instance of my service. A bit tedious, yes, but I am not sure that there is another way to do it.)
Doing this allows the instances to uninstall from SCM.
What I did to get the services to uninstall is to set a Condition for the component that installs/uninstalls your service. So, for example, in the case of the first instance, use "InstanceId=0" in the "Condition" field for that component; "InstanceId=1" for the second instance, etc. (I defined a component for each instance of my service. A bit tedious, yes, but I am not sure that there is another way to do it.)
Doing this allows the instances to uninstall from SCM.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2010
01:49 PM
Mmm,
So basically u are using the Multiple Instances option like a smoke screen for wshowing the capability for installing instances, but under surface u are using diferent component.... waky :D, nice.
I will some more test later, but now is the installing the one with problems, i make 2 components pointing the same "Service.exe" the first key name is "Service.exe" the second one i have to changed to "Service1.exe" because is a key and can´t have the same name, but is refering "Service.exe".
Question... U make another Service.exe and change its name?¿, i assuming u did, but i dont Know if is gonna work..., if not, what did u do?¿, only make a new component and reference the same Service, and doesn´t give u any trouble?¿
Tanks
So basically u are using the Multiple Instances option like a smoke screen for wshowing the capability for installing instances, but under surface u are using diferent component.... waky :D, nice.
I will some more test later, but now is the installing the one with problems, i make 2 components pointing the same "Service.exe" the first key name is "Service.exe" the second one i have to changed to "Service1.exe" because is a key and can´t have the same name, but is refering "Service.exe".
Question... U make another Service.exe and change its name?¿, i assuming u did, but i dont Know if is gonna work..., if not, what did u do?¿, only make a new component and reference the same Service, and doesn´t give u any trouble?¿
Tanks
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2010
04:03 PM
Hi Ruben,
I am indeed changing the service name, using the [InstanceId] property to differentiate the names in Services.
So under "Advanced Settings > Services" for that file component, I define it as " [InstanceId]". After these get installed, they will thus appear as " 0", " 1", etc in the SCM.
If you want your service name to contain spaces (which you very likely do), then you will need to specify the names in the ServiceControl and ServiceInstall tables in the Direct Editor. (The Services node under Advanced settings does not allow one to enter spaces directly. Not sure why since the tables can be fiddled to allow it.) 😄
I am indeed changing the service name, using the [InstanceId] property to differentiate the names in Services.
So under "Advanced Settings > Services" for that file component, I define it as "
If you want your service name to contain spaces (which you very likely do), then you will need to specify the names in the ServiceControl and ServiceInstall tables in the Direct Editor. (The Services node under Advanced settings does not allow one to enter spaces directly. Not sure why since the tables can be fiddled to allow it.) 😄
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2010
04:06 PM
I forgot to add: yes, I create a component for each service instance. It's a bit tedious to set up if you have several instances, and not terribly elegant, but hey, it works! 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2010
04:17 PM
Mascalero.
Men tanks for ur help, i apreciate.
The "Trick" with the "InstanceId" i know from other post, but in this case i am not using it, well because if i have to define "manualy" each service, then i can use the name i wanna :D, not one with a secuencial number .
The part of changing the name of the service was because i tought that i need to change the name of the referenced service, the ".exe", according to the name of my service, but i probe that this was wrong :D.
Anyway... i was able to put this "multi instances service" moving, mainly because of this post. Tanks
Men tanks for ur help, i apreciate.
The "Trick" with the "InstanceId" i know from other post, but in this case i am not using it, well because if i have to define "manualy" each service, then i can use the name i wanna :D, not one with a secuencial number .
The part of changing the name of the service was because i tought that i need to change the name of the referenced service, the ".exe", according to the name of my service, but i probe that this was wrong :D.
Anyway... i was able to put this "multi instances service" moving, mainly because of this post. Tanks
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2010
07:08 PM
Glad you've got it working!
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)