@ -1,7 +1,6 @@
using System ;
using System ;
using System.Diagnostics ;
using System.Diagnostics ;
using System.IO ;
using System.IO ;
using System.Linq ;
using System.Security.Principal ;
using System.Security.Principal ;
using System.Threading ;
using System.Threading ;
using amecs.Misc ;
using amecs.Misc ;
@ -14,6 +13,9 @@ namespace amecs.Actions
{
{
private static string _mountedPath ;
private static string _mountedPath ;
private static string _winVer ;
private static string _winVer ;
private static string _win11Setup = "" ;
private static bool _win11 = Environment . OSVersion . Version . Build > = 2 2 0 0 0 ;
private const string ExplorerPatcherId = "D17F1E1A-5919-4427-8F89-A1A8503CA3EB" ;
public static bool DeAme ( )
public static bool DeAme ( )
{
{
@ -64,9 +66,7 @@ Continue? (Y/N): "
try
try
{
{
if ( ( ( string ) key . OpenSubKey ( item ) . GetValue ( "DisplayName" ) ) . Equals ( "Open-Shell" ) )
if ( ( ( string ) key . OpenSubKey ( item ) . GetValue ( "DisplayName" ) ) . Equals ( "Open-Shell" ) )
{
openShellId = item ;
openShellId = item ;
}
}
}
catch
catch
{
{
@ -78,8 +78,7 @@ Continue? (Y/N): "
{
{
ConsoleTUI . OpenFrame . WriteCentered ( "\r\nUninstalling Open-Shell..." ) ;
ConsoleTUI . OpenFrame . WriteCentered ( "\r\nUninstalling Open-Shell..." ) ;
var proc = Process . Start ( "MsiExec.exe" , $"/X{openShellId} /quiet" ) ;
proc . WaitForExit ( ) ;
Process . Start ( "MsiExec.exe" , $"/X{openShellId} /quiet" ) ? . WaitForExit ( ) ;
if ( userSid ! = null )
if ( userSid ! = null )
{
{
@ -156,20 +155,23 @@ Continue? (Y/N): "
key . Close ( ) ;
key . Close ( ) ;
}
}
Thread . Sleep ( 3 0 0 0 ) ;
Program . Frame . Clear ( ) ;
Program . Frame . Clear ( ) ;
ConsoleTUI . OpenFrame . WriteCentered ( "\r\nCompleted initial setup!" , ConsoleColor . Green ) ;
ConsoleTUI . OpenFrame . WriteCentered ( "\r\nCompleted initial setup!" , ConsoleColor . Green ) ;
ConsoleTUI . OpenFrame . WriteCentered ( "\r\nWindows Setup will display as 'Windows Server,' but it's not actually installing Windows Server and is only set as such to bypass hardware requirements." ) ;
Console . WriteLine ( ) ;
ConsoleTUI . OpenFrame . WriteCentered ( "\r\nWaiting 10 seconds and starting..." ) ;
if ( _win11 )
{
ConsoleTUI . OpenFrame . WriteCentered ( "\r\nWindows Setup will display as 'Windows Server,' but it's not actually installing Windows Server and is only set as such to bypass hardware requirements." ) ;
Console . WriteLine ( ) ;
}
ConsoleTUI . OpenFrame . WriteCentered ( "\r\nWaiting 10 seconds and starting Windows Setup..." ) ;
Console . ForegroundColor = fc ;
Console . ForegroundColor = fc ;
Thread . Sleep ( 1 0 0 0 0 ) ;
Thread . Sleep ( 1 0 0 0 0 ) ;
Console . WriteLine ( ) ;
Console . WriteLine ( ) ;
try
try
{
{
Process . Start ( Path . Combine ( _mountedPath , "setup.exe" ) , "/Auto Upgrade /DynamicUpdate Disable /Product Server" ) ;
if ( _win11 ) _win11Setup = "/Product Server" ;
Process . Start ( Path . Combine ( _mountedPath , "setup.exe" ) , $"/Auto Upgrade /DynamicUpdate Disable {_win11Setup}" ) ;
} catch ( Exception e )
} catch ( Exception e )
{
{
ConsoleTUI . OpenFrame . Close (
ConsoleTUI . OpenFrame . Close (