donaddon
Posts: 15
Joined: Wed Apr 30, 2014 6:21 pm

Uninstaller doesn't work if I delete installer

I follow these steps:

1. Double-click the .msi to install the product.
2. Rename the .msi file to "application.msi.bak".
3. Go to Control Panel and try to uninstall the product.

I get an error that says "The feature you are trying to use is on a network resource that is unavailable".

This is 100% reproducible.

Am I missing some option that tells Windows Installer to keep the .MSI file?
Eusebiu
Posts: 4960
Joined: Wed Nov 14, 2012 2:04 pm

Re: Uninstaller doesn't work if I delete installer

Hi,

I tested your scenario, but I couldn't reproduce the behavior. Can you reproduce the problem on multiple clean machines? You can take a look on the Uninstall requires the old .msi file thread which debates a similar problem.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
donaddon
Posts: 15
Joined: Wed Apr 30, 2014 6:21 pm

Re: Uninstaller doesn't work if I delete installer

I found the problem: I had a custom action (Session.DoAction("ResolveSource")) that I hadn't noticed was registered to execute for Uninstall. Apparently if this custom action is registered for uninstall then you have to have the original .MSI IN THE ORIGINAL LOCATION to perform the uninstall.

But of course that's still a problem:

Now I can't upgrade because I can't uninstall the old versions if the old .MSI isn't exactly where it was when the installer was run. Running uninstall or repair even with the same .MSI that installed fails if it's not in the same location.

Ideas on ways to fix this? Is there some way to force an .MSI execution to ignore all errors from custom actions?

The only solution I have thought of (for my upgraded product which can't install because it can't uninstall the old version) is this:

1. Create an install patch for the old installer with the fix for the uninstall issue.
2. Create a custom action for the new / upgrade installer that does the following:
a. Attempts to run the patch for the old installer.
3. Execute this custom action before the step that uninstalls the old version (I'm not sure where this goes or if it's even possible).

I have two installers that went out that had broke uninstallers, so the upgrade installer may have to attempt to do this patch for both of them (although they are the same product, so perhaps a single upgrade patch will work).

What a mess! If anyone can think of a better fix for this situation, please let me know.
Eusebiu
Posts: 4960
Joined: Wed Nov 14, 2012 2:04 pm

Re: Uninstaller doesn't work if I delete installer

Hi,

Indeed, in order to fix the broken installers you can create a patch for each of the two packages. I'm afraid that you cannot create a single patch for both packages because all of the patch rules should be respected when you create a patch.

The best way to launch these patches from the upgraded packages is to add them as "pre-install" or "feature-based" prerequisites. Otherwise, you can create a custom action that launches them on the "Wizard Dialogs Stage" section. They cannot be added on the "Install Execution Stage" section, because two Windows Installer packages cannot run at the same time (the patch and the upgraded package in your case).

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
donaddon
Posts: 15
Joined: Wed Apr 30, 2014 6:21 pm

Re: Uninstaller doesn't work if I delete installer

I followed these steps to try to create a patch to fix the problem:

1. Created a new installer that does not have the custom action running on uninstall. Verified that this installer can install and then be uninstalled without having to be at the same install location.

2. Created a new patch project:

a. Selected New.Updates.Patch
b. Under Images, selected New Upgraded.
c. Selected the new .MSI.
d. Then right-clicked that listing and selected "New Target".
e. Under that, I selected the old .MSI.

3. Built the patch file.

4. Shut down Advanced Installer, and ran the installer for the old / broken .MSI which cannot be uninstalled.

5. Renamed the old .MSI installer file (so it can no longer be found).

6. Run the newly built .MSP patch file.

When running the .MSP patch file, I am receiving the exact same error: "The feature you are trying to use is on a network resource that is unavailable", referring to the old .MSI file that I re-installed.

I also tried running the newly built .MSI file with msiexec /fv, but I still get that same error.

So I am still stumped on how to patch that old .MSI.

Thanks!
donaddon
Posts: 15
Joined: Wed Apr 30, 2014 6:21 pm

Re: Uninstaller doesn't work if I delete installer

As an alternative approach, since I don't _NEED_ the old uninstallers to work, and the new installer is a complete replacement, I am seriously considering adding a simple custom action to remove the old product from the Windows installer registry by deleting the following registry keys:

HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\[product_code]
HKCR\Installer\Products\[unknown_product_guid]

This _seems_ to work, at least on Windows 7.

Can you please comment on this solution?

I'm not sure where the "unknown_product_guid" comes from. It does not appear to be the same as the "product_code" that I see in the installer under the "Product IDs" tab.

Thanks!
Eusebiu
Posts: 4960
Joined: Wed Nov 14, 2012 2:04 pm

Re: Uninstaller doesn't work if I delete installer

Hi,
1. Created a new installer that does not have the custom action running on uninstall. Verified that this installer can install and then be uninstalled without having to be at the same install location.
Did you create another project or just modified the project related to the old version of your product? Please note that you should use the old version's project. Also, it is recommended to only set a false condition for the custom action not to remove it (you can just uncheck the "Uninstall" option from the "Execution Stage Condition" section).

The other steps you mentioned are correct.
As an alternative approach, since I don't _NEED_ the old uninstallers to work, and the new installer is a complete replacement, I am seriously considering adding a simple custom action to remove the old product from the Windows installer registry by deleting the following registry keys:

HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\[product_code]
HKCR\Installer\Products\[unknown_product_guid]

This _seems_ to work, at least on Windows 7.

Can you please comment on this solution?
The "patch" solution is recommended and it should work, however if you test the above solution on multiple machines and it works you can use it.
I'm not sure where the "unknown_product_guid" comes from. It does not appear to be the same as the "product_code" that I see in the installer under the "Product IDs" tab.
That "unknows_product_guid" is the "ProductCode" of the application computed as detailed in the Packed GUID's article.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
donaddon
Posts: 15
Joined: Wed Apr 30, 2014 6:21 pm

Re: Uninstaller doesn't work if I delete installer

Did you create another project or just modified the project related to the old version of your product? Please note that you should use the old version's project. Also, it is recommended to only set a false condition for the custom action not to remove it (you can just uncheck the "Uninstall" option from the "Execution Stage Condition" section).

The other steps you mentioned are correct.
Yes, that is exactly what I did. And the new installer installs and uninstalls (after rename) just fine.

But upgrade of the old / broken installers results in the same problems. To re-iterate:

I still get the same "network" error on uninstall even after I install the newly built .MSI with msiexec /fv.

The patch installer receives the same error: "The feature you are trying to use is on a network resource that is unavailable"?
Eusebiu
Posts: 4960
Joined: Wed Nov 14, 2012 2:04 pm

Re: Uninstaller doesn't work if I delete installer

Hi,

I seems that the old version of the application was not correctly cached by Windows Installer on your machine. Can you reproduce the problem on multiple clean machines? If so, can you please send us a link to support at advancedinstaller dot com, so we can download your old and new versions of the product to test them and try to find the problem?

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

Return to “Common Problems”