r.kleinkoerkamp
Posts: 3
Joined: Mon Nov 11, 2013 9:20 am

Multiple instances of the same service in different folders

Hi,

I do have one windows service which I do want to deploy in two different folders, since we need two instances of the services with both an own application config file. I created one MSI for the first instance which is working fine (installs the services correctly). Then I took a copy of the first project file and created new product IDs (Product Code and Upgrade Code). I changed the application folder for the second instance and changed the service name for the second instance.

When I now run the second MSI, it installs the services in the second application folder, but it does overwrite the first service instance when looking into the services control manager. Even when I execute the repair function of the first MSI, it does recover to the first instance of the service.

The second instance appears in the list of the services control manager when using the command utility

Code: Select all

sc create '<service name>' binpath= '<path to the .exe>'
I did have a look at http://www.advancedinstaller.com/forums ... t=0#p13661, but it doesn't help me.

Regards,
Roy
Eusebiu
Posts: 4960
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple instances of the same service in different fold

Hi and welcome to Advanced Installer forums.

Thank you for your interest in Advanced Installer.

Please keep in mind that duplicating the AIP file is not the correct scenario because, as you already observed, the Product Code, Upgrade Code and the components GUID is not changed and this can cause a lot of problems.

Can you try the solution described in the Getting "Another Version of ..." error when installing thread and see if this works?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
r.kleinkoerkamp
Posts: 3
Joined: Mon Nov 11, 2013 9:20 am

Re: Multiple instances of the same service in different fold

I tried the suggestion you gave. Saved the first project file as a template and then create a new project file from the saved template. That did not work. I even have created both project files from scratch and also then run them. Also then they do overwrite each other settings. So to my conclusion, this is not about unique GUIDs.

I think it is something with the service name?

I've added a 'New Service Installation' and selected the executable from the application folder. Then I left the service name as it is (xyz.exe). This is the same name for both projects. The 'Display name' and 'Description' are unique. In the corresponding 'Control Operation', I've given the 'Service Name' a unique name. The 'Attached Component' is for both projectfiles the same (xyz.exe). I've tried to change the 'Service Name' under the 'Services to Install', but then I get an error during installation, it complains about missing privileges, but I'm using the local Admin account.

Looking in the registry, it does create a key 'xyz.exe' under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services, which is the same key for both projects. When running one MSI after the other, I see that the values under the 'xyz.exe' key are changing. Might the cause be in that area?

BTW: I'm using version AI 10.6
Eusebiu
Posts: 4960
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple instances of the same service in different fold

Hi,

Indeed, the service name causes the services to overwrite each other. As it is written in this article, the name of a service must be unique.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
r.kleinkoerkamp
Posts: 3
Joined: Mon Nov 11, 2013 9:20 am

Re: Multiple instances of the same service in different fold

Hi,

I solved the problem by deploying the xyz.exe twice, but with a different name in the target folder (like xyz.first.exe and xyz.second.exe). Then under the services section in the project, you select the xyz.first.exe for the service. It will then register the first instance of the service under xyz.first.exe in the registry and then register the second instance of the service under xyz.second.exe.

Regards,
Roy
Eusebiu
Posts: 4960
Joined: Wed Nov 14, 2012 2:04 pm

Re: Multiple instances of the same service in different fold

Hi Roy,

I'm glad you got this working. Just let us know anytime you need help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”