Skip to content

Commit

Permalink
fix uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaProductions committed May 29, 2024
1 parent c7644ac commit a0c2ba2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: msbuild Rectify11Installer.sln /p:Configuration=Release /p:platform=x64

- name: Publish
run: dotnet publish Rectify11Installer -p:PublishProfile=FolderProfile -property:SolutionDir=${{ github.workspace }}\
run: dotnet publish Rectify11Installer -c Release -p:PublishProfile=FolderProfile -property:SolutionDir=${{ github.workspace }}\

- name: Upload Rectify11Installer
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion Rectify11Installer/Core/Backend/Themes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static bool Uninstall()
{
string mode = Theme.IsUsingDarkMode ? "dark.theme" : "aero.theme";
if (File.Exists(Path.Combine(Variables.Windir, "Resources", "Themes", mode)))
Process.Start(Path.Combine(Variables.Windir, "Resources", "Themes", mode));
Helper.RunShellExec(Path.Combine(Variables.Windir, "Resources", "Themes", mode));
string theme = Theme.IsUsingDarkMode ? "Windows (dark)" : "Windows (light)";
RectifyThemeUtil.Utility.ApplyTheme(theme);

Expand Down
38 changes: 29 additions & 9 deletions Rectify11Installer/Core/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Rectify11Installer.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
Expand Down Expand Up @@ -90,19 +91,19 @@ public static StringBuilder FinalText()
if (InstallOptions.iconsList.Contains("gadgetsNode"))
finalstr.AppendLine("+ " + Strings.Rectify11.installGadgets);
else if (UninstallOptions.uninstExtrasList.Contains("gadgetsNode"))
finalstr.AppendLine("- " + Strings.Rectify11.installGadgets);
finalstr.AppendLine("- " + Strings.Rectify11.installGadgets);

if (InstallOptions.iconsList.Contains("wallpapersNode"))
finalstr.AppendLine("+ " + Strings.Rectify11.installWallpapers);
else if (UninstallOptions.uninstExtrasList.Contains("wallpapersNode"))
finalstr.AppendLine("- " + Strings.Rectify11.installWallpapers);
else if (UninstallOptions.uninstExtrasList.Contains("wallpapersNode"))
finalstr.AppendLine("- " + Strings.Rectify11.installWallpapers);

if (InstallOptions.iconsList.Contains("useravNode"))
finalstr.AppendLine("+ " + Strings.Rectify11.installUserAV);
else if (UninstallOptions.uninstExtrasList.Contains("useravNode"))
finalstr.AppendLine("- " + Strings.Rectify11.installUserAV);
else if (UninstallOptions.uninstExtrasList.Contains("useravNode"))
finalstr.AppendLine("- " + Strings.Rectify11.installUserAV);

return finalstr;
return finalstr;
}

public static bool CheckUBR()
Expand Down Expand Up @@ -374,12 +375,31 @@ public static bool SafeDirectoryDeletion(string path, bool ischild)
return false;
}
}
public static void RunAsTI(string file,string param)
public static void RunAsTI(string file, string param)
{
Interaction.Shell(Path.Combine(Variables.r11Folder, "NSudoL.exe")
+ " -U:T -P:E -Wait -UseCurrentConsole " + file
+ " " + param, AppWinStyle.NormalFocus, true);
}
/// <summary>
/// Start process using ShellExecute Api
/// </summary>
/// <param name="v"></param>
/// <exception cref="NotImplementedException"></exception>
internal static void RunShellExec(string proc)
{
try
{
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = proc;
info.UseShellExecute = true;
Process.Start(info).WaitForExit();
}
catch (Exception ex)
{
Logger.Warn("Failed to start process: " + proc + "\n" + ex.ToString());
}
}
#endregion
#region Private Methods
private static bool RebootRequired()
Expand Down Expand Up @@ -451,7 +471,7 @@ public class InstallOptions
public static bool ThemeBlack { get; set; }
public static bool ThemeLight { get; set; }
public static bool ThemePDark { get; set; }
public static bool InstallShell { get; set; }
public static bool InstallShell { get; set; }
public static bool InstallSounds { get; set; }
public static bool SkipMFE { get; set; }
public static bool TabbedNotMica { get; set; }
Expand All @@ -460,7 +480,7 @@ public class InstallOptions
public static List<string> iconsList = new();
public static List<string> origList = new();

public static bool InstallExtras()
public static bool InstallExtras()
{
return InstallEP
|| InstallASDF
Expand Down

0 comments on commit a0c2ba2

Please sign in to comment.