Search code examples
installationdriverinno-setup

Install drivers with rundll32 or dpinst in Inno Setup?


I am trying to install drivers with Inno Setup and it looks like there are (at least) two ways to do this: add dpinst.exe to the or run rundll against the .inf file.

I know there is two different version of DPinst for x86 and x64. Are there different version depending on the OS (I need to support XP, Vista and 7)?

Do I need admin permission for these methods?

Which method is recommended?


Solution

  • You use the same DPInst version for all versions of the operating systems; the only distinction is 32-bit vs. 64-bit. The WDK comes with both 32-bit and 64-bit versions.

    Personally, here's what I do (on InnoSetup):

    [Files]
    ...
    Source: ...\dpinst32.exe; DestDir: {#DpInstPath}; DestName: dpinst.exe; \
        Check: not IsWin64; Flags: ignoreversion
    Source: ...\dpinst64.exe; DestDir: {#DpInstPath}; DestName: dpinst.exe; \
        Check: IsWin64; Flags: ignoreversion
    

    Using run32dll setupapi.dll,InstallHinfSection ... is outdated and generally not recommended unless you have some very specific needs.