2

I am creating a jar file using netbeans. Then I create exe of this jar file using lanch4j. When I run this exe file on my computer it's run fine But When I run this exe on some other computer it gives me warning

The publisher could not be verified. Are you want to run this software

When click on Run the exe file runs fine.

enter image description here

I remove that warning by adding certificate to my exe file using signtool.exe which comes with windows sdk. and it successfully added certificate to my exe file.

But now when I run my exe file it gives me error

"Java Virtual Machine Launcher Error: Invalid or Corrupt Jar file"

enter image description here

Plz Help me.

Thanks.

Usman Ali
  • 93
  • 1
  • 3
  • 10
  • 2
    possible duplicate of [How to be a verified publisher?](http://stackoverflow.com/questions/2660814/how-to-be-a-verified-publisher) – tnw Aug 20 '15 at 19:42

3 Answers3

2

This warning gets thrown because your application has not been signed. You didn't see the error on your local machine because you never transmitted the application. You saw it on some other machine presumably because you uploaded it somewhere then downloaded it to the other machine.

Checkout this other question for more info: Signing a Windows EXE file

Community
  • 1
  • 1
dzylich
  • 346
  • 1
  • 14
  • thanks dzylich. I have a certificate with .pfx extention. but I don;t know how to install that certificate to my exe file. – Usman Ali Aug 21 '15 at 04:54
  • I add the certificate to my exe. and it is successfully added but when I run that exe file I gives an error "Java Virtual Machine Launcher Error: Invalid or Corrupt jar file" – Usman Ali Aug 21 '15 at 06:53
  • Hey @UsmanAli, I'm not sure what's causing that error. I am not familiar enough with signing a Java package specifically to know what could cause that. – dzylich Aug 21 '15 at 13:43
  • Thanks for help @dzylich – Usman Ali Aug 22 '15 at 12:03
  • i have sign in by ksign but it still showing error. any other though? – Sumeet Vishwas Jan 31 '20 at 11:20
1

EXE SIGNER FOR JAR WRAPPED INSIDE A EXE USING LAUNCH4J:

1.CERTIFICATION CREATION IS SAME AS NORMAL EXE SIGNER.

makecert -r -pe -ss MyCertStore -n "CN=MyTestCert" MyTestCert.cer

(NOTE:Import this certificate to Trusted certificate part in certmgr.msc in windows.)

Then only It won’t show unknown publisher at local system.

TO VERIFY:

In windows ,Just type certmgr.msc in start window search box, certmgr.msc will prompt on screen, open that and then check whether certificate is successfully imported in Trusted certificate part.)

2.SIGN IN EXE USING SIGNTOOL AND SIGN4J:

sign4j signtool sign /s MyCertStore /n MyTestCert  "sample.exe"
sKhan
  • 9,694
  • 16
  • 55
  • 53
Raghaven
  • 25
  • 6
0

use sign4j to verify launch4j exe.. It avoid jar corruption..

sign4j signtool sign /s MyCertStore /n My_cert sample.exe

verify this link.. It will help you.. Sign a launch4j executable in ant with sign4j and jsign

Community
  • 1
  • 1
Raghaven
  • 25
  • 6