From 45cb1f3b913aa962a19c63b469af7c6e114e0cca Mon Sep 17 00:00:00 2001 From: Cory Knox Date: Tue, 1 Aug 2023 16:57:56 -0700 Subject: [PATCH 1/3] (#3286) Do not remove any files on MSI uninstall The MSI previously included logic to remove *some* Chocolatey files. This would leave Chocolatey in a broken state, but not actually removed. This commit removes the entries from the MSI, so an "uninstall" of the MSI is merely a removal of the installer's entry from Add/Remove Programs. --- src/chocolatey.install/chocolatey.wxs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/chocolatey.install/chocolatey.wxs b/src/chocolatey.install/chocolatey.wxs index 68afd6cb67..1730b25c07 100644 --- a/src/chocolatey.install/chocolatey.wxs +++ b/src/chocolatey.install/chocolatey.wxs @@ -23,10 +23,6 @@ - - - - @@ -35,17 +31,13 @@ - - - - @@ -54,14 +46,6 @@ - - - - - - - - From 8219e2f6ec6a135c37eb4ad41953edcf83727261 Mon Sep 17 00:00:00 2001 From: Cory Knox Date: Tue, 1 Aug 2023 16:59:21 -0700 Subject: [PATCH 2/3] (#3286) Prevent MSI Upgrades Currently it's not possible to upgrade Chocolatey with the MSI. This commit adds functionality to the MSI that will error instead of blindly allowing an upgrade that doesn't do anything. --- src/chocolatey.install/chocolatey.en-us.wxl | 3 ++- src/chocolatey.install/chocolatey.wxs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chocolatey.install/chocolatey.en-us.wxl b/src/chocolatey.install/chocolatey.en-us.wxl index 485b3db669..2cdbbed213 100644 --- a/src/chocolatey.install/chocolatey.en-us.wxl +++ b/src/chocolatey.install/chocolatey.en-us.wxl @@ -5,5 +5,6 @@ Add the Chocolatey Helpers to your PowerShell Profile to enable tab-completions. Defaults to adding to the AllUsersAllHosts profile. This application requires .NET Framework 4.8. Please install the .NET Framework then run this installer again. + UPGRADE FAILURE: Chocolatey CLI cannot be upgraded via the MSI. Please run 'choco upgrade chocolatey' from an elevated terminal window. Sets the location for the Tools Folder - \ No newline at end of file + diff --git a/src/chocolatey.install/chocolatey.wxs b/src/chocolatey.install/chocolatey.wxs index 1730b25c07..5ea061104d 100644 --- a/src/chocolatey.install/chocolatey.wxs +++ b/src/chocolatey.install/chocolatey.wxs @@ -11,7 +11,7 @@ - + From b2812ab0bc0401a1ac1e81ded354ade32672a07e Mon Sep 17 00:00:00 2001 From: Cory Knox Date: Wed, 2 Aug 2023 08:55:21 -0700 Subject: [PATCH 3/3] (#3286) Adjust wording of upgrade failure message --- src/chocolatey.install/chocolatey.en-us.wxl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chocolatey.install/chocolatey.en-us.wxl b/src/chocolatey.install/chocolatey.en-us.wxl index 2cdbbed213..d2f18d85d4 100644 --- a/src/chocolatey.install/chocolatey.en-us.wxl +++ b/src/chocolatey.install/chocolatey.en-us.wxl @@ -4,7 +4,7 @@ A newer version of Chocolatey is already installed. Add the Chocolatey Helpers to your PowerShell Profile to enable tab-completions. Defaults to adding to the AllUsersAllHosts profile. - This application requires .NET Framework 4.8. Please install the .NET Framework then run this installer again. - UPGRADE FAILURE: Chocolatey CLI cannot be upgraded via the MSI. Please run 'choco upgrade chocolatey' from an elevated terminal window. - Sets the location for the Tools Folder + Chocolatey CLI requires .NET Framework 4.8. Please install the .NET Framework then run this installer again. + The Chocolatey CLI MSI is intended for installation only. Please run 'choco upgrade chocolatey' from an elevated terminal window to upgrade. + Sets the location for the Tools Folder.