Skip to content

+semver:minor Added PrivacyDlg to allow control over analytics tracking#1493

Open
tombogle wants to merge 17 commits intomasterfrom
add-dlg-for-analytics-opt-out
Open

+semver:minor Added PrivacyDlg to allow control over analytics tracking#1493
tombogle wants to merge 17 commits intomasterfrom
add-dlg-for-analytics-opt-out

Conversation

@tombogle
Copy link
Copy Markdown
Contributor

@tombogle tombogle commented Mar 2, 2026

Added new SIL.Installer package for common installer components. Includes a Privacy dialog to enable users to opt out of analytics reporting.
Added two public members currently just used in Test App but potentially useful elsewhere:

  • PathUtilities.ParentDirectories extension method.
  • FileLocationUtilities.DistFilesFolderPath property.

Added elements to TestApp to exercise the new Privacy dialog

Added installer for SIL.Windows.Forms.TestApp - not intended for deployment, just a testbed for the wxs files in SIL.Installer

Added elements to TestApp to exercise the new Privacy dialog


Open with Devin

This change is Reviewable

…tics tracking is allowed

Added elements to TestApp to exercise the new Privacy dialog
@tombogle tombogle self-assigned this Mar 2, 2026
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 2, 2026

Palaso Tests

     4 files  ±0       4 suites  ±0   10m 12s ⏱️ -1s
 5 095 tests ±0   4 861 ✅  - 1  234 💤 +1  0 ❌ ±0 
16 597 runs  ±0  15 876 ✅  - 2  721 💤 +2  0 ❌ ±0 

Results for commit 751a8f3. ± Comparison against base commit ce83cef.

This pull request skips 1 test.
SIL.Tests.IO.FileLocationUtilitiesTests ‑ LocateInProgramFiles_SendValidProgramDeepSearch_ReturnsProgramPath

♻️ This comment has been updated with latest results.

Comment thread SIL.Windows.Forms/Privacy/PrivacyDlg.Designer.cs
Comment thread SIL.Windows.Forms/Privacy/PrivacyDlg.Designer.cs
@tombogle
Copy link
Copy Markdown
Contributor Author

tombogle commented Mar 2, 2026

image

@tombogle
Copy link
Copy Markdown
Contributor Author

tombogle commented Mar 2, 2026

image

Copy link
Copy Markdown
Contributor Author

@tombogle tombogle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tombogle made 2 comments and resolved 2 discussions.
Reviewable status: 0 of 11 files reviewed, all discussions resolved (waiting on andrew-polk, mark-sil, and megahirt).

Comment thread SIL.Windows.Forms/Privacy/PrivacyDlg.Designer.cs
Comment thread SIL.Windows.Forms/Privacy/PrivacyDlg.Designer.cs
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor Author

@tombogle tombogle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tombogle made 1 comment.
Reviewable status: 0 of 12 files reviewed, 3 unresolved discussions (waiting on andrew-polk, mark-sil, and megahirt).

Comment thread SIL.Windows.Forms/Privacy/AnalyticsProxy.cs Outdated
devin-ai-integration[bot]

This comment was marked as resolved.

…omponents. Includes a Privacy dialog to enable users to opt out of analytics reporting.

Added PathUtilities.ParentDirectories extension method.
Added FileLocationUtilities.DistFilesFolderPath extension method.
Added installer for SIL.Windows.Forms.TestApp - not intended for deployment, just a testbed for the wxs files in SIL.Installer
@tombogle tombogle force-pushed the add-dlg-for-analytics-opt-out branch from b81717a to a579667 Compare March 26, 2026 05:12
devin-ai-integration[bot]

This comment was marked as resolved.

…rPath set by app.

This addresses a concern raised by Devin (which in practice is probably not really a problem).
@tombogle tombogle force-pushed the add-dlg-for-analytics-opt-out branch from 4cc5955 to 38929ff Compare March 26, 2026 21:14
@tombogle tombogle force-pushed the add-dlg-for-analytics-opt-out branch from 38929ff to df546f8 Compare March 26, 2026 21:24
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View 16 additional findings in Devin Review.

Open in Devin Review

Comment thread SIL.Installer/Analytics.wxs Outdated
Comment thread TestApps/SIL.Windows.Forms.TestApp/SIL.Windows.Forms.TestApp.csproj
… reinstall

Fixed problem of shared fixed GUID being used across all products
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 19 additional findings in Devin Review.

Open in Devin Review

Comment thread SIL.Installer/Analytics.wxs Outdated
Comment on lines +81 to +90
<Component Id="GlobalAnalyticsSetting" Guid="{5D729D52-F0E1-443F-AA40-664AA754F1C1}">
<Condition><![CDATA[SIL_ANALYTICS_APPLY_GLOBALLY = "1"]]></Condition>
<RegistryKey Root="HKCU" Key="$(var.GlobalAnalyticsRegistryKey)">
<RegistryValue
Name="Enabled"
Type="integer"
Value="[SIL_ANALYTICS_ENABLED_GLOBALLY]"
KeyPath="yes" />
</RegistryKey>
</Component>
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 WiX GlobalAnalyticsSetting component uses fixed GUID shared across all SIL products

