インストーラーで .inf ベースの USB ドライバーを展開したいと考えています。
.inf を に配置する必要が%SystemRoot%\inf
あると思いますが、.cat (WHQL 認定だと思いますか?) と .sys ファイルもあります。私はそれらをどうしますか?
編集:役立つ回答のおかげで解決しました。関数を P/Invoke できたので、次のコードを実行するインストール後のアクションがあります。
namespace DriverPackageInstallAction
{
static class Program
{
[DllImport("DIFXApi.dll", CharSet = CharSet.Unicode)]
public static extern Int32 DriverPackagePreinstall(string DriverPackageInfPath, Int32 Flags);
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
DirectoryInfo assemblyDir = new DirectoryInfo(Application.ExecutablePath);
DirectoryInfo installDir = assemblyDir.Parent;
int result = DriverPackagePreinstall(installDir.FullName + @"\Driver\XYZ.inf", 0);
if (result != 0)
MessageBox.Show("Driver installation failed.");
}
}
}