GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix Windows MSI uninstallation issue whereby shortcut does not get removed when more than one version is installed by bergmeister · Pull Request #7701 · PowerShell/PowerShell

Conversation

@bergmeister

@bergmeister Christoph Bergmeister (bergmeister) commented Sep 4, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

PR Summary

Fixes underlying problem of #3341. Related: #2881
When multiple versions (e.g. RTM and preview) of PowerShell are installed via the MSI and one is being uninstalled, then the start menu shortcut does not get removed due to the shortcut component being not unique per version. This also applies to an upgrade scenario. Therefore use an auto-generated Guid.

The same scenario also applies to the explorer context menu Guid here but this cannot be fixed in the same way due to this compilation error and will need to be addressed in a 2nd PR (LGHT0230 : The Component/@Guid attribute's value '*' is not valid for this component because it does not meet the criteria for having an automatically generated guid. Components using a Directory as a KeyPath or containing ODBCDataSource child elements cannot use an automatically generated guid. Make sure your component doesn't have a Directory as the KeyPath and move any ODBCDataSource child elements to components with explicit component guids)

cc Steve Lee (@SteveL-MSFT) Joey Aiello (@joeyaiello) as this PR is a candidate for 6.1

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Change is not breaking
  • [NA] Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
  • This PR is ready to merge and is not Work in Progress.
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready.
  • User-facing changes
    • Not Applicable
    • OR
    • User-facing Documentation needed
      • Issue filed - Issue link:
  • Testing - New and feature
    • Not Applicable or can only be tested interactively
    • OR
    • Make sure you've added a new test if existing tests do not effectively test the code changed
      • Add [feature] if the change is significant or affects feature tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

iSazonov reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Christoph Bergmeister (bergmeister) added 2 commits September 4, 2018 10:38
@bergmeister
Fix issue whereby shortcut does not get uninstalled due to non-unique…
27d43ab
…ness of shortcut component
@bergmeister
Make ExplorerContextMenu Guid unique as well
39b39fc
@bergmeister Christoph Bergmeister (bergmeister) changed the title Fix Windows MSI uninstallation issue whereby shortcut/context-menu does not get removed when more than one version is installed WIP Fix Windows MSI uninstallation issue whereby shortcut/context-menu does not get removed when more than one version is installed Sep 4, 2018
@bergmeister
Re-add Guid of ExplorerContextMenu due compilation error (LGHT0230 : …
5ee0a02
…The Component/@Guid attribute's value '*' is not valid for this component because it does not meet the criteria for having an automatically generated guid. Components using a Directory as a KeyPath or containing ODBCDataSource child elements cannot use an automatically generated guid. Make sure your component doesn't have a Directory as the KeyPath and move any ODBCDataSource child elements to components with explicit component guids)
@bergmeister Christoph Bergmeister (bergmeister) changed the title WIP Fix Windows MSI uninstallation issue whereby shortcut/context-menu does not get removed when more than one version is installed Fix Windows MSI uninstallation issue whereby shortcut does not get removed when more than one version is installed Sep 4, 2018
@iSazonov
Ilya (iSazonov) requested review from Steve Lee (SteveL-MSFT) and Travis Plunk (TravisEz13) September 4, 2018 12:15
@TravisEz13 Travis Plunk (TravisEz13) added the WG-Maintainers-Build specific to affecting the build label Sep 4, 2018
TravisEz13
Travis Plunk (TravisEz13) reviewed Sep 4, 2018
View reviewed changes

@TravisEz13 Travis Plunk (TravisEz13) left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

You might want to add a comment that * means that the GUID is auto-generated

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
TravisEz13
Travis Plunk (TravisEz13) approved these changes Sep 4, 2018
View reviewed changes
anmenaga
Andrew (anmenaga) approved these changes Sep 5, 2018
View reviewed changes
@anmenaga

Andrew (anmenaga) commented Sep 5, 2018

Copy link
Copy Markdown

Restarted failed 'PowerShell-CI-macos' run.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anmenaga Andrew (anmenaga) assigned Aditya Patwardhan (adityapatwardhan) Sep 5, 2018
@TravisEz13
Travis Plunk (TravisEz13) merged commit 9fc964a into PowerShell:master Sep 5, 2018
Travis Plunk (TravisEz13) pushed a commit that referenced this pull request Sep 7, 2018
@bergmeister @TravisEz13
Make Windows MSI uninstallation shortcut remove work when more than o…
b19630d
…ne version is installed (#7701)

Fixes underlying problem of #3341. Related: #2881
When multiple versions (e.g. RTM and preview) of PowerShell are installed via the MSI and one is being uninstalled, then the start menu shortcut does not get removed due to the shortcut component being not unique per version. This also applies to an upgrade scenario. Therefore use an auto-generated Guid (`*`)
@TravisEz13 Travis Plunk (TravisEz13) added this to the v6.1.0 milestone Sep 7, 2018
@bergmeister Christoph Bergmeister (bergmeister) mentioned this pull request Mar 29, 2019
Feature Request: Windows pinned shortcuts to remain after updates #8919
Closed
@bergmeister Christoph Bergmeister (bergmeister) mentioned this pull request Apr 5, 2019
Preserve user shortcuts pinned to Taskbar during MSI upgrade #9305
Merged
6 of 10 tasks
Travis Plunk (TravisEz13) pushed a commit that referenced this pull request Apr 7, 2019
@bergmeister @TravisEz13
Preserve user shortcuts pinned to Taskbar during MSI upgrade (#9305)
f5fc053
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 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.
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@bergmeister @TravisEz13
Make Windows MSI uninstallation shortcut remove work when more than o…
a239c5d
…ne version is installed (PowerShell#7701)

Fixes underlying problem of PowerShell#3341. Related: PowerShell#2881
When multiple versions (e.g. RTM and preview) of PowerShell are installed via the MSI and one is being uninstalled, then the start menu shortcut does not get removed due to the shortcut component being not unique per version. This also applies to an upgrade scenario. Therefore use an auto-generated Guid (`*`)
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@bergmeister @TravisEz13
Make Windows MSI uninstallation shortcut remove work when more than o…
7ce63eb
…ne version is installed (PowerShell#7701)

Fixes underlying problem of PowerShell#3341. Related: PowerShell#2881
When multiple versions (e.g. RTM and preview) of PowerShell are installed via the MSI and one is being uninstalled, then the start menu shortcut does not get removed due to the shortcut component being not unique per version. This also applies to an upgrade scenario. Therefore use an auto-generated Guid (`*`)
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@bergmeister @TravisEz13
Preserve user shortcuts pinned to Taskbar during MSI upgrade (PowerSh…
47e60e6
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@TravisEz13 Travis Plunk (TravisEz13) TravisEz13 approved these changes
@SteveL-MSFT Steve Lee (SteveL-MSFT) Awaiting requested review from SteveL-MSFT
+1 more reviewer
@anmenaga Andrew (anmenaga) anmenaga approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@adityapatwardhan Aditya Patwardhan (adityapatwardhan)

Labels

WG-Maintainers-Build specific to affecting the build

Projects

None yet

Milestone

v6.1.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@bergmeister @anmenaga @TravisEz13 @adityapatwardhan
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.