The GlobalAnalyticsSetting component at line 81 uses a hardcoded GUID {5D729D52-F0E1-443F-AA40-664AA754F1C1} so all SIL products share ownership of the global Software\SIL\Analytics registry key. MSI reference counting means the key is only removed when the last product referencing it is uninstalled. However, the component condition SIL_ANALYTICS_APPLY_GLOBALLY = "1" is evaluated per-product on each install/upgrade. If a product was previously installed with this condition true (global applied) and on reinstall the condition becomes false (e.g., user set a product-specific override via the C# dialog), MSI could deregister this product's reference to the shared component. If no other SIL product is installed, this would delete the global registry key. This edge case is mitigated by the fact that the C# AnalyticsProxy.Update method (not the installer) is the primary mechanism for changing settings at runtime.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This concern requires two simultaneous conditions:

  1. GLOBAL_ANALYTICS_SETTING is non-null (the shared component is installed for this product)
  2. The Privacy dialog runs and the user unchecks the global checkbox → SIL_ANALYTICS_ENABLED_GLOBALLY becomes null → Transitive schedules removal

But condition 2 can't happen when condition 1 is true, because AnalyticsNavigation.wxs only routes to PrivacyDlg when NOT PRODUCT_ANALYTICS_SETTING AND NOT GLOBAL_ANALYTICS_SETTING. If the global key exists, the dialog is bypassed entirely, the normalization CAs set SIL_ANALYTICS_ENABLED_GLOBALLY from the existing value, and the component condition stays TRUE throughout. The shared component's reference count is never at risk from this code path.

devin-ai-integration[bot]

This comment was marked as resolved.

…not set for the current user in the registry
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 19 additional findings in Devin Review.

Open in Devin Review

Comment on lines +1 to +7
<Project>
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<Product>$(AssemblyName)</Product>
</PropertyGroup>
</Project> No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 New TestApps/Directory.Build.props changes Product metadata for all test apps

This new file overrides <Product> from libpalaso (root Directory.Build.props:7) to $(AssemblyName) for all projects under TestApps/. This affects Application.ProductName in WinForms apps. Currently only SIL.Windows.Forms.TestApp uses Application.ProductName (at Program.cs:72 for the AnalyticsProxy). Other test apps under TestApps/ (ArchivingTestApp, ClipboardTestApp, etc.) don't reference Application.ProductName, so they're not affected functionally. However, their assembly metadata will change, which could affect things like user settings file paths (Application.UserAppDataPath includes ProductName).

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is desirable. In practice, it really shouldn't matter much since these are just test apps. In theory, it could affect another developer's experience in minor ways when re-running a test app, but I doubt it will. Going forward, it just makes more sense for each app to have a distinct identity.

Properly parameterized and documented some overridable installer values.
Added targets to compile the WiX fragments with candle.exe to catch syntax and schema errors early.
Also fixed race condition that causes net462 build to fail
Comment thread .github/workflows/build.yml Fixed
Comment thread .github/workflows/build.yml Fixed
Comment thread SIL.Installer/Analytics.wxs Outdated
Comment on lines +81 to +90
<Component Id="GlobalAnalyticsSetting" Guid="{5D729D52-F0E1-443F-AA40-664AA754F1C1}">
<Condition><![CDATA[SIL_ANALYTICS_APPLY_GLOBALLY = "1"]]></Condition>
<RegistryKey Root="HKCU" Key="$(var.GlobalAnalyticsRegistryKey)">
<RegistryValue
Name="Enabled"
Type="integer"
Value="[SIL_ANALYTICS_ENABLED_GLOBALLY]"
KeyPath="yes" />
</RegistryKey>
</Component>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This concern requires two simultaneous conditions:

  1. GLOBAL_ANALYTICS_SETTING is non-null (the shared component is installed for this product)
  2. The Privacy dialog runs and the user unchecks the global checkbox → SIL_ANALYTICS_ENABLED_GLOBALLY becomes null → Transitive schedules removal

But condition 2 can't happen when condition 1 is true, because AnalyticsNavigation.wxs only routes to PrivacyDlg when NOT PRODUCT_ANALYTICS_SETTING AND NOT GLOBAL_ANALYTICS_SETTING. If the global key exists, the dialog is bypassed entirely, the normalization CAs set SIL_ANALYTICS_ENABLED_GLOBALLY from the existing value, and the component condition stays TRUE throughout. The shared component's reference count is never at risk from this code path.

Copy link
Copy Markdown
Contributor Author

@tombogle tombogle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tombogle made 2 comments and resolved 3 discussions.
Reviewable status: 0 of 31 files reviewed, 1 unresolved discussion (waiting on andrew-polk, mark-sil, and megahirt).

Comment on lines +1 to +7
<Project>
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<Product>$(AssemblyName)</Product>
</PropertyGroup>
</Project> No newline at end of file
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is desirable. In practice, it really shouldn't matter much since these are just test apps. In theory, it could affect another developer's experience in minor ways when re-running a test app, but I doubt it will. Going forward, it just makes more sense for each app to have a distinct identity.

Comment thread TestApps/SIL.Windows.Forms.TestApp/SIL.Windows.Forms.TestApp.csproj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants