Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion assets/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,13 @@
<Component Id="ProductVersionFolder" Guid="{e1a7f05e-0cd6-4227-80a8-e4fb311f045c}">
<CreateFolder/>
</Component>
<!-- register ourselves in application registry so can be started using just Win+R `pwsh.exe` -->
<Component Id="RegistryEntries" Guid="{402e52f7-baf8-489d-af21-f756a6ca3530}">
<!-- create key for easy detection of a particular version of a powershell core package
The upgrade code is used in the key because it will change when we allow SxS -->
<RegistryKey Root="HKLM" Key="Software\Microsoft\PowerShellCore\InstalledVersions\$(var.UpgradeCode)" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
<RegistryValue Type="string" Value="$(var.ProductSemanticVersion)"/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder - what scenario(s) we want address?
It is duplicate of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
(HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall)
We can get the information directly from Registry or by means of WMI Win32_Product.

Copy link
Member Author

@TravisEz13 TravisEz13 Feb 4, 2018

Choose a reason for hiding this comment

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

The uninstall key gives a product code which varies per-version. This change adds a key based on upgrade code, which will change much less frequently.

I need a detection for Microsoft update (MU) that is file (not folder) or registry-based that does not vary per release (6.0.0 vs 6.0.1.) Unfortunately, the MU specs are confidential. The point here is to add a layer of detection before we do WMI or MSI based detection for specific updates because these forms of detection are expensive, excluding machines that have no version of PowerShell Core installed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for clarify!
+1 I don't know better way.

</RegistryKey>
<!-- register ourselves in application registry so can be started using just Win+R `pwsh.exe` -->
<RegistryKey Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\pwsh.exe" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
<RegistryValue Type="string" Value="[$(var.ProductVersionWithName)]pwsh.exe"/>
</RegistryKey>
Expand Down