Mark Win11 driver mod as DEBUG and remove published name check

This commit is contained in:
Yoshi Askharoun
2023-08-01 02:04:32 -05:00
parent 6de33b4e84
commit b121adfebc
2 changed files with 4 additions and 21 deletions
+2
View File
@@ -15,7 +15,9 @@ namespace ZuneModCore
public static readonly IReadOnlyList<Mod> AvailableMods = new List<Mod>
{
new VideoSyncMod(),
#if DEBUG
new Win11DriverMod(),
#endif
new FeaturesOverrideMod(),
new WebservicesMod(),
new BackgroundImageMod(),
+2 -21
View File
@@ -73,25 +73,6 @@ namespace ZuneModCore.Mods
}
await enumProc.WaitForExitAsync();
//if (zuneInfPublishedName != null)
//{
// // There may be a corrupted driver from previous attempts,
// // removing it before installing brings better results
// startInfo.Arguments = $"/delete-driver {zuneInfPublishedName} /uninstall";
// Process deleteProc = new()
// {
// StartInfo = startInfo
// };
// deleteProc.Start();
// while (!deleteProc.StandardOutput.EndOfStream)
// {
// string? currentLine = await deleteProc.StandardOutput.ReadLineAsync();
// Debug.WriteLine(currentLine);
// }
// await deleteProc.WaitForExitAsync();
//}
// Copy all .dll.mui files, then install the driver.
// This loop generates a batch script that can run as TrustedInstaller
// to copy all the necessary files to System32. If we don't run this
@@ -124,14 +105,14 @@ namespace ZuneModCore.Mods
// Manually copy files and install the driver
string? installErrorMsg = null;
using (var procInfo = Win32.ExecTI.CreateProcessAsTrustedInstaller(tiSvc, $"cmd /k {installScriptPath}"))
var procInfo = Win32.ExecTI.CreateProcessAsTrustedInstaller(tiSvc, $"cmd /k {installScriptPath}");
{
Debug.WriteLine(procInfo.hProcess.DangerousGetHandle().ToString("X"));
Process installProc = Process.GetProcessById(unchecked((int)procInfo!.dwProcessId));
await installProc.WaitForExitAsync();
if (Vanara.PInvoke.Kernel32.GetExitCodeProcess(procInfo.hProcess, out var exitCode)
&& (exitCode != 0 || exitCode != 0xc000013A))
&& (exitCode != 0 || exitCode != 0xC000013A))
installErrorMsg = "An unknown error occurred while attempting to install driver.";
//Vanara.PInvoke.Kernel32.CloseHandle(procInfo.hProcess.DangerousGetHandle());