3

Hi I'm command "runas /env /user:administrator "certutil -addstore root myrootca.cer" When I use this command in command prompt it is asking for the administrator password but when integrating it in NSI script the pop up for running command come and disappears but doesn't ask for the password hence the command fails and could not install the certificate. Please provide the solution Thanks in advance

Bhushan
  • 316
  • 1
  • 7
  • 15
  • 1
    Take a look at [a sample on how to install certificate within NSIS script](http://nsis.sourceforge.net/Import_Root_Certificate) – Guy Jun 19 '12 at 12:47
  • Try using [ExecWait](http://www.nullsoft.com/free/nsis/makensis.htm#ExecWait) to accomplish this. If this doesn't help, please post your actual code snippet. – Eternal Learner Jan 06 '11 at 11:32
  • I tried both ExecWait and Exec by executing the command directly or by creating the batch file but it doesn't work even after creating executing the exe file created with NSI script with administrator rights Thanks – Bhushan Jan 06 '11 at 12:03

1 Answers1

0

You should run the whole installer as admin, not just a single command. And what if there is no user named administrator on the system?

Anders
  • 97,548
  • 12
  • 110
  • 164
  • I tried installing the whole installer with admin rights but it's not working. Every system has a admin account. – Bhushan Jan 08 '11 at 04:13
  • yes, every system has a admin account but the username could be anything. When running the installer as admin, the command should be something like ExecWait '"c:\somepath\certutil.exe" -addstore root "c:\someotherpathmaybe\myrootca.cer"' or use a plugin like nsExec if you don't want to show the console window – Anders Jan 08 '11 at 04:25
  • Link no longer works, but `certutil -addstore root file.cer` works if run from an administrator privilege `cmd`. – DustWolf Oct 29 '20 at 08:48