Skip to content

Commit

Permalink
Cleanup new shortcuts functionality
Browse files Browse the repository at this point in the history
Remove old obsolete option and ensure uninstaller deletes all the new shortcuts
  • Loading branch information
pizzaboxer committed Aug 13, 2024
1 parent 7e95fb4 commit ab2f5f5
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 39 deletions.
14 changes: 13 additions & 1 deletion Bloxstrap/Installer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,21 @@ public static void DoUninstall(bool keepData)
}
#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),
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/Models/SettingTasks/ShortcutTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public override void Execute()

if (NewState)
Shortcut.Create(Paths.Application, ExeFlags, ShortcutPath);
else
else if (File.Exists(ShortcutPath))
File.Delete(ShortcutPath);

OriginalState = NewState;
Expand Down
1 change: 0 additions & 1 deletion Bloxstrap/Models/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public class Settings
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;
Expand Down
18 changes: 0 additions & 18 deletions Bloxstrap/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions Bloxstrap/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 0 additions & 6 deletions Bloxstrap/UI/Elements/Settings/Pages/BehaviourPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}">
Expand Down
6 changes: 0 additions & 6 deletions Bloxstrap/UI/ViewModels/Settings/BehaviourViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ public class BehaviourViewModel : NotifyPropertyChangedViewModel
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;
Expand Down

0 comments on commit ab2f5f5

Please sign in to comment.