VladiS
Posts: 4
Joined: Sun Dec 18, 2022 2:36 pm

Event viewer log shows quiet uninstall succeeded while it (purposely) failed

Hello.

We ran into an odd issue where if we actively fail the uninstallation process from a custom action (Fail installation if custom action returns an error is ticked) and we uninstall the package from the command line quietly:

Code: Select all

installer.exe /exenoui /qn /x //
we observe 5 events from MsiInstaller in Event viewer:
1. Product: My Product -- Removal failed. - event ID 11725
2. Windows Installer removed the product. Product Name: My Product. Product Version: 1.2.3. Product Language: 1033. Manufacturer: Me. Removal success or error status: 1603. - event ID 1034
3. Ending a Windows Installer transaction: ... - event ID 1042

4. Product: My Product -- Removal completed successfully. - event ID 11724
5. Windows Installer removed the product. Product Name: My Product. Product Version: 1.2.3. Product Language: 1033. Manufacturer: Me. Removal success or error status: 0. - event ID 1034

The first 3 events show up when uninstalling via msiexec.exe /x or from add remove programs, and they make sense, message 2 shows error code 1603 which is what we expect

the last 2 are perplexing, and only show up with the quiet uninstall command, and also, they show up after the ending transaction event, and the product is not uninstalled

Would appreciate any help here!

Edit: After some further testing we discovered the issue is perceived by simply uninstalling from the command line, without the quiet flags

Code: Select all

installer.exe /x //
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Event viewer log shows quiet uninstall succeeded while it (purposely) failed

Hello and welcome to our forums,

After uninstalling, if you go to "Control Panel", is your app still there (i.e. it was not uninstalled)?

What I'm guessing would be an issue here is the fact that you scheduled the Custom Action that fails under the "Wizard Dialogs Stage". This stage is skipped if the install/uninstall process is done without UI.

Most likely, the custom action that you purposely configured to fail is skipped (because the whole Wizard Dialogs Stage is skipped).

Could you please check this and let me know if this is the case?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
VladiS
Posts: 4
Joined: Sun Dec 18, 2022 2:36 pm

Re: Event viewer log shows quiet uninstall succeeded while it (purposely) failed

Hello Catalin, Thanks for the replay!

After uninstalling the program is not uninstalled and still shows up in Control Panel, and the custom action is not skipped, we can see in our logs that it did get executed.

The custom action is under "Install Execution Stage"

Just to shed a bit more light on what we are trying to do, the custom action communicates with our server to check if uninstalling is allowed, if not we return failure from the custom action and fail the uninstallation.
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Event viewer log shows quiet uninstall succeeded while it (purposely) failed

Hello,

If the product is indeed not removed, then it means your custom action is scheduled as expected and it works.

I have done some tests just now and I was indeed able to reproduce the behavior you described.

To be fully honest with you, I am not quite sure why this is happening. I will try to further investigate this tomorrow and check with the dev team.

It would look like this only reproduces when you launch the setup as you mentioned:

Code: Select all

setup.exe /x //
If you uninstall from the Control Panel, the "success" events are no longer added in EventViewer. Could you please also confirm this?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
VladiS
Posts: 4
Joined: Sun Dec 18, 2022 2:36 pm

Re: Event viewer log shows quiet uninstall succeeded while it (purposely) failed

Correct, everything you described is the exact issue we are experiencing

Thanks again!
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: Event viewer log shows quiet uninstall succeeded while it (purposely) failed

You're always welcome!

I have already discussed with our developer and provided him a sample project that reproduces this.

We will do our best to investigate this next week. Please, however, expect a delay considering it's holidays time and we might not be able to sync easily.

Once I will have more information about this, I will update this thread.

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

Return to “Common Problems”