Multiple Instances but only 1 service :-((( - Advanced Installer Community
skingswell
Posts: 29
Joined: Tue Nov 29, 2016 2:24 pm

Multiple Instances but only 1 service :-(((

I am getting close to finishing what feels like a very long AI Project but just as I think I am nearly there I find an issue I cannot resolve......

I have enabled multiple instances which works fine except the service overwrites the service from the previous install.

I am not sure if this is a limitation or I am doing something wrong. I need a quick fix for this problem.

Any ideas?
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Multiple Instances but only 1 service :-(((

Hello,

In order to implement your scenario, please follow the steps:

- go to "Services" page, select your services from "Services to install"
- in the "Service name" and "Display name" field append "[ProductName]" property reference.

You need to do this in order to make sure that each service has a unique name and not be overwritten by the next install.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
skingswell
Posts: 29
Joined: Tue Nov 29, 2016 2:24 pm

Re: Multiple Instances but only 1 service :-(((

Sorin thanks for your reply that has worked but instead of the [ProductName] Property I am using a unique identifier set in a property [companycode]
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Multiple Instances but only 1 service :-(((

Hello,

You are welcome! Please let me know if you have any other questions.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
skingswell
Posts: 29
Joined: Tue Nov 29, 2016 2:24 pm

Re: Multiple Instances but only 1 service :-(((

Sorin, I am a little confused with folder paths for multiple instances. Are you able to help?

I have a project with application path set to [WindowsVolume]\[Manufacturer]\[ProductName]

The first time I install the product I am appending the value 'Company A' to the Product Name.
However when I install another instance I set the Instance Name to Company B but the path wants to go to c:\manufacturer\company b.

How to do I get AI to install my instances as follows

Initial Install c:\manufacturer\Product Name - 'Company A'
1st Instance c:\manufacturer\Product Name - 'Company B'
2nd instance c:\manufacturer\Product Name - 'Company C'

I do have a property already set in one of the dialogs for company value. Am I able to append this to the path and set as the instance number so that the user doesn't need to worry about this?

Sarah
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Multiple Instances but only 1 service :-(((

Hello,
How to do I get AI to install my instances as follows

Initial Install c:\manufacturer\Product Name - 'Company A'
1st Instance c:\manufacturer\Product Name - 'Company B'
2nd instance c:\manufacturer\Product Name - 'Company C'
Unfortunately our support for multiple instances doesn't permit this scenario, as the first instance (Instance #0) will always be installed in a path that doesn't include the Instance ID.

Starting with the second instance (Instance #1) the InstanceId is appended to the APPDIR.

In order to overcome this limitation please follow the steps:

1. Create a new "Execute inline script code" custom action without sequence, containing the following code:


filePath = Session.Property ("APPDIR")

'if file is found on the target machine
If Len(filePath) > 0 Then

'retrieve folder path
folderPath = Left ( filePath, InStrRev (filePath, "\") - 1)

'set the installation path with this value
Session.Property ("APPDIR")= folderPath & " " & "Company A"

End If

2. Create a new execute custom action published event on "Next" button from "WelcomeDlg" for the above custom action. You should condition its execution by the following condition:

ProductName = "Your Application"

Where "Your Application" represents your actual product name. This condition ensures that the custom action is executed only at the installation of the first instance. Starting with the second instance, the InstanceId will be appended to the ProductName, thus the condition will become false.

3. Go to "Multiple Instances" page and create two new instances. Rename them "CompanyB" and "CompanyC"

Please take a look on the attached sample configured for your scenario.

Best regards,
Sorin
Attachments
Sample multiple instances.zip
(75.24 KiB) Downloaded 456 times
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
skingswell
Posts: 29
Joined: Tue Nov 29, 2016 2:24 pm

Re: Multiple Instances but only 1 service :-(((

Sorin, your service is excellent!!!

Using your example I managed to get multiple instances installed with the correct folder names (and using a property instead of a fixed company value) perfectly.

Thank you kindly
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Multiple Instances but only 1 service :-(((

Hello, Sarah,

Thank you for your positive feedback.

I'm glad that you've sorted things out. Please let me know if you have any other questions and I will gladly assist.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Multiple Instances but only 1 service :-(((

Hello,

This improvement has been added in version 14.4 of Advanced Installer released on October 26st, 2017.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”