Search code examples
installationwixwindows-installeruninstallationwix3.11

WIX MSI uninstallation asking admin privileges


I am new to WIX. i have created WIX MSI file to do one custom action to add extension

<CustomAction Id='EXECUTE_AFTER_FINALIZE'
                      Directory='TARGETDIR'
                      Impersonate='yes'
                      Execute='deferred'
                      ExeCommand='CustomCommandToRun' Return='check' />
        <InstallExecuteSequence>
            <Custom Action="EXECUTE_AFTER_FINALIZE" Before="InstallFinalize">Installed</Custom>
        </InstallExecuteSequence>

<Package InstallerVersion="200"
                 Compressed="yes"
                 InstallScope="perMachine"/>

installation is fine but when i am uninstalling its asking admin permission

Can get what is problem with my code and any solution for the same.


Solution

  • This is because your custom action is also run on uninstall. The following condition would execute you CA always except on uninstall.

    <Custom Action="EXECUTE_AFTER_FINALIZE" Before="InstallFinalize">NOT REMOVE</Custom>