How can I perform a silent uninstallation as part of the upgrade process on Windows?



1 comment

  • Avatar

    You can retrieve the path to the uninstaller from the Windows registry and storing it in an installer variable.

    <!-- In particular, this "${product_fullname} ${product_version}" string will make the installer detect its own previous installation. You will need to change it to match with the program and version you want to uninstall. -->

        <key>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${product_fullname} ${product_version}</key>

    Then, you can execute the path stored in ${uninstaller_path}, in case it exists:

    <!-- run the uninstaller program only if ${uninstaller_path} points to an existing file -->
        <programArguments>--mode unattended</programArguments>

    Similar solutions can be applied to detect a previous installation directory as well.

Please sign in to leave a comment.