I created a minifilter driver for log /block file access. and need install the driver use visual studio setup project.
Create custom action for install/uninstall .INF driver.
rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 .\xxx.inf
rundll32 setupapi,InstallHinfSection DefaultUninstall 132 " +chr(34) + installdir +"Drivers\xxx.inf" + chr(34)
Function InstallDriver()
on error resume next
Dim WshShellInstallTest, oExec ,windowsdir
Set WshShellInstallTest = CreateObject("WScript.Shell")
if (Err.Number <> 0) Then
MsgBox "WScript.Shell" & Err.Number & " " & Err.Description
Err.Clear
end if
Dim installdir
installdir = Session.Property("CustomActionData")
if (Err.Number <> 0) Then
MsgBox "CustomActionData" & Err.Number & " " & Err.Description
Err.Clear
end if
WshShellInstallTest.CurrentDirectory = installdir + "Drivers"
Dim InstallUtilPath
'InstallUtilPath = "rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 " + chr(34) +installdir+ "Drivers\xxx.inf" + chr(34)
InstallUtilPath = "rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 .\xxx.inf"
MsgBox InstallUtilPath
WshShellInstallTest.Run InstallUtilPath , 0, true
if (Err.Number <> 0) Then
MsgBox "WshShell" & Err.Number & " " & Err.Description
Err.Clear
end if
set WshShellInstallTest = nothing
End Function
Function UnInstallDriver()
on error resume next
Dim WshShellInstallTest, oExec ,windowsdir
Set WshShellInstallTest = CreateObject("WScript.Shell")
if (Err.Number <> 0) Then
MsgBox "WScript.Shell" & Err.Number & " " & Err.Description
Err.Clear
end if
Dim installdir
installdir = Session.Property("CustomActionData")
if (Err.Number <> 0) Then
MsgBox "CustomActionData" & Err.Number & " " & Err.Description
Err.Clear
end if
WshShellInstallTest.CurrentDirectory = installdir + "Drivers"
Dim InstallUtilPath
InstallUtilPath = "Fltmc unload bfaccess"
WshShellInstallTest.Run InstallUtilPath , 0, true
InstallUtilPath = "rundll32 setupapi,InstallHinfSection DefaultUninstall 132 " +chr(34) + installdir +"Drivers\xxx.inf" + chr(34)
if (Err.Number <> 0) Then
MsgBox "WshShell" & Err.Number & " " & Err.Description
Err.Clear
end if
set WshShellInstallTest = nothing
End Function