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)) 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); } } 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; };