How can I add digital signature to uninstaller on Windows ?

Comments

2 comments

  • Avatar
    wojciechka

    Creating a signed uninstaller is possible by first installing any project using your version of InstallBuilder, then copying the uninstall.exe file and signing it.

    Next you can deploy your uninstaller along with your installation (for example naming it uninstall-signed.exe) and replace the uninstaller in <postUninstallerCreationActionList>. For example:

    <postUninstallerCreationActionList>
      <wait>
        <ms>3000</ms>
      </wait>
      <copyFile>
        <destination>${installdir}/uninstall.exe</destination>
        <origin>${installdir}/uninstall-signed.exe</origin>
      </copyFile>
      <removeFilesFromUninstaller>
        <files>${installdir}/uninstall-signed.exe</files>
      </removeFilesFromUninstaller>
      <deleteFile>
        <path>${installdir}/uninstall-signed.exe</path>
      </deleteFile>
    </postUninstallerCreationActionList>
    

    The code above will also delete the uninstall-signed.exe and remove it from list of files to uninstall.

    The <wait> action prevents overwriting issues for cases such as antivirus or OS still keeping the uninstall.exe opened.

  • Avatar
    mattatoffleash

    I've wondered about this myself and find the answer interesting. I understand that the uninstaller has to be generated, but the above approach doesn't lend itself to automation. So a way to generate just the uninstaller as a post-build step would be a nice future feature. It would be convenient not to do a full install on the build machine, so maybe a command line option for generated installers.... Thanks.

Please sign in to leave a comment.