Announcement

Collapse
No announcement yet.

Install USB driver / .inf file - pnputil fails

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Install USB driver / .inf file - pnputil fails

    Hi,

    I want to install an USB driver via its .inf file using NSIS. I found a Wiki-entry regarding this that recommended to use Microsofts pnputil to add the .inf file to the driver storage.

    Unfortunately pnputil fails, it cancels the operation with an error message "Access denied". This is strange because I have administrator privileges.

    So what can I do - how can I pre-install a driver/.inf file so that it is used as soon as the related device is attached?

    Elmi

  • #2
    What version of Windows are you using?
    For W2k and XP use these plug-ins: http://nsis.sourceforge.net/Driver_i...ion_and_update and http://nsis.sourceforge.net/InstDrv_plug-in

    For Vista and later PnPUtil is better.
    Cool looking installers with custom design: www.graphical-installer.com
    Create Setup Pages easily: www.install-designer.com
    Build installers in Visual Studio 2005-2022: www.visual-installer.com
    or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com

    Comment


    • #3
      Hi,

      I'm using Win 7

      Comment


      • #4
        Hi,

        I think I found the reason:

        when executing pnputil within NSIS using command "Exec" it is NOT executed with administrator privileges although I previously called "RequestExecutionLevel admin".

        So how can I execute pnputil WITH admin privileges correctly?

        Comment


        • #5
          Are you sure you have administrative access? Note that requestexecutionlevel admin is NOT sufficient to guarantee it - you need to use the userinfo plugin (in .onInit) to verify!

          Comment


          • #6
            I'm sure I don't have administrative access because pnputil fails. Therefore my question: how can I get administrative privileges for "Exec" calls?

            Comment


            • #7
              May be I have to be more detailled:

              When using "pnputil" manually I have to run a "cmd.exe" as administrator, elsewhere pnputil fails.

              So to execute pnputil out of a NSIS installer I currently execute it using "Exec". But this does not seem to execute it within a "cmd" that has administrator privileges.

              So how can I "Exec" it correctly so that the underlying command line environment has the same privileges like a "cmd.exe" that is executed with administrator privileges?

              Comment


              • #8
                If your installer isn't at admin level, the pnputil also will not be executed at admin level. To make sure the installer's child processes are admin, make sure the installer is admin. To do this, use the userinfo plugin.

                Comment


                • #9
                  Originally Posted by MSG View Post
                  make sure the installer is admin. To do this, use the userinfo plugin.
                  OK, it tells me I'm not Admin - how do I change that?

                  Comment


                  • #10
                    Simplest approach is to bring up a message box and tell the user they must run the installer as an administrator using Run As (and then exit). Another option is you could run the installer again using ExecShell with the runas verb. Last option I suppose is to use the UAC plug-in.

                    Stu

                    Comment


                    • #11
                      Originally Posted by Afrow UK View Post
                      Simplest approach is to bring up a message box and tell the user they must run the installer as an administrator using Run As (and then exit).
                      OK, in this case we're back to my original problem: running the installer as Administrator DOES NOT cause pnputil to work properly since the command line that is spawned from such an installer seems not to inherit its privileges!

                      Comment


                      • #12
                        Save yourself the trouble and use DPInst instead, we've wasted our time with several approaches and after having tried them "all" we went with DPInst. In fact at this point we are very glad to have used as it also allows easy un-installation of specific driver versions.

                        Comment


                        • #13
                          I can confirm Theresias words: PnPUtil is not working correctly in some cases.
                          I made drivers installer some time ago and it was too difficult to find out why is PnPUtil causing troubles so I switched to DPInst.

                          Use DPInst - there is simple example here: http://blogs.technet.com/b/svengruen...pinst-exe.aspx
                          Also all necessary files are there so you do not need to download whole SDK package.
                          Cool looking installers with custom design: www.graphical-installer.com
                          Create Setup Pages easily: www.install-designer.com
                          Build installers in Visual Studio 2005-2022: www.visual-installer.com
                          or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com

                          Comment


                          • #14
                            Hi Guys

                            I am having the same problem trying to install an inf file using utilpnp but not succeeding using NSIS.

                            Someone said use DPInst but did not provide directions.

                            I would prefer to use utilpnp because when I type in the command, the inf file is installed. I just need to be able to do it from within the script. Hence my Installer user will not need to run the script.

                            Please help

                            Comment


                            • #15
                              Did you solve this problem. How did you solve it. I am having the same problem.

                              Thanks

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