mirror of
https://github.com/ZuneDev/ZuneModdingHelper.git
synced 2026-07-27 13:12:21 -07:00
Mark Win11 driver mod as DEBUG and remove published name check
This commit is contained in:
@@ -15,7 +15,9 @@ namespace ZuneModCore
|
|||||||
public static readonly IReadOnlyList<Mod> AvailableMods = new List<Mod>
|
public static readonly IReadOnlyList<Mod> AvailableMods = new List<Mod>
|
||||||
{
|
{
|
||||||
new VideoSyncMod(),
|
new VideoSyncMod(),
|
||||||
|
#if DEBUG
|
||||||
new Win11DriverMod(),
|
new Win11DriverMod(),
|
||||||
|
#endif
|
||||||
new FeaturesOverrideMod(),
|
new FeaturesOverrideMod(),
|
||||||
new WebservicesMod(),
|
new WebservicesMod(),
|
||||||
new BackgroundImageMod(),
|
new BackgroundImageMod(),
|
||||||
|
|||||||
@@ -73,25 +73,6 @@ namespace ZuneModCore.Mods
|
|||||||
}
|
}
|
||||||
await enumProc.WaitForExitAsync();
|
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.
|
// Copy all .dll.mui files, then install the driver.
|
||||||
// This loop generates a batch script that can run as TrustedInstaller
|
// 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
|
// 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
|
// Manually copy files and install the driver
|
||||||
string? installErrorMsg = null;
|
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"));
|
Debug.WriteLine(procInfo.hProcess.DangerousGetHandle().ToString("X"));
|
||||||
Process installProc = Process.GetProcessById(unchecked((int)procInfo!.dwProcessId));
|
Process installProc = Process.GetProcessById(unchecked((int)procInfo!.dwProcessId));
|
||||||
await installProc.WaitForExitAsync();
|
await installProc.WaitForExitAsync();
|
||||||
|
|
||||||
if (Vanara.PInvoke.Kernel32.GetExitCodeProcess(procInfo.hProcess, out var exitCode)
|
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.";
|
installErrorMsg = "An unknown error occurred while attempting to install driver.";
|
||||||
|
|
||||||
//Vanara.PInvoke.Kernel32.CloseHandle(procInfo.hProcess.DangerousGetHandle());
|
//Vanara.PInvoke.Kernel32.CloseHandle(procInfo.hProcess.DangerousGetHandle());
|
||||||
|
|||||||
Reference in New Issue
Block a user