Skip to content

Commit

Permalink
Finalize installer/analytics handling
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Oct 2, 2024
1 parent 6cb1ca6 commit 75f8be2
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Bloxstrap/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static async void SendStat(string key, string value)

try
{
await HttpClient.GetAsync($"https://bloxstrapabs.com/metrics/post?key={key}&value={value}");
await HttpClient.GetAsync($"https://bloxstraplabs.com/metrics/post?key={key}&value={value}");
}
catch (Exception ex)
{
Expand Down
6 changes: 6 additions & 0 deletions Bloxstrap/Installer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ internal class Installer

public bool CreateStartMenuShortcuts = true;

public bool EnableAnalytics = true;

public bool IsImplicitInstall = false;

public string InstallLocationError { get; set; } = "";
Expand Down Expand Up @@ -88,9 +90,13 @@ public void DoInstall()
App.State.Load(false);
App.FastFlags.Load(false);

App.Settings.Prop.EnableAnalytics = EnableAnalytics;

if (!String.IsNullOrEmpty(App.State.Prop.Studio.VersionGuid))
WindowsRegistry.RegisterStudio();

App.Settings.Save();

App.Logger.WriteLine(LOG_IDENT, "Installation finished");

if (!IsImplicitInstall)
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/Resources/Strings.Designer.cs

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

2 changes: 1 addition & 1 deletion Bloxstrap/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ Please manually delete Bloxstrap.exe from the install location or try restarting
<value>Enable sending of analytics</value>
</data>
<data name="Menu.Bloxstrap.Analytics.Description" xml:space="preserve">
<value>All data sent is completely anonymous. To understand what data we use and how, see our [privacy policy]({0}).</value>
<value>It's anonymous and nothing evil, promise. For insight on what we collect and why, see our [privacy policy]({0}).</value>
</data>
<data name="Common.Analytics" xml:space="preserve">
<value>Analytics</value>
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/UI/Elements/Installer/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
xmlns:local="clr-namespace:Bloxstrap.UI.Elements.Installer"
mc:Ignorable="d"
Title="{x:Static resources:Strings.Installer_Title}"
Height="540" Width="840"
Height="540" Width="840" MinWidth="840"
Background="{ui:ThemeResource ApplicationBackgroundBrush}"
ExtendsContentIntoTitleBar="True"
WindowBackdropType="Mica"
Expand Down
21 changes: 14 additions & 7 deletions Bloxstrap/UI/Elements/Installer/Pages/InstallPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,22 @@
<TextBlock FontSize="20" FontWeight="SemiBold" Text="{x:Static resources:Strings.Common_Shortcuts}" TextWrapping="Wrap" Margin="0,16,0,0" />
<TextBlock FontSize="14" Text="{x:Static resources:Strings.Installer_Install_Shortcuts_Description}" TextWrapping="Wrap" />

<controls:OptionControl
Header="{x:Static resources:Strings.Common_Shortcuts_Desktop}">
<ui:ToggleSwitch IsChecked="{Binding CreateDesktopShortcuts, Mode=TwoWay}" />
</controls:OptionControl>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<controls:OptionControl
<controls:OptionControl Grid.Column="0" Margin="0,0,4,0"
Header="{x:Static resources:Strings.Common_Shortcuts_Desktop}">
<ui:ToggleSwitch IsChecked="{Binding CreateDesktopShortcuts, Mode=TwoWay}" />
</controls:OptionControl>

<controls:OptionControl Grid.Column="1" Margin="4,0,0,0"
Header="{x:Static resources:Strings.Common_Shortcuts_StartMenu}">
<ui:ToggleSwitch IsChecked="{Binding CreateStartMenuShortcuts, Mode=TwoWay}" />
</controls:OptionControl>
<ui:ToggleSwitch IsChecked="{Binding CreateStartMenuShortcuts, Mode=TwoWay}" />
</controls:OptionControl>
</Grid>

<TextBlock FontSize="20" FontWeight="SemiBold" Text="{x:Static resources:Strings.Common_Analytics}" TextWrapping="Wrap" Margin="0,16,0,0" />
<controls:MarkdownTextBlock FontSize="14" MarkdownText="{Binding Source={x:Static resources:Strings.Menu_Bloxstrap_Analytics_Description}, Converter={StaticResource StringFormatConverter}, ConverterParameter='https://github.com/pizzaboxer/bloxstrap/wiki/Privacy-Policy#analytical-functionality'}" TextWrapping="Wrap" />
Expand Down
4 changes: 2 additions & 2 deletions Bloxstrap/UI/ViewModels/Installer/InstallViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public bool CreateStartMenuShortcuts

public bool AnalyticsEnabled
{
get => App.Settings.Prop.EnableAnalytics;
set => App.Settings.Prop.EnableAnalytics = value;
get => installer.EnableAnalytics;
set => installer.EnableAnalytics = value;
}

public ICommand BrowseInstallLocationCommand => new RelayCommand(BrowseInstallLocation);
Expand Down

0 comments on commit 75f8be2

Please sign in to comment.