MSI installer: Add checkbox and MSI property DISABLE_TELEMETRY to optionally disable telemetry. (#10725)

Co-authored-by: Christoph Bergmeister <christoph.bergmeister@bjss.com>
Co-authored-by: Christoph Bergmeister <christoph.bergmeister@justbeonline.onmicrosoft.com>
Co-authored-by: travis plunk <github@ez13.net>
This commit is contained in:
Christoph Bergmeister
2023-03-06 13:18:34 -08:00
committed by GitHub
co-authored by Christoph Bergmeister Christoph Bergmeister travis plunk
parent efc7385c50
commit 6dfba03aa3
2 changed files with 45 additions and 1 deletions
+7 -1
View File
@@ -154,6 +154,7 @@
<ComponentRef Id="SharedRegistryEntries"/>
<ComponentRef Id="SetPath"/>
<ComponentRef Id="Telemetry"/>
<ComponentRef Id="DisableTelemetry"/>
<ComponentRef Id="ExplorerContextMenu"/>
<ComponentRef Id="PowerShellFileContextMenu"/>
</Feature>
@@ -213,6 +214,10 @@
<RegistryValue Type="string" Value="[VersionFolder]pwsh.exe" KeyPath="yes"/>
</RegistryKey>
</Component>
<Component Id="DisableTelemetry" Guid="{E86F5C91-3721-4C5C-A31F-1F0A5A468573}" KeyPath="yes">
<Condition>DISABLE_TELEMETRY</Condition>
<Environment Id="PowerShellTelemetryOptout" Action="set" Name="POWERSHELL_TELEMETRY_OPTOUT" Permanent="no" System="yes" Value="1"/>
</Component>
<!-- add ourselves to %PATH% so pwsh.exe can be started from Windows PowerShell or cmd.exe -->
<Component Id="SetPath">
<Condition>ADD_PATH=1</Condition>
@@ -320,7 +325,8 @@
<Control Id="AddToPathCheckBox" Type="CheckBox" X="20" Y="60" Width="290" Height="17" Property="ADD_PATH" CheckBoxValue="0" Text="Add $(var.ProductName) to Path Environment Variable"/>
<Control Id="RegisterManifestCheckBox" Type="CheckBox" X="20" Y="80" Width="290" Height="17" Property="REGISTER_MANIFEST" CheckBoxValue="0" Text="Register Windows Event Logging Manifest"/>
<Control Id="EnablePSRemotingCheckBox" Type="CheckBox" X="20" Y="100" Width="290" Height="17" Property="ENABLE_PSREMOTING" CheckBoxValue="0" Text="Enable $(var.ProductName) remoting"/>
<Control Id="ContextMenuOpenPowerShell" Type="CheckBox" X="20" Y="120" Width="290" Height="17" Property="ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL" CheckBoxValue="0" Text="Add '$(var.ExplorerContextSubMenuDialogText)' context menus to Explorer"/>
<Control Id="DisableTelemetry" Type="CheckBox" X="20" Y="120" Width="290" Height="17" Property="DISABLE_TELEMETRY" CheckBoxValue="0" Text="Disable Telemetry (Reboot or Restart of processes may be required)" ToolTip="Sets environment variable POWERSHELL_TELEMETRY_OPTOUT to 1, see https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_telemetry"/>
<Control Id="ContextMenuOpenPowerShell" Type="CheckBox" X="20" Y="140" Width="290" Height="17" Property="ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL" CheckBoxValue="0" Text="Add '$(var.ExplorerContextSubMenuDialogText)' context menus to Explorer"/>
<Control Id="ContextMenuRunPowerShell" Type="CheckBox" X="20" Y="140" Width="290" Height="17" Property="ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL" CheckBoxValue="0" Text="Add '$(var.PowerShellFileContextSubMenuDialogText)' context menu for PowerShell files"/>
<Control Id="LicenseLink" Type="Hyperlink" X="20" Y="190" Width="214" Height="17">
<Text><![CDATA[<a href="https://github.com/PowerShell/PowerShell/blob/master/LICENSE.txt">The application is distributed under the MIT license.</a>]]></Text>