2
votes

I'm creating msi installer that run services with auto start for windows using wix toolset. msi was successfully compiled and installed, and services are working correctly.

The problem is that, when i try to uninstall the program in control panel, it's showing the following message:

problem

I tried to remove the program from regedit and tried to install using the command:

MsiExec /I installer.msi REINSTALLMODE=voums REINSTALL=ALL

Here is the code of product and package declarations:

<Product Name='Foobar 1.0' Manufacturer='Acme Ltd.' Id='6DA5C23A-86C7-4D14-AEC0-86416A69ABDE' UpgradeCode='6DA5C23A-7349-453F-94F6-BCB5110BA4FD' Language='1033' Codepage='1252' Version='1.0.0'>
    <Package Id='*' Keywords='Installer' Description="Acme's Foobar 1.0 Installer" Comments='Foobar is a registered trademark of Acme Ltd.' Manufacturer='Acme Ltd.' InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />

In INSTALLDIR, i have an exe file for service, and do some actions:

<Directory Id='INSTALLDIR' Name='Foobar 1.0'>

    <Component Id='ConfPathEnv' Guid='6DA5C23A-6BE3-460D-A14F-75658D16550B' KeyPath="yes">
        <Environment Id="AQLIGHT_CONFIG_PATH" Name="AQLIGHT_CONFIG_PATH" Value="[INSTALLDIR]config.json" Permanent="yes" Part="last" Action="set" System="yes" />
    </Component>

    <Component Id='MainExecutable' Guid='6DA5C23A-83F1-4F22-985B-FDB3C8ABD471'>
        <File Id='serviceEXE' Name='service.exe' DiskId='1' Source='service.exe' KeyPath='yes' />
        <ServiceInstall Id="InstallService" Name="AqLightService" DisplayName="AqLightService 1.0" Start="auto" ErrorControl="normal" Arguments="install" Type="ownProcess" />
        <ServiceControl Id="ControlService" Name="AqLightService" Start="install" Stop="uninstall" Remove="uninstall" Wait="yes" />
    </Component>

</Directory>

In order to remove folder when uninstalling the program, i use the following code:

<Directory Id="ProgramMenuFolder" Name="Programs">
    <Directory Id="ProgramMenuDir" Name="Foobar 1.0">
        <Component Id="ProgramMenuDir" Guid="6DA5C23A-7E98-44CE-B049-C477CC0A2B00">
            <RemoveFolder Id='ProgramMenuDir' On='uninstall' />
            <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
        </Component>
    </Directory>
</Directory>

I tried to change the GUIDs for each componet several times, but it did't help.

1
Does this happen on a clean test machine, a developer machine or a user machine? A clean test machine helps when there is something plainly wrong with the installer and is easiest to diagnose and fix. A developer machine is nice when it works but can become a problem itself. A user machine could find more real-world problems but the odd one could be not worth the time to diagnose.Tom Blodget
@TomBlodget, thank you for your comment. Found the problem with logging and the problem is due to CustomAction. It is running during uninstall process, so that's why it's causing problem.user4853187
Failures during uninstall are almost always custom actions. Hopefully you were testing on a clean VM or a machine you can reimage. Getting a failed install off of a machine is fun but doable.Christopher Painter
Did you get this sorted?Stein Åsmul

1 Answers

0
votes

Custom Action: That error message can mean a number of things, but most commonly it is caused by a failing custom action. However, in this case it looks like the message is from iTunes?

Logging: No two ways about it: you need a verbose log file to try and make sense of this (adjust paths as appropriate):

msiexec.exe /x "Setup.msi" /L*V "C:\Setup.log"

Self-Repair?: My guess is that you have a corrupted machine / Windows Installer Database, or a self-repair problem that you have turned into a corrupt machine by hacking the registry. Maybe. On Self-Repair.


Conditioning: When you need conditions to run only at certain times / installation modes - you need to deal with conditioning. There are many previous answers on MSI conditions. They are always hard to get right and testing is essential. Please see the answers below for information:

This condition might be enough for you (no guarantees):

NOT Installed AND NOT UPGRADINGPRODUCTCODE

Please test in all installation modes: : install, uninstall, modify, repair, self-repair, patching, major upgrade, etc.... Hard to tell how things can conspire, no substitute for real-world testing (just to state the obvious).


Here are more details on logging and interpreting the log file: