Winamp & Shoutcast Forums Questions: About how to Import root certificate

 27th October 2020, 12:01 #1 bankeris Junior Member   Join Date: Feb 2014 Posts: 27 Questions: About how to Import root certificate Hello, I have bought Certificate for my Excel VSTO Project which is built with VisualStudio. Also seller gave me tool to sign .dll, .exe and other files with SHA256. To make my Add-In work on Excel I need to import root certificate. I found this thread: https://nsis.sourceforge.io/Import_Root_Certificate Question 1: I need to put whole Function to my .nsis project? or its enough only this code code:Push C:\path\to\certificate.cer Call AddCertificateToStore Pop $0${If} $0 != success MessageBox MB_OK "import failed:$0" ${EndIf} Question 2: My update installer uses "RequestExecutionLevel user". Can user import root certificate without having administrator rights? Question 3: I Don't understand how to download latest NSIS version-> 3.06.1, it opens virstotal web, and nothing to click for a download. Or from now we need to create account there for a download? Or I'm just missing something obvious?  27th October 2020, 12:10 #2 bankeris Junior Member Join Date: Feb 2014 Posts: 27 Since I can't edit my post. Forget Question 3.  27th October 2020, 12:30 #3 Anders Moderator Join Date: Jun 2002 Location:${NSISDIR} Posts: 5,355 1) You need the whole function. 2) There are user and machine certs but that code installs it for the machine and you must request admin rights. 3) No idea, looks like a normal Sourceforge download to me, just go to nsis.sf.net. The thread here on the forum is something else. IntOp $PostCount$PostCount + 1
 27th October 2020, 13:33 #4 bankeris Junior Member   Join Date: Feb 2014 Posts: 27 Thanks for fast response. I also found that I don't need to install certificate into Machine, CurrentUser will do fine. Can you help to change Function code to make it install for "CurrentUser" and Certificate must Install under "Trusted Publisher" ? I found some C# example and tested on Console(.exe) and it worked. But it would be nice if NSIS could do this. code:using System.Security.Cryptography.X509Certificates; X509Store store = new X509Store(StoreName.TrustedPublisher, StoreLocation.CurrentUser); store.Open(OpenFlags.ReadWrite); X509Certificate2Collection collection = new X509Certificate2Collection(); X509Certificate2 cert = new X509Certificate2("MyCertLocation.cer"); store.Add(cert); store.Close();
 27th October 2020, 13:40 #5 Anders Moderator     Join Date: Jun 2002 Location: ${NSISDIR} Posts: 5,355 You can look at the parameters for these functions on MSDN. IntOp$PostCount \$PostCount + 1