Skip to content

Commit afc5273

Browse files
committed
Fix UniGetUI launching on uninstall (fix #2227)
1 parent d06526c commit afc5273

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/UniGetUI/CLIHandler.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public static class CLIHandler
88
public const string HELP = "--help";
99
public const string DAEMON = "--daemon";
1010
public const string MIGRATE_WINGETUI_TO_UNIGETUI = "--migrate-wingetui-to-unigetui";
11+
public const string UNINSTALL_WINGETUI = "--uninstall-wingetui";
12+
public const string UNINSTALL_UNIGETUI = "--uninstall-unigetui";
1113

1214
public const string IMPORT_SETTINGS = "--import-settings";
1315
public const string EXPORT_SETTINGS = "--export-settings";
@@ -221,4 +223,10 @@ public static int WingetUIToUniGetUIMigrator()
221223
return ex.HResult;
222224
}
223225
}
226+
227+
public static int UninstallUniGetUI()
228+
{
229+
// There is currently no uninstall logic. However, this needs to be maintained, or otherwhise UniGetUI will launch on uninstall
230+
return 0;
231+
}
224232
}

src/UniGetUI/EntryPoint.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ private static void Main(string[] args)
2424
int ret = CLIHandler.WingetUIToUniGetUIMigrator();
2525
Environment.Exit(ret);
2626
}
27+
else if (args.Contains(CLIHandler.UNINSTALL_UNIGETUI) || args.Contains(CLIHandler.UNINSTALL_WINGETUI))
28+
{
29+
int ret = CLIHandler.UninstallUniGetUI();
30+
Environment.Exit(ret);
31+
}
2732
else if (args.Contains(CLIHandler.IMPORT_SETTINGS))
2833
{
2934
int ret = CLIHandler.ImportSettings();

0 commit comments

Comments
 (0)