From 9af35ebf1511a9370b3c43dd966362a750de2345 Mon Sep 17 00:00:00 2001 From: Ryan Fu Date: Wed, 4 May 2022 11:04:23 -0700 Subject: [PATCH 1/3] fix bug --- src/AppInstallerCLICore/Workflows/PortableInstallFlow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AppInstallerCLICore/Workflows/PortableInstallFlow.cpp b/src/AppInstallerCLICore/Workflows/PortableInstallFlow.cpp index 6e7f0f0618..09599290e9 100644 --- a/src/AppInstallerCLICore/Workflows/PortableInstallFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/PortableInstallFlow.cpp @@ -233,7 +233,7 @@ namespace AppInstaller::CLI::Workflow if(uninstallEntry.Exists()) { - if (uninstallEntry.IsSamePortablePackageEntry(packageIdentifier, sourceIdentifier)) + if (!uninstallEntry.IsSamePortablePackageEntry(packageIdentifier, sourceIdentifier)) { // TODO: Replace HashOverride with --Force when argument behavior gets updated. if (!context.Args.Contains(Execution::Args::Type::HashOverride)) From d69b3815c7373c982170366ca54195d733c98e63 Mon Sep 17 00:00:00 2001 From: Ryan Fu Date: Wed, 4 May 2022 13:19:03 -0700 Subject: [PATCH 2/3] explicitly set m_exists as false --- src/AppInstallerCommonCore/PortableARPEntry.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/AppInstallerCommonCore/PortableARPEntry.cpp b/src/AppInstallerCommonCore/PortableARPEntry.cpp index ba31a073f5..6b47814b4e 100644 --- a/src/AppInstallerCommonCore/PortableARPEntry.cpp +++ b/src/AppInstallerCommonCore/PortableARPEntry.cpp @@ -62,6 +62,7 @@ namespace AppInstaller::Registry::Portable } else { + m_exists = false; m_key = Key::Create(root, subKey); } } From ba93c8cc9ec96c4d2f2523f9f01b8cb883789944 Mon Sep 17 00:00:00 2001 From: Ryan Fu Date: Wed, 4 May 2022 14:57:35 -0700 Subject: [PATCH 3/3] declare false in header --- src/AppInstallerCommonCore/Public/winget/PortableARPEntry.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AppInstallerCommonCore/Public/winget/PortableARPEntry.h b/src/AppInstallerCommonCore/Public/winget/PortableARPEntry.h index 8b4de60a23..5c3757502c 100644 --- a/src/AppInstallerCommonCore/Public/winget/PortableARPEntry.h +++ b/src/AppInstallerCommonCore/Public/winget/PortableARPEntry.h @@ -44,7 +44,7 @@ namespace AppInstaller::Registry::Portable Registry::Key GetKey() { return m_key; }; private: - bool m_exists; + bool m_exists = false; Key m_key; };