Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Thu Aug 22, 2019 2:36 pm

Hello Collins,

Unfortunately, the event viewer logs are not of much help.

In order for us to further investigate this, could you please share with us, by e-mail at support at advancedinstaller dot com, a download link for the image (the VMWare image) that you are using in the last video? Also, could you please try to create a test account as I will also need the credentials to log-in to that machine.

Looking forward to hearing from you.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Thu Aug 22, 2019 2:43 pm

Catalin,

We use VM's that are in a hosted VSphere environment and I won't have access to it. I can setup a zoom meeting or Skype to share and give you control so you can use the environment for troubleshooting.

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Wed Aug 28, 2019 9:45 am

Hello Collins,

First of all, please accept my apologies for the delayed reply. We have intensively tried to replicate this behavior on our end but unfortunately to no avail.

There is only one thing that I can think of as of right now. The "Shared DLL Reference Count" option from your services ("Organization" page --> the component of your service --> "Attributes" section). Could you please disable that, rebuild your project and re-test the uninstall process?

After doing so, please forward me a video of it (the uninstall process) and also the uninstallation log file.

One strange thing that I found in your log file (compared to the log created on my machine) is the fact that the "RemoveFiles" standard action does not execute (while on my machine it executes for every file). Could you please also check if any of your files are removed during the uninstall process and let me know the outcome?

If that does not work, then we can setup a remote troubleshoot session, but to be fully honest with you, I am pretty much out of ideas as to why this issue occurs.

Looking forward to hearing from you.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Wed Aug 28, 2019 5:50 pm

Catalin,

The uninstall was leaving all the dlls in the appdir. I removed the "Shared DLL Reference Count" from the services components and the service uninstalled.

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Fri Aug 30, 2019 12:41 pm

Hello Collins,

I am glad to hear that the service finally uninstalled as expected.

The legacy shared DLLs reference counting is a mechanism by which the Windows Operating System ensures that files which are shared are reference counted, so that if a product attempts to uninstall a file which is used by another product, then the file is not deleted.

Long story short, when that option is checked, a ref count is created in the registries and, as long as that ref count is bigger than 1, the file will not be uninstalled.

With that being said, could you please remove that option from other .DLLs as well and let me know the outcome?

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Fri Aug 30, 2019 7:43 pm

Catalin,

The shared DLLs reference option is required because our applications share the same folder and share a lot of the same file so this needs to be enabled, except for the service exe.

Also, I still have the issue with the service being left if I use the old installer, upgrade with the new installer and then uninstall. I checked the SharedDlls count in the registry and on upgrades, it increments those dlls by one more so on uninstall it will be one increment off.

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Thu Sep 05, 2019 10:42 am

Hello Collins,

In what regards the update behavior, this most probably happens because you have the "Shared DLL Reference Count" option enabled in your older setup.

A workaround for this problem would be to remove that flag from your older version, if that is not already deployed into production. If it is, then the setup should manually be uninstalled and after that the newer version should be deployed.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Thu Sep 05, 2019 3:07 pm

Catalin,

That's the issue. The old installer already has a shared count in the registry. The new installer increments those counts again on upgrade of the old installer so the count is one higher than it should be and on uninstall the existing shared counts are not being removed.

Shouldn't the upgrade with the new installer remove those as its removing the old product first? It shouldn't be adding to the existing shared count if the old are not removed.

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Fri Sep 06, 2019 2:30 pm

Hello Collins,

If in your previous installer, you had the "Shared DLL Reference Count" flag on your service and in the newer installer you have removed it, then I think that the count should be removed from the registries (at least that is what I've noticed from some tests that I've run). Here is how I've tested this scenario:

1. create new project and add a text file to it

2. set the "Shared DLL Reference Count" flag for the text file

3. installed it

4. checked the registries, the count was set to 1

5. increased the version from 1.0.0 to 2.0.0

6. unchecked the flag

7. built the project and then deployed the setup

8. checked the registries and the count was not there anymore

When you are performing the upgrade, what is the count set to? Is it 1 or more than 1?

Also, could you please capture the moment when the count is increased during the upgrade (you can "pause" the installer using some message boxes) in a video and forward the video to me? I was not able to replicate this in my sample projects (and I've tested countless scenarios).

Looking forward to hearing from you.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Mon Sep 09, 2019 2:27 pm

Hi Catalin,

The way I recreated it is:

1. Use the old (Wise) installer to install an older version. The count is set to one
2. Upgrade the old version to the latest using the new (Advanced Installer). Count is removed and then added again and set to 2

Here is the link to the video and I emailed you the installers that I used and the logs.

https://www.screencast.com/t/a98oxIMF9pC5

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Fri Sep 13, 2019 1:32 pm

Hi Collins,

Thank you for your sent files.

We tested the scenario and replicated the behavior. After further investigation on this it seems the source cause of this behavior is the fact that your installation files have different component GUIDs in your old and new version of your setup.

Because the new product components have different GUIDs, most likely Windows Installer does not detect the removal of old product components as part of the old product uninstall (during upgrade) and before the uninstall of the old components it reads their shared DLL ref count and later on at during the effective installation of the new components it will simply increment the counter existing on current machine before upgrade installation.

However, long story short, can you please proceed like this:

1. open your new version of the setup project in Advanced Installer
2. go to "Organization" page
3. open a new instance of Advanced Installer and on "Start" page choose "New -> Convert -> Import MSI" project template and select the old (Wise) installer MSI
4. after the old (Wise) installer is imported go to "Organization" page and check what GUID has each component of your old installer
5. make sure that in the new version of your setup project your files components has the same GUIDs as in the old version of your installer
6. rebuild your new version setup and test again the scenario

Let us know how this worked.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Collins
Posts: 138
Joined: Wed Oct 12, 2016 2:57 pm

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Fri Sep 13, 2019 9:01 pm

Daniel,

By using the same GUID for each file, the shared count remained the same and removed all of them on uninstall.

It would be nice if there was a way to just import the file GUID's instead of the entire project. I don't like using the imported project for converting because it imports to much garbage from Wise that I don't want or need in the new installer.

Thank you both for all your help on this.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Start Or Stop Service On Install Based On Property Doesn't Uninstall Service

Mon Sep 16, 2019 7:54 am

You are always welcome Collins.

Thank you for your suggestion in regards to the file GUIDs import, I have forwarded it to our dev team and maybe such custom improvement will be available in the future.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”