My installer is functional but very slow. The slow part is the execution of the above functions. I tried UpdateDriverForPlugAndPlayDevices and then InstallDriverOnDevice but both just take ages to process.
I have noticed that if I uninstall my driver without removing the driver files (this is possible on Vista and later) then the problem disappears.
How can I speed up installations?
I now add SetupCopyOEMInf() prior to UpdateDriverForPlugAndPlayDevices(). Indeed, the copying/compiling of the installation package is the time consuming part. I wander why it should take 20-30 seconds.