none
MSI Driver Installation using DPInst RRS feed

  • Question

  • Hello,

    I have an msi I created with the visual studio setup project in VS2015.  I created a custom action DPInstWrapper.exe to call DPInst to install the driver (I can't call DPinst directly as the custom action because it returns 1 on success which is an error to msi).  The custom action exe simply does a system(".\\DPinst.exe") call to start it up.  The system() call returns 1 as if DPInst executed successfully, but I never see the normal driver installation dialogues and the driver does not get installed (my device never appears in Device Manager).  If I execute the DPInstWrapper manually (double click in File Explorer), I see the driver installation dialogues and the driver gets installed.

     Does anyone have any ideas on why it does not work through the setup.msi?  I've included the wrapper exe code below- I know it runs because the WrapperLog.log file gets created and I see the debug prints.

    Thanks in advance

    int main()
    {
    int iResult;
    char cErrBuf[1024];
    FILE *fp;

    fopen_s(&fp,"C:\\MyDriverDebug\\WrapperLog.log", "w+");
    if (fp)
    fwrite("Installing Driver......",23,1,fp);
    iResult= system(".\\DPInst.exe");
    if ((iResult & 0xFFFFFF00) == 0)
    {
    sprintf_s(cErrBuf, 1024, "TSync Driver successfully installed: %d\n", iResult);
    if (fp)
    fwrite(cErrBuf,strlen(cErrBuf),1, fp);
    iResult = 0;
    }
    else
    {
    sprintf_s(cErrBuf, 1024, "Driver installation failed: %d\n", iResult);
    if (fp)
    fwrite(cErrBuf,strlen(cErrBuf), 1,fp);
    }

    if (fp)
    fclose(fp);
        return iResult;
    }

    Wednesday, October 7, 2015 3:18 PM

Answers

  • When you do system(".\\DPInst.exe")  ensure that the current drive and directory is where the dpinst.exe is located. Or make an absolute file path.

    -- pa

    Wednesday, October 7, 2015 4:08 PM

All replies

  • you can look in setupapi.dev.log to see if there was any install activity that resulted in the invocation. you can use process explorer to see if your dpinst.exe was actually invoked.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, October 7, 2015 5:27 PM
  • Yes- about 30 seconds after I submitted the question I thought of that.  Sure enough, the MSI starts up the custom action with the current directory being C:\Windows\System32 directory. I assumed (incorrectly) the current directory would be where the custom action exe was located.  Because I install the two exe's in the same folder, I was able to get the path to the exe and then append DPInst.exe to it to execute it properly.

    Thanks.

    Wednesday, October 7, 2015 8:30 PM