I am facing an issue where antivirus of my machine is showing alert while uninstalling my application. Antivirus is saying that uninstall.exe is not signed. My installer is signed but uninstall.exe created after installation is not signed.

Please suggest that what would be the right approach to avoid this issue.

asked 18 Feb '15, 02:02

SuryaSingh's gravatar image

SuryaSingh
126434349
accept rate: 55%


Unfortunately InstallBuilder does not currently allow signing uninstallers.

However, this can be easily resolved. The uninstaller binary does not contain any metadata and is simply a generic binary that can be overwritten by a signed one.

First thing is to create and install any project using your version of InstallBuilder (preferably with also the uninstall.exe windows resources such as application name being set properly), then use the created uninstaller.exe and sign it.

Next the signed uninstaller should be part of files copied by the installer, but with a different name - such as uninstall-signed.exe.

Finally the installer should 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.

link

answered 18 Feb '15, 03:22

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

if we use this approach, do we have to remake the uninstall.exe for every release/version of the project or the same uninstall.exe that we sign to be uninstall-signed.exe can uninstall different versions of the .exe if they are relative location in the same root installpath???

(28 Feb, 12:07) codeForFun

Hi,

I have installed installer on system and copy uninstaller file at other location. When i am signing the uninstall.exe file with certificate, it throw an error:

SignTool Error: SignedCode::Sign returned error: 0x80070057 The parameter is incorrect. SignTool Error: An error occurred while attempting to sign: C:\Documents\uninstall-signed.exe

Can you please help me to signing the unsintaller.exe with digiat certificate.

Regards, Rishu

link

answered 31 Aug '15, 09:30

Rishu's gravatar image

Rishu
1444
accept rate: 0%

Hi Rishu,

Could you provide us which command are you using to signed the uninstaller file? Also, could you check that the uninstaller is not already signed?

link

answered 01 Sep '15, 12:01

jesus's gravatar image

jesus ♦♦
1.1k14
accept rate: 18%

I have used the command : signtool sign /v /ac "DigiCert.cer" /f "certificate.pfx" /p password "uninstall.exe". Yes, i have verified that uninstaller.exe is not signed in.

Please let me know in case of any other details required.

link

answered 03 Sep '15, 00:34

Rishu's gravatar image

Rishu
1444
accept rate: 0%

Could you add the option "/d" to enable the debug? Please find below the link to the official documentation of this tool: https://msdn.microsoft.com/en-us/library/windows/desktop/aa387764(v=vs.85).aspx

You could also try to use the "osslsigncode" tool: http://sourceforge.net/projects/osslsigncode/

link

answered 03 Sep '15, 12:52

alejandror's gravatar image

alejandror ♦♦
1.3k127
accept rate: 31%

same signing problem - the uninstaller doesn't appear to work with the microsoft signtool. has anyone from installerbuidler actually tried to run this command?

signtool sign /d /v /tr http://timestamp.digicert.com /td sha256 /fd sha256 /f "cert.pfx" /p password "uninstall-signed.exe" Done Adding Additional Store SignTool Error: SignedCode::Sign returned error: 0x800700C1 Either the file being signed or one of the DLL specified by /j switch is not a valid Win32 application. SignTool Error: An error occurred while attempting to sign: uninstall-signed.exe

Number of errors: 1

link

answered 01 Mar, 09:44

codeForFun's gravatar image

codeForFun
11
accept rate: 0%

figured it out by following this post -- @MichaelKarnerfor -- THANKS FOR THIS SOLUTION!

THE TRICK IS THE INSTALLER THAT INSTALLS THE UNINSTALLER, MUST NOT-BE-SIGNED SO YOU ARE SIGNING AN UNINSTALLER THAT CAME FROM AN INSTALLER THAT WAS NOT SIGNED...

once you get that uninstaller signed, then you can follow the plan and include it into the project as a signed uninstaller and overwrite the generated installer...

see below

== from another forum ==

http://forums.winamp.com/showthread.php?t=344726

Hi guys.

This may sound like the strangest solution, but for me it worked if I did not sign the installer that wrote the uninstaller.

So this would be the procedure:

1) Make an installer that writes the uninstaller. DO NOT SIGN THIS INSTALLER. 2) Run the installer. This creates the uninstaller. 3) Sign the uninstaller. 4) Make the installer again, this time including the signed uninstaller as a "File" operation instead of writing the uninstaller with "WriteUninstaller". 5) Sign this installer.

This is totally weird... but it worked for me. With a signed installer writing the uninstaller, I cannot sign the uninstaller. I get the 0x800700C1 error.

But if I have used an unsigned installer to write the uninstaller, then I can sign the uninstaller.

Hope this helps you guys. BR /Michael

link

answered 01 Mar, 09:56

codeForFun's gravatar image

codeForFun
11
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×83
×20

Asked: 18 Feb '15, 02:02

Seen: 1,830 times

Last updated: 01 Mar, 09:56