Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3d74f1a
Enable build for Apple Silicon Macs (#356)
msftrubengu Jul 10, 2020
8a3fe80
Rename GetLogTextUTF8 to MsixGetLogTextUTF8 (#359)
msftrubengu Jul 24, 2020
da77ac2
Fix [Content Types].xml creation for files without an extension (#360)
msftrubengu Jul 28, 2020
ebad9ca
Fix - Makemsix pack fails when directory given ends with "\" (#361)
msftrubengu Jul 28, 2020
e40a758
Update schemas (#362)
msftrubengu Jul 29, 2020
622be1d
Add Utils library project (#358)
lechacon Jul 29, 2020
6ec570d
Update README.md (#353)
dianmsft Jul 30, 2020
09165d7
Add Azure CI Pipeline for Utils library (#364)
lechacon Aug 3, 2020
84e6718
Add configuration files to create Utils NuGet package (#367)
lechacon Aug 8, 2020
fdcfc05
Change Utils namespace to match NuGet package name (#369)
lechacon Aug 11, 2020
c9fd0b2
Add missing required NuGet properties (#372)
lechacon Aug 12, 2020
f7db347
Adding macOS Sillicon to pipelines (#370)
msftrubengu Aug 13, 2020
4ed5e8e
Use windows-latests (#373)
msftrubengu Aug 13, 2020
84c00d0
macOS universal binaries (#374)
msftrubengu Aug 14, 2020
ce2415b
Add files to linux artifacts (#375)
msftrubengu Aug 14, 2020
2165b67
Remove unused NetCore version of Utils project (#376)
lechacon Aug 18, 2020
de8184b
Added ability to create CIM files and unpack packages to them (#377)
stephenk-msft Aug 23, 2020
a967283
MSIX Utils (#382)
msftrubengu Sep 18, 2020
bdb5d41
Add project for Azure Pipelines Tasks for MSIX (#384)
lechacon Sep 24, 2020
55cea39
Fix signing configuration for pipelines tasks and add localized strin…
lechacon Sep 28, 2020
e00e737
Add ability to create VHD/VHDX files and unpack packages to them (#379)
stephenk-msft Oct 5, 2020
201a86f
Fix output path in localization pipeline for ADO tasks (#388)
lechacon Oct 14, 2020
96f2ffc
Allow users to mount CIM with image path instead of volume id (#391)
stephenk-msft Nov 5, 2020
eb2a53c
Implement flat bundle creation (#389)
jyvenugo Nov 6, 2020
5b6d766
Add overview.md file for ADO tasks extension (#394)
lechacon Nov 10, 2020
f02cb71
Add support file (#398)
msftrubengu Dec 7, 2020
fa0bd82
Parse mapping file passed to makemsix (#395)
jyvenugo Dec 10, 2020
f353d1a
Adding AppxMetadata constructor that takes an IStream (#404)
palenshus Jan 7, 2021
a1a889b
Set ExecutionPolicy when calling powershell in pipeline tasks (#403)
lechacon Jan 7, 2021
e68447b
Use attributes instead of elements on generated .appinstaller files (…
lechacon Jan 7, 2021
d297474
Remove task input groups (#407)
lechacon Jan 19, 2021
36b3f17
Installation fails if certificate contains extended ascii or non alph…
jyvenugo Jan 26, 2021
c339995
OpenSSL Thread Safety (#412)
sayan-chaliha Feb 4, 2021
533474b
Quote script paths in extension tasks (#419)
lechacon Feb 11, 2021
7bb7415
Add yaml pipeline for building the VSIX for MSIX Packaging Extension …
lechacon Feb 18, 2021
238b202
Remove TELEMETRYEVENTSOURCE_PUBLIC flag to resolve namespace conflict…
ryfu-msft Feb 18, 2021
5bdf262
Fixed failure to link due to missing reference to windowsexports.def …
MarkIngramUK Feb 20, 2021
3c41e74
Add Azure Key Vault integration to signing AzDO task (#426)
lechacon Feb 22, 2021
eca527a
Re-target Msix.Utils package to .NET Standard 2.0 (#427)
lechacon Feb 23, 2021
f7e34e2
User/rhuang msft/add file hash to block map (#429)
rhuang-msft Mar 1, 2021
28bf205
Update localized strings (#428)
lechacon Mar 3, 2021
874fce5
Added latest Appx manifest schemas to MSIX SDK (#433)
rhuang-msft Mar 10, 2021
3c058bf
Validate timestamp in Windows (#438)
msftrubengu Mar 18, 2021
c8af995
Bump y18n from 4.0.0 to 4.0.1 in /tools/pipelines-tasks (#441)
dependabot[bot] Apr 1, 2021
3fbd288
Added option to AppxFactory to create package writer with file hash e…
rhuang-msft Apr 13, 2021
4f7206f
Bump DevOps Extension dependencies' version (#445)
lechacon Apr 15, 2021
d923b66
Updated ApplyACls (#448)
stephenk-msft May 7, 2021
5883559
Adding property on bundle object containing metadata about child pack…
palenshus May 13, 2021
0c8a78f
Invalid Memory Access in SignatureValidator (#453)
sayan-chaliha Jun 8, 2021
9ec79ee
Merge branch 'master' into johnmcpms/signing
agashlin Jun 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,5 @@ src/msix/common/MSIXResource.cpp
src/test/MacOS-Linux/testApiResults.txt
src/test/mobile/iOSBVT/iOSBVT.xcodeproj/project.xcworkspace/
src/test/mobile/TEST-MsixSDK-AOSP.xml

Thumbs.db
6 changes: 6 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@

# MsixCoreInstaller owners
/MsixCore/ @wcheng-msft @jyvenugo @sarjanas-msft

# Utils library
/tools/utils/ @ranm-msft @msftrubengu @johnmcpms @lechacon @jamespik

# Azure Pipelines tasks
/tools/pipelines-tasks @ranm-msft @msftrubengu @johnmcpms @lechacon
Binary file modified MsixCore/Dependencies/x64/ApplyACLs.dll
Binary file not shown.
Binary file modified MsixCore/Dependencies/x64/ApplyACLs.pdb
Binary file not shown.
Binary file added MsixCore/Dependencies/x64/CreateCIM.dll
Binary file not shown.
Binary file added MsixCore/Dependencies/x64/CreateCIM.pdb
Binary file not shown.
Binary file added MsixCore/Dependencies/x64/WVDUtilities.dll
Binary file not shown.
Binary file added MsixCore/Dependencies/x64/WVDUtilities.pdb
Binary file not shown.
Binary file modified MsixCore/Dependencies/x86/ApplyACLs.dll
Binary file not shown.
Binary file modified MsixCore/Dependencies/x86/ApplyACLs.pdb
Binary file not shown.
Binary file added MsixCore/Dependencies/x86/CreateCIM.dll
Binary file not shown.
Binary file added MsixCore/Dependencies/x86/CreateCIM.pdb
Binary file not shown.
118 changes: 118 additions & 0 deletions MsixCore/msixmgr/CIMProvider.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#include "MSIXWindows.hpp"
#include "CIMProvider.hpp"
#include "ApplyACLsProvider.hpp"
#include "msixmgrLogger.hpp"
#include "..\msixmgrLib\GeneralUtil.hpp"
#include <string>
#include <iostream>
#include <vector>
#include <TraceLoggingProvider.h>
#include "InstallUI.hpp"

using namespace MsixCoreLib;
using namespace std;

namespace MsixCoreLib
{
class CreateCIMDll
{
public:
CreateCIMDll::CreateCIMDll()
{

}

CreateCIMDll::~CreateCIMDll()
{
if (module != nullptr)
{
FreeLibrary(module);
}
}

HRESULT load()
{
module = LoadLibrary(L"createcim.dll");
if (module == nullptr)
{
std::wcout << std::endl;
std::wcout << "Failed to load createcim.dll. Please confirm the dll is next to this exe." << std::endl;
std::wcout << std::endl;

return HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND);
}
return S_OK;
}

HMODULE get()
{
return module;
}

private:
HMODULE module;
};

HRESULT CreateAndAddToCIM(
_In_ std::wstring cimPath,
_In_ std::wstring sourcePath,
_In_ std::wstring rootDirectory)
{
CreateCIMDll createCIM;
RETURN_IF_FAILED(createCIM.load());

typedef HRESULT(STDMETHODCALLTYPE *CREATEANDADDTOCIMFILE)(
std::wstring cimFilePath,
std::wstring sourceRootPath,
std::wstring imageRootPath);

CREATEANDADDTOCIMFILE CreateAndAddToCimFileFunc =
reinterpret_cast<CREATEANDADDTOCIMFILE>
(GetProcAddress(createCIM.get(), "CreateAndAddToCIMFile"));

RETURN_IF_FAILED(CreateAndAddToCimFileFunc(cimPath, sourcePath, rootDirectory));

return S_OK;
}

HRESULT MountCIM(
std::wstring cimFilePath,
std::wstring& volumeId)
{
CreateCIMDll createCIM;
RETURN_IF_FAILED(createCIM.load());

typedef HRESULT(STDMETHODCALLTYPE *MOUNTCIM)(
std::wstring cimFilePath,
std::wstring& volumeId);

MOUNTCIM MountCIMFunc =
reinterpret_cast<MOUNTCIM>
(GetProcAddress(createCIM.get(), "MountCIM"));

RETURN_IF_FAILED(MountCIMFunc(cimFilePath, volumeId));

return S_OK;
}

HRESULT UnmountCIM(
_In_opt_ std::wstring cimFilePath,
_In_opt_ std::wstring volumeIdString)
{
CreateCIMDll createCIM;
RETURN_IF_FAILED(createCIM.load());

typedef HRESULT(STDMETHODCALLTYPE *UNMOUNTCIM)(
std::wstring cimFilePath,
std::wstring volumeIdString);

UNMOUNTCIM UnmountCIMFunc =
reinterpret_cast<UNMOUNTCIM>
(GetProcAddress(createCIM.get(), "UnmountCIM"));

RETURN_IF_FAILED(UnmountCIMFunc(cimFilePath, volumeIdString));

return S_OK;
}

}
21 changes: 21 additions & 0 deletions MsixCore/msixmgr/CIMProvider.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once
#include <string>

namespace MsixCoreLib
{
HRESULT CreateAndAddToCIM(
_In_ std::wstring cimPath,
_In_ std::wstring sourcePath,
_In_ std::wstring rootDirectory);

HRESULT MountCIM(
_In_ std::wstring cimFilePath,
_Out_ std::wstring& volumeId);

HRESULT UnmountCIM(
_In_opt_ std::wstring cimFilePath,
_In_opt_ std::wstring volumeIdString);
}



204 changes: 204 additions & 0 deletions MsixCore/msixmgr/CommandLineInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,71 @@ std::map<std::wstring, Options, CaseInsensitiveLess> CommandLineInterface::s_opt
commandLineInterface->m_validateSignature = true;
return S_OK;
}),
},
{
L"-create",
Option(false, IDS_STRING_HELP_OPTION_UNPACK_CREATE,
[&](CommandLineInterface* commandLineInterface, const std::string&)
{
if (commandLineInterface->m_operationType != OperationType::Unpack)
{
return E_INVALIDARG;
}
commandLineInterface->m_create = true;
return S_OK;
}),
},
{
L"-rootDirectory",
Option(true, IDS_STRING_HELP_OPTION_UNPACK_ROOTDIRECTORY,
[&](CommandLineInterface* commandLineInterface, const std::string& rootDirectory)
{
if (commandLineInterface->m_operationType != OperationType::Unpack)
{
return E_INVALIDARG;
}
commandLineInterface->m_rootDirectory = utf8_to_utf16(rootDirectory);
return S_OK;
}),
},
{
L"-fileType",
Option(true, IDS_STRING_HELP_OPTION_UNPACK_FILETYPE,
[&](CommandLineInterface* commandLineInterface, const std::string& fileType)
{
if (commandLineInterface->m_operationType != OperationType::Unpack)
{
return E_INVALIDARG;
}
commandLineInterface->SetWVDFileType(utf8_to_utf16(fileType));

return S_OK;
}),
},
{
L"-vhdSize",
Option(true, IDS_STRING_HELP_OPTION_UNPACK_VHDSIZE,
[&](CommandLineInterface* commandLineInterface, const std::string& vhdSize)
{
if (commandLineInterface->m_operationType != OperationType::Unpack)
{
return E_INVALIDARG;
}

ULONGLONG maxVhdSizeMB = 2040000ull; // MAX SIZE: 2040 GB --> 2040000 MB
errno = 0;
ULONGLONG vhdSizeUll = strtoull(vhdSize.c_str(), NULL, 10 /*base*/);
if ((vhdSizeUll == ULLONG_MAX && errno == ERANGE) ||
vhdSizeUll > maxVhdSizeMB ||
vhdSizeUll < 5ull)
{
std::wcout << "\nInvalid VHD size. Specified value must be at least 5 MB and at most 2040000 MB\n" << std::endl;
return E_INVALIDARG;
}

commandLineInterface->m_vhdSize = vhdSizeUll;
return S_OK;
}),
}
})
},
Expand Down Expand Up @@ -158,6 +223,125 @@ std::map<std::wstring, Options, CaseInsensitiveLess> CommandLineInterface::s_opt
}
})
},
{
L"-MountImage",
Options(false, IDS_STRING_HELP_OPTION_MOUNTIMAGE,
[&](CommandLineInterface* commandLineInterface, const std::string&)
{
if (commandLineInterface->m_operationType != OperationType::Undefined)
{
return E_INVALIDARG;
}
commandLineInterface->m_operationType = OperationType::MountImage;
return S_OK;
},
{
{
L"-imagePath",
Option(true, IDS_STRING_HELP_OPTION_MOUNTIMAGE_IMAGEPATH,
[&](CommandLineInterface* commandLineInterface, const std::string& imagePath)
{
if (commandLineInterface->m_operationType != OperationType::MountImage)
{
return E_INVALIDARG;
}
commandLineInterface->m_mountImagePath = utf8_to_utf16(imagePath);
return S_OK;
}),
},
{
L"-fileType",
Option(true, IDS_STRING_HELP_OPTION_MOUNT_FILETYPE,
[&](CommandLineInterface* commandLineInterface, const std::string& fileType)
{
if (commandLineInterface->m_operationType != OperationType::MountImage)
{
return E_INVALIDARG;
}
commandLineInterface->SetWVDFileType(utf8_to_utf16(fileType));
return S_OK;
}),
},
{
L"-readOnly",
Option(true, IDS_STRING_HELP_OPTION_MOUNT_READONLY,
[&](CommandLineInterface* commandLineInterface, const std::string& readOnly)
{
if (commandLineInterface->m_operationType != OperationType::MountImage)
{
return E_INVALIDARG;
}
if (CaseInsensitiveEquals(utf8_to_utf16(readOnly), std::wstring(L"true")))
{
commandLineInterface->m_readOnly = true;
}
else if (CaseInsensitiveEquals(utf8_to_utf16(readOnly), std::wstring(L"false")))
{
commandLineInterface->m_readOnly = false;
}
else
{
return E_INVALIDARG;
}
return S_OK;
}),
}
})
},
{
L"-UnmountImage",
Options(false, IDS_STRING_HELP_OPTION_UNMOUNTIMAGE,
[&](CommandLineInterface* commandLineInterface, const std::string&)
{
if (commandLineInterface->m_operationType != OperationType::Undefined)
{
return E_INVALIDARG;
}
commandLineInterface->m_operationType = OperationType::UnmountImage;
return S_OK;
},
{
{
L"-imagePath",
Option(true, IDS_STRING_HELP_OPTION_MOUNTIMAGE_IMAGEPATH,
[&](CommandLineInterface* commandLineInterface, const std::string& imagePath)
{
if (commandLineInterface->m_operationType != OperationType::UnmountImage)
{
return E_INVALIDARG;
}
commandLineInterface->m_mountImagePath = utf8_to_utf16(imagePath);
return S_OK;
}),
},
{
L"-volumeId",
Option(true, IDS_STRING_HELP_OPTION_UNMOUNTIMAGE_VOLUMEID,
[&](CommandLineInterface* commandLineInterface, const std::string& volumeId)
{
if (commandLineInterface->m_operationType != OperationType::UnmountImage)
{
return E_INVALIDARG;
}
commandLineInterface->m_volumeId = utf8_to_utf16(volumeId);
return S_OK;
}),
},
{
L"-fileType",
Option(true, IDS_STRING_HELP_OPTION_MOUNT_FILETYPE,
[&](CommandLineInterface* commandLineInterface, const std::string& fileType)
{
if (commandLineInterface->m_operationType != OperationType::UnmountImage)
{
return E_INVALIDARG;
}
commandLineInterface->SetWVDFileType(utf8_to_utf16(fileType));
return S_OK;
}),
}
})
},
{
L"-?",
Options(false, IDS_STRING_HELP_OPTION_HELP,
Expand Down Expand Up @@ -275,4 +459,24 @@ HRESULT CommandLineInterface::Init()
}

return S_OK;
}

void CommandLineInterface::SetWVDFileType(std::wstring fileType)
{
if (CaseInsensitiveEquals(fileType, L"VHD"))
{
this->m_fileType = WVDFileType::VHD;
}
else if (CaseInsensitiveEquals(fileType, L"VHDX"))
{
this->m_fileType = WVDFileType::VHDX;
}
else if (CaseInsensitiveEquals(fileType, L"CIM"))
{
this->m_fileType = WVDFileType::CIM;
}
else
{
this->m_fileType = WVDFileType::NotSpecified;
}
}
Loading