Repository navigation
Preserve user shortcuts pinned to Taskbar during MSI upgrade - #9305
Travis Plunk (TravisEz13) merged 2 commits into
Conversation
|
Christoph Bergmeister (@bergmeister), your last commit had 1 failures in Expected a value, but got $null or empty.
at <ScriptBlock>, D:\a\1\s\test\powershell\Modules\PowerShellGet\PowerShellGet.Tests.ps1: line 134
134: $installedModuleInfo | Should -Not -BeNullOrEmpty |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
PoshChan-Bot (@PoshChan) please retry windows |
This comment has been minimized.
This comment has been minimized.
|
Travis Plunk (@TravisEz13), successfully started retry of |
|
PoshChan-Bot (@PoshChan) Please remind me in 21 hours |
|
Travis Plunk (@TravisEz13), will remind you in 21 hours |
|
Travis Plunk (@TravisEz13), this is the reminder you requested 21 hours ago |
| Impersonate="no" /> | ||
| <InstallExecuteSequence> | ||
| <!-- Do not remove shortcuts on upgrade to preserve user shortcuts pinned to Taskbar, see https://stackoverflow.com/a/33402698/1810304 --> | ||
| <RemoveShortcuts>Installed AND NOT UPGRADINGPRODUCTCODE</RemoveShortcuts> |
There was a problem hiding this comment.
This will always be true because of a change to force a full install every time to solve other issues:
PowerShell/assets/wix/Product.wxs
Line 41 in 8dcd5a2
…ell#9305) Fixes PowerShell#8919 Preserve user shortcuts pinned to Taskbar during MSI upgrade by not removing shortcuts in this case (assuming the user has not changed the installation directory), see https://stackoverflow.com/a/33402698/1810304 This also requires the Guid to not always be re-generated, which PR PowerShell#7701 originally added to ensure shortcuts get removed when RTM and preview are installed, the underlying problem was rather that RTM and preview shared the same GUIDs, therefore the GUIDs are hard-coded again but different for RTM and preview, therefore the shortcuts will still always get removed on uninstall. But this also means those GUIDs should change when the default installation directory changes, i.e. in PowerShell 7. Should we write the code to already take this into account that it does not get forgotten? Tested by first reproducing the issue by building installers locally (and bumping the patch version. Then the fix was applied to verify the solution, it. For this to take effect the version from which an MSI is being upgraded must have this fix already, i.e. if this fix got shipped in `6.2.1`, then on upgrading to it, the issue would still occur but when upgrading `6.2.1` to `6.2.2` the shortcut would start being preserved. I am wondering if we could maybe improve this to show effect earlier by trying to extract the used (auto-generated) GUIDs in the `6.2.0` and `6.2.0-rc` packages out and use them... Please not that we probably need to take this out for `7.0` because the base installation directory will change. This also assumes that the user has not specified a different installation directory on upgrade but this is a bit of an edge case where I think other things might break as well.
PR Summary
Fixes #8919
Preserve user shortcuts pinned to Taskbar during MSI upgrade by not removing shortcuts in this case (assuming the user has not changed the installation directory), see https://stackoverflow.com/a/33402698/1810304
This also requires the Guid to not always be re-generated, which PR #7701 originally added to ensure shortcuts get removed when RTM and preview are installed, the underlying problem was rather that RTM and preview shared the same GUIDs, therefore the GUIDs are hard-coded again but different for RTM and preview, therefore the shortcuts will still always get removed on uninstall. But this also means those GUIDs should change when the default installation directory changes, i.e. in PowerShell 7. Should we write the code to already take this into account that it does not get forgotten?
Tested by first reproducing the issue by building installers locally (and bumping the patch version. Then the fix was applied to verify the solution, it. For this to take effect the version from which an MSI is being upgraded must have this fix already, i.e. if this fix got shipped in
6.2.1, then on ugrading to it, the issue would still occur but when upgrading6.2.1to6.2.2the shortcut would start being preserved. I am wondering if we could maybe improve this to show effect earlier by trying to extract the used (auto-generated) GUIDs in the6.2.0and6.2.0-rcpackages out and use them...Please not that we probably need to take this out for
7.0because the base installation directory will change. This also assumes that the user has not specified a different installation directory on upgrade but this is a bit of an edge case where I think other things might break as well.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.