From 2ce316dc7a499052bb6bac3ea6ef314a40d1e304 Mon Sep 17 00:00:00 2001 From: Sakariya Mohamed Date: Mon, 2 Oct 2023 20:07:05 -0700 Subject: [PATCH 1/5] Update to support logging improvement and fix build issues --- MsixCore/msixmgr/CommandLineInterface.cpp | 13 +++ MsixCore/msixmgr/CommandLineInterface.hpp | 2 + MsixCore/msixmgr/msixmgr.cpp | 87 +++++++++++++++++-- MsixCore/msixmgr/msixmgr.rc | 2 +- MsixCore/msixmgr/resource.h | 2 +- .../msixmgrLib/resourceConfig.rcconfig.xml | 1 + 6 files changed, 100 insertions(+), 7 deletions(-) diff --git a/MsixCore/msixmgr/CommandLineInterface.cpp b/MsixCore/msixmgr/CommandLineInterface.cpp index 9fa4ea36e..c9a05562b 100644 --- a/MsixCore/msixmgr/CommandLineInterface.cpp +++ b/MsixCore/msixmgr/CommandLineInterface.cpp @@ -175,6 +175,19 @@ std::map CommandLineInterface::s_opt return S_OK; }), }, + { + L"-output", + Option(true, IDS_STRING_HELP_OPTION_OUTPUT, + [&](CommandLineInterface* commandLineInterface, const std::string& outPath) + { + if (commandLineInterface->m_operationType != OperationType::Unpack) + { + return E_INVALIDARG; + } + commandLineInterface->m_outputPath = utf8_to_utf16(outPath); + return S_OK; + }), + }, { L"-validateSignature", Option(false, IDS_STRING_HELP_OPTION_UNPACK_VALIDATESIGNATURE, diff --git a/MsixCore/msixmgr/CommandLineInterface.hpp b/MsixCore/msixmgr/CommandLineInterface.hpp index 3d212dc8a..0ceda52c5 100644 --- a/MsixCore/msixmgr/CommandLineInterface.hpp +++ b/MsixCore/msixmgr/CommandLineInterface.hpp @@ -108,6 +108,7 @@ class CommandLineInterface OperationType GetOperationType() { return m_operationType; } std::wstring GetOperationTypeAsString(); ULONGLONG GetVHDSize() { return m_vhdSize; } + std::wstring GetOutputPath() { return m_outputPath; } private: int m_argc = 0; char ** m_argv = nullptr; @@ -118,6 +119,7 @@ class CommandLineInterface std::wstring m_packageFilePath; std::wstring m_packageFullName; std::wstring m_unpackDestination; + std::wstring m_outputPath; std::wstring m_rootDirectory; std::wstring m_mountImagePath; std::wstring m_volumeId; diff --git a/MsixCore/msixmgr/msixmgr.cpp b/MsixCore/msixmgr/msixmgr.cpp index ba353bfbf..a090ec49c 100644 --- a/MsixCore/msixmgr/msixmgr.cpp +++ b/MsixCore/msixmgr/msixmgr.cpp @@ -173,6 +173,60 @@ void OutputUnpackFailures( } } +void OutputUnpackFailuresToFile( + _In_ std::wstring packageSource, + _In_ std::vector skippedFiles, + _In_ std::vector failedPackages, + _In_ std::vector failedPackagesErrors, + _In_ std::wstring outfilePath) +{ + std::wofstream outfile; + outfile.open(outfilePath); + + if (!skippedFiles.empty()) + { + outfile << std::endl; + outfile << "[WARNING] The following items from " << packageSource << " were ignored because they are not packages or bundles " << std::endl; + outfile << std::endl; + + for (int i = 0; i < skippedFiles.size(); i++) + { + outfile << skippedFiles.at(i) << std::endl; + } + + outfile << std::endl; + } + + if (!failedPackages.empty()) + { + outfile << std::endl; + outfile << "[WARNING] The following packages from " << packageSource << " failed to get unpacked. Please try again: " << std::endl; + outfile << std::endl; + + for (int i = 0; i < failedPackages.size(); i++) + { + HRESULT hr = failedPackagesErrors.at(i); + + outfile << L"Failed with HRESULT 0x" << std::hex << hr << L" when trying to unpack " << failedPackages.at(i) << std::endl; + if (hr == static_cast(MSIX::Error::CertNotTrusted)) + { + outfile << L"Please confirm that the certificate has been installed for this package" << std::endl; + } + else if (hr == static_cast(MSIX::Error::FileWrite)) + { + outfile << L"The tool encountered a file write error. If you are unpacking to a VHD, please try again with a larger VHD, as file write errors may be caused by insufficient disk space." << std::endl; + } + else if (hr == E_INVALIDARG) + { + outfile << "Please confirm the given package path is an .appx, .appxbundle, .msix, or .msixbundle file" << std::endl; + } + + outfile << std::endl; + } + } + outfile.close(); +} + int main(int argc, char * argv[]) { // Register the providers @@ -478,7 +532,7 @@ int main(int argc, char * argv[]) // Telemetry : Unpack Workflow Log msixmgrTraceLogging::TraceLogUnpackWorkflow(workflowId.c_str(), msixmgrTraceLogging::ExtractPackageNameFromFilePath(cli.GetPackageFilePathToInstall()).c_str(), cli.GetFileTypeAsString().c_str(), cli.GetVHDSize(), cli.IsCreate(), cli.IsApplyACLs()); - + auto outputFilePath = cli.GetOutputPath(); auto packageSourcePath = cli.GetPackageFilePathToInstall(); auto unpackDestination = cli.GetUnpackDestination(); auto rootDirectory = cli.GetRootDirectory(); @@ -645,8 +699,15 @@ int main(int argc, char * argv[]) std::wcout << "Successfully created the CIM file: " << unpackDestination << std::endl; std::wcout << std::endl; - OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors); - + if (outputFilePath.empty()) + { + OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors); + } + else + { + OutputUnpackFailuresToFile(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); + wcout << "Written error output to file: " << outputFilePath; + } // Telemetry : Workflow Log QueryPerformanceCounter(&msixMgrLoad_EndCounter); workflowElapsedTime = msixmgrTraceLogging::CalcWorkflowElapsedTime(msixMgrLoad_StartCounter, msixMgrLoad_EndCounter, msixMgrLoad_Frequency); @@ -761,7 +822,15 @@ int main(int argc, char * argv[]) std::wcout << std::endl; } - OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors); + if (outputFilePath.empty()) + { + OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors); + } + else + { + OutputUnpackFailuresToFile(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); + wcout << "Written error output to file: " << outputFilePath; + } std::wcout << std::endl; std::wcout << "Finished unpacking packages to: " << unpackDestination << std::endl; @@ -801,7 +870,15 @@ int main(int argc, char * argv[]) std::wcout << "Finished unpacking packages to: " << unpackDestination << std::endl; std::wcout << std::endl; - OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors); + if (outputFilePath.empty()) + { + OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors); + } + else + { + OutputUnpackFailuresToFile(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); + wcout << "Written error output to file: " << outputFilePath; + } // Telemetry : Workflow Log QueryPerformanceCounter(&msixMgrLoad_EndCounter); diff --git a/MsixCore/msixmgr/msixmgr.rc b/MsixCore/msixmgr/msixmgr.rc index 659095679..441ff890b 100644 --- a/MsixCore/msixmgr/msixmgr.rc +++ b/MsixCore/msixmgr/msixmgr.rc @@ -134,7 +134,7 @@ BEGIN IDS_STRING_HELP_OPTION_MOUNT_FILETYPE "the type of file to mount or unmount. The following file types are currently supported: {VHD, VHDX, CIM}" IDS_STRING_HELP_OPTION_UNPACK_VHDSIZE "the desired size of the VHD or VHDX file in MB. Must be between 5 and 2040000 MB. Use only for VHD or VHDX files" IDS_STRING_HELP_OPTION_MOUNT_READONLY "boolean (true of false) indicating whether a VHD(X) should be mounted as read only. If not specified, the image is mounted as read-only by default" - + IDS_STRING_HELP_OPTION_OUTPUT "optional parameter selects logging location to write the command line output to" END #endif // English (United States) resources diff --git a/MsixCore/msixmgr/resource.h b/MsixCore/msixmgr/resource.h index b81409bb7..486b4f640 100644 --- a/MsixCore/msixmgr/resource.h +++ b/MsixCore/msixmgr/resource.h @@ -66,7 +66,7 @@ #define IDS_STRING_HELP_OPTION_MOUNT_FILETYPE 161 #define IDS_STRING_HELP_OPTION_UNPACK_VHDSIZE 162 #define IDS_STRING_HELP_OPTION_MOUNT_READONLY 163 - +#define IDS_STRING_HELP_OPTION_OUTPUT 164 // Next default values for new objects // #ifdef APSTUDIO_INVOKED diff --git a/MsixCore/msixmgrLib/resourceConfig.rcconfig.xml b/MsixCore/msixmgrLib/resourceConfig.rcconfig.xml index d0cef6fb4..9c9befa55 100644 --- a/MsixCore/msixmgrLib/resourceConfig.rcconfig.xml +++ b/MsixCore/msixmgrLib/resourceConfig.rcconfig.xml @@ -3,6 +3,7 @@ + From 362e66411aa4432289bd97824274c073e01ee9b2 Mon Sep 17 00:00:00 2001 From: Sakariya Mohamed Date: Tue, 3 Oct 2023 15:19:33 -0700 Subject: [PATCH 2/5] Update to support logging improvement and fix build issues --- MsixCore/msixmgr/msixmgr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/MsixCore/msixmgr/msixmgr.cpp b/MsixCore/msixmgr/msixmgr.cpp index a090ec49c..fdac31106 100644 --- a/MsixCore/msixmgr/msixmgr.cpp +++ b/MsixCore/msixmgr/msixmgr.cpp @@ -17,6 +17,7 @@ #include "Util.hpp" #include "..\msixmgrLib\GeneralUtil.hpp" #include "resource.h" +#include #include #include "UnpackProvider.hpp" #include "ApplyACLsProvider.hpp" From 75d46d8151e2bf14d1f45ae634daf3b215b4f273 Mon Sep 17 00:00:00 2001 From: Sakariya Mohamed Date: Thu, 19 Oct 2023 11:48:18 -0700 Subject: [PATCH 3/5] update per PR comments --- MsixCore/msixmgr/CommandLineInterface.cpp | 4 ++-- MsixCore/msixmgr/CommandLineInterface.hpp | 4 ++-- MsixCore/msixmgr/msixmgr.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/MsixCore/msixmgr/CommandLineInterface.cpp b/MsixCore/msixmgr/CommandLineInterface.cpp index c9a05562b..e9c1bb134 100644 --- a/MsixCore/msixmgr/CommandLineInterface.cpp +++ b/MsixCore/msixmgr/CommandLineInterface.cpp @@ -177,14 +177,14 @@ std::map CommandLineInterface::s_opt }, { L"-output", - Option(true, IDS_STRING_HELP_OPTION_OUTPUT, + Option(true, IDS_STRING_HELP_OPTION_UNPACK_OUTPUT, [&](CommandLineInterface* commandLineInterface, const std::string& outPath) { if (commandLineInterface->m_operationType != OperationType::Unpack) { return E_INVALIDARG; } - commandLineInterface->m_outputPath = utf8_to_utf16(outPath); + commandLineInterface->m_unpackOutputLoggingPath = utf8_to_utf16(outPath); return S_OK; }), }, diff --git a/MsixCore/msixmgr/CommandLineInterface.hpp b/MsixCore/msixmgr/CommandLineInterface.hpp index 0ceda52c5..8cb7f4beb 100644 --- a/MsixCore/msixmgr/CommandLineInterface.hpp +++ b/MsixCore/msixmgr/CommandLineInterface.hpp @@ -108,7 +108,7 @@ class CommandLineInterface OperationType GetOperationType() { return m_operationType; } std::wstring GetOperationTypeAsString(); ULONGLONG GetVHDSize() { return m_vhdSize; } - std::wstring GetOutputPath() { return m_outputPath; } + std::wstring GetOutputPath() { return m_unpackOutputLoggingPath; } private: int m_argc = 0; char ** m_argv = nullptr; @@ -119,7 +119,7 @@ class CommandLineInterface std::wstring m_packageFilePath; std::wstring m_packageFullName; std::wstring m_unpackDestination; - std::wstring m_outputPath; + std::wstring m_unpackOutputLoggingPath; std::wstring m_rootDirectory; std::wstring m_mountImagePath; std::wstring m_volumeId; diff --git a/MsixCore/msixmgr/msixmgr.cpp b/MsixCore/msixmgr/msixmgr.cpp index fdac31106..9a22c370f 100644 --- a/MsixCore/msixmgr/msixmgr.cpp +++ b/MsixCore/msixmgr/msixmgr.cpp @@ -707,7 +707,7 @@ int main(int argc, char * argv[]) else { OutputUnpackFailuresToFile(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); - wcout << "Written error output to file: " << outputFilePath; + wcout << "Wrote error output to file: " << outputFilePath; } // Telemetry : Workflow Log QueryPerformanceCounter(&msixMgrLoad_EndCounter); @@ -830,7 +830,7 @@ int main(int argc, char * argv[]) else { OutputUnpackFailuresToFile(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); - wcout << "Written error output to file: " << outputFilePath; + wcout << "Wrote error output to file: " << outputFilePath; } std::wcout << std::endl; @@ -878,7 +878,7 @@ int main(int argc, char * argv[]) else { OutputUnpackFailuresToFile(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); - wcout << "Written error output to file: " << outputFilePath; + wcout << "Wrote error output to file: " << outputFilePath; } // Telemetry : Workflow Log From eeea0c942d6f3609c39251b54ce4b84abc648820 Mon Sep 17 00:00:00 2001 From: Sakariya Mohamed Date: Tue, 24 Oct 2023 14:05:25 -0700 Subject: [PATCH 4/5] update resource strings --- MsixCore/msixmgr/msixmgr.rc | 2 +- MsixCore/msixmgr/resource.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MsixCore/msixmgr/msixmgr.rc b/MsixCore/msixmgr/msixmgr.rc index 441ff890b..7933941c7 100644 --- a/MsixCore/msixmgr/msixmgr.rc +++ b/MsixCore/msixmgr/msixmgr.rc @@ -134,7 +134,7 @@ BEGIN IDS_STRING_HELP_OPTION_MOUNT_FILETYPE "the type of file to mount or unmount. The following file types are currently supported: {VHD, VHDX, CIM}" IDS_STRING_HELP_OPTION_UNPACK_VHDSIZE "the desired size of the VHD or VHDX file in MB. Must be between 5 and 2040000 MB. Use only for VHD or VHDX files" IDS_STRING_HELP_OPTION_MOUNT_READONLY "boolean (true of false) indicating whether a VHD(X) should be mounted as read only. If not specified, the image is mounted as read-only by default" - IDS_STRING_HELP_OPTION_OUTPUT "optional parameter selects logging location to write the command line output to" + IDS_STRING_HELP_OPTION_UNPACK_OUTPUT "optional parameter selects logging location to write the command line output to" END #endif // English (United States) resources diff --git a/MsixCore/msixmgr/resource.h b/MsixCore/msixmgr/resource.h index 486b4f640..8dd967d01 100644 --- a/MsixCore/msixmgr/resource.h +++ b/MsixCore/msixmgr/resource.h @@ -66,7 +66,7 @@ #define IDS_STRING_HELP_OPTION_MOUNT_FILETYPE 161 #define IDS_STRING_HELP_OPTION_UNPACK_VHDSIZE 162 #define IDS_STRING_HELP_OPTION_MOUNT_READONLY 163 -#define IDS_STRING_HELP_OPTION_OUTPUT 164 +#define IDS_STRING_HELP_OPTION_UNPACK_OUTPUT 164 // Next default values for new objects // #ifdef APSTUDIO_INVOKED From 82a4c90d06d399891ba0dcfa67ab71904f1b30e9 Mon Sep 17 00:00:00 2001 From: Sakariya Mohamed Date: Wed, 15 Nov 2023 20:17:30 -0800 Subject: [PATCH 5/5] Update to reflect PR comments --- MsixCore/msixmgr/msixmgr.cpp | 116 ++++++++++------------------------- 1 file changed, 33 insertions(+), 83 deletions(-) diff --git a/MsixCore/msixmgr/msixmgr.cpp b/MsixCore/msixmgr/msixmgr.cpp index 9a22c370f..183cf504c 100644 --- a/MsixCore/msixmgr/msixmgr.cpp +++ b/MsixCore/msixmgr/msixmgr.cpp @@ -125,56 +125,57 @@ void RelaunchAsAdmin(int argc, char * argv[]) ShellExecuteExW(&shellExecuteInfo); } -void OutputUnpackFailures( +void GetUnpackOutputFailures( _In_ std::wstring packageSource, _In_ std::vector skippedFiles, _In_ std::vector failedPackages, - _In_ std::vector failedPackagesErrors) + _In_ std::vector failedPackagesErrors, + _In_ std::wstringstream& unpackFailureStringStream) { if (!skippedFiles.empty()) { - std::wcout << std::endl; - std::wcout << "[WARNING] The following items from " << packageSource << " were ignored because they are not packages or bundles " << std::endl; - std::wcout << std::endl; + unpackFailureStringStream << std::endl; + unpackFailureStringStream << "[WARNING] The following items from " << packageSource << " were ignored because they are not packages or bundles " << std::endl; + unpackFailureStringStream << std::endl; for (int i = 0; i < skippedFiles.size(); i++) { - std::wcout << skippedFiles.at(i) << std::endl; + unpackFailureStringStream << skippedFiles.at(i) << std::endl; } - std::wcout << std::endl; + unpackFailureStringStream << std::endl; } if (!failedPackages.empty()) { - std::wcout << std::endl; - std::wcout << "[WARNING] The following packages from " << packageSource << " failed to get unpacked. Please try again: " << std::endl; - std::wcout << std::endl; + unpackFailureStringStream << std::endl; + unpackFailureStringStream << "[WARNING] The following packages from " << packageSource << " failed to get unpacked. Please try again: " << std::endl; + unpackFailureStringStream << std::endl; for (int i = 0; i < failedPackages.size(); i++) { HRESULT hr = failedPackagesErrors.at(i); - std::wcout << L"Failed with HRESULT 0x" << std::hex << hr << L" when trying to unpack " << failedPackages.at(i) << std::endl; + unpackFailureStringStream << L"Failed with HRESULT 0x" << std::hex << hr << L" when trying to unpack " << failedPackages.at(i) << std::endl; if (hr == static_cast(MSIX::Error::CertNotTrusted)) { - std::wcout << L"Please confirm that the certificate has been installed for this package" << std::endl; + unpackFailureStringStream << L"Please confirm that the certificate has been installed for this package" << std::endl; } else if (hr == static_cast(MSIX::Error::FileWrite)) { - std::wcout << L"The tool encountered a file write error. If you are unpacking to a VHD, please try again with a larger VHD, as file write errors may be caused by insufficient disk space." << std::endl; + unpackFailureStringStream << L"The tool encountered a file write error. If you are unpacking to a VHD, please try again with a larger VHD, as file write errors may be caused by insufficient disk space." << std::endl; } else if (hr == E_INVALIDARG) { - std::wcout << "Please confirm the given package path is an .appx, .appxbundle, .msix, or .msixbundle file" << std::endl; + unpackFailureStringStream << "Please confirm the given package path is an .appx, .appxbundle, .msix, or .msixbundle file" << std::endl; } - std::wcout << std::endl; + unpackFailureStringStream << std::endl; } } } -void OutputUnpackFailuresToFile( +void OutputUnpackFailures( _In_ std::wstring packageSource, _In_ std::vector skippedFiles, _In_ std::vector failedPackages, @@ -182,50 +183,21 @@ void OutputUnpackFailuresToFile( _In_ std::wstring outfilePath) { std::wofstream outfile; - outfile.open(outfilePath); - - if (!skippedFiles.empty()) + std::wstringstream unpackFailureStringStream; + GetUnpackOutputFailures(packageSource, skippedFiles, failedPackages, failedPackagesErrors, unpackFailureStringStream); + std::wstring unpackFailureString = unpackFailureStringStream.str(); + if (!outfilePath.empty()) { - outfile << std::endl; - outfile << "[WARNING] The following items from " << packageSource << " were ignored because they are not packages or bundles " << std::endl; - outfile << std::endl; - - for (int i = 0; i < skippedFiles.size(); i++) - { - outfile << skippedFiles.at(i) << std::endl; - } - - outfile << std::endl; + std::wofstream outFile; + outFile.open(outfilePath); + outFile << unpackFailureString << std::endl; + outFile.close(); + wcout << "Wrote error output to file: " << outfilePath; } - - if (!failedPackages.empty()) + else { - outfile << std::endl; - outfile << "[WARNING] The following packages from " << packageSource << " failed to get unpacked. Please try again: " << std::endl; - outfile << std::endl; - - for (int i = 0; i < failedPackages.size(); i++) - { - HRESULT hr = failedPackagesErrors.at(i); - - outfile << L"Failed with HRESULT 0x" << std::hex << hr << L" when trying to unpack " << failedPackages.at(i) << std::endl; - if (hr == static_cast(MSIX::Error::CertNotTrusted)) - { - outfile << L"Please confirm that the certificate has been installed for this package" << std::endl; - } - else if (hr == static_cast(MSIX::Error::FileWrite)) - { - outfile << L"The tool encountered a file write error. If you are unpacking to a VHD, please try again with a larger VHD, as file write errors may be caused by insufficient disk space." << std::endl; - } - else if (hr == E_INVALIDARG) - { - outfile << "Please confirm the given package path is an .appx, .appxbundle, .msix, or .msixbundle file" << std::endl; - } - - outfile << std::endl; - } + std::wcout << unpackFailureString << std::endl; } - outfile.close(); } int main(int argc, char * argv[]) @@ -700,15 +672,8 @@ int main(int argc, char * argv[]) std::wcout << "Successfully created the CIM file: " << unpackDestination << std::endl; std::wcout << std::endl; - if (outputFilePath.empty()) - { - OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors); - } - else - { - OutputUnpackFailuresToFile(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); - wcout << "Wrote error output to file: " << outputFilePath; - } + OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); + // Telemetry : Workflow Log QueryPerformanceCounter(&msixMgrLoad_EndCounter); workflowElapsedTime = msixmgrTraceLogging::CalcWorkflowElapsedTime(msixMgrLoad_StartCounter, msixMgrLoad_EndCounter, msixMgrLoad_Frequency); @@ -823,15 +788,8 @@ int main(int argc, char * argv[]) std::wcout << std::endl; } - if (outputFilePath.empty()) - { - OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors); - } - else - { - OutputUnpackFailuresToFile(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); - wcout << "Wrote error output to file: " << outputFilePath; - } + OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); + std::wcout << std::endl; std::wcout << "Finished unpacking packages to: " << unpackDestination << std::endl; @@ -871,15 +829,7 @@ int main(int argc, char * argv[]) std::wcout << "Finished unpacking packages to: " << unpackDestination << std::endl; std::wcout << std::endl; - if (outputFilePath.empty()) - { - OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors); - } - else - { - OutputUnpackFailuresToFile(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); - wcout << "Wrote error output to file: " << outputFilePath; - } + OutputUnpackFailures(packageSourcePath, skippedFiles, failedPackages, failedPackagesErrors, outputFilePath); // Telemetry : Workflow Log QueryPerformanceCounter(&msixMgrLoad_EndCounter);