Cleanup new shortcuts functionality

Remove old obsolete option and ensure uninstaller deletes all the new shortcuts
This commit is contained in:
pizzaboxer 2024-08-13 00:14:50 +01:00
parent 7e95fb4d8f
commit ab2f5f589a
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
7 changed files with 14 additions and 39 deletions

View File

@ -242,9 +242,21 @@ namespace Bloxstrap
}
#endif
var cleanupSequence = new List<Action>
{
() => File.Delete(DesktopShortcut),
() =>
{
foreach (var file in Directory.GetFiles(Paths.Desktop).Where(x => x.EndsWith("lnk")))
{
var shortcut = ShellLink.Shortcut.ReadFromFile(file);
if (shortcut.ExtraData.EnvironmentVariableDataBlock?.TargetUnicode == Paths.Application)
File.Delete(file);
}
},
() => File.Delete(StartMenuShortcut),
() => Directory.Delete(Paths.Versions, true),

View File

@ -26,7 +26,7 @@ namespace Bloxstrap.Models.SettingTasks
if (NewState)
Shortcut.Create(Paths.Application, ExeFlags, ShortcutPath);
else
else if (File.Exists(ShortcutPath))
File.Delete(ShortcutPath);
OriginalState = NewState;

View File

@ -11,7 +11,6 @@ namespace Bloxstrap.Models
public string BootstrapperIconCustomLocation { get; set; } = "";
public Theme Theme { get; set; } = Theme.Default;
public bool CheckForUpdates { get; set; } = true;
public bool CreateDesktopIcon { get; set; } = true;
public bool ConfirmLaunches { get; set; } = false;
public string Locale { get; set; } = "nil";
public bool ForceRobloxLanguage { get; set; } = false;

View File

@ -1790,24 +1790,6 @@ namespace Bloxstrap.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Bloxstrap will place an icon on the desktop that launches Roblox the next time it launches..
/// </summary>
public static string Menu_Behaviour_CreateDesktopIcon_Description {
get {
return ResourceManager.GetString("Menu.Behaviour.CreateDesktopIcon.Description", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Create desktop icon.
/// </summary>
public static string Menu_Behaviour_CreateDesktopIcon_Title {
get {
return ResourceManager.GetString("Menu.Behaviour.CreateDesktopIcon.Title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Configure what Bloxstrap should do when launching..
/// </summary>

View File

@ -557,12 +557,6 @@ Would you like to upgrade your currently installed version?</value>
<data name="Menu.Behaviour.ConfirmLaunches.Title" xml:space="preserve">
<value>Prompt to confirm when launching another Roblox instance</value>
</data>
<data name="Menu.Behaviour.CreateDesktopIcon.Description" xml:space="preserve">
<value>Bloxstrap will place an icon on the desktop that launches Roblox the next time it launches.</value>
</data>
<data name="Menu.Behaviour.CreateDesktopIcon.Title" xml:space="preserve">
<value>Create desktop icon</value>
</data>
<data name="Menu.Behaviour.Description" xml:space="preserve">
<value>Configure what Bloxstrap should do when launching.</value>
</data>

View File

@ -17,12 +17,6 @@
<StackPanel Margin="0,0,14,14">
<TextBlock Margin="0,0,0,8" Text="{x:Static resources:Strings.Menu_Behaviour_Description}" FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
<controls:OptionControl
Header="{x:Static resources:Strings.Menu_Behaviour_CreateDesktopIcon_Title}"
Description="{x:Static resources:Strings.Menu_Behaviour_CreateDesktopIcon_Description}">
<ui:ToggleSwitch IsChecked="{Binding CreateDesktopIcon, Mode=TwoWay}" />
</controls:OptionControl>
<controls:OptionControl
Header="{x:Static resources:Strings.Menu_Behaviour_AutoUpdate_Title}"
Description="{x:Static resources:Strings.Menu_Behaviour_AutoUpdate_Description}">

View File

@ -5,12 +5,6 @@
private string _oldPlayerVersionGuid = "";
private string _oldStudioVersionGuid = "";
public bool CreateDesktopIcon
{
get => App.Settings.Prop.CreateDesktopIcon;
set => App.Settings.Prop.CreateDesktopIcon = value;
}
public bool UpdateCheckingEnabled
{
get => App.Settings.Prop.CheckForUpdates;