Merged PR 1416684: Remove Pack option from MakeXplat and from xPlatAppx shared module for 1.0 Release

Since the 1.0 release will not contain the ability to create a package, we should remove any public reference to Pack until we actually complete the work to re-enable package creation (tracked by deliverables 15535115 and 15535131).

Related work items: #15848239
This commit is contained in:
Phil Smith 2018-02-07 21:53:12 +00:00
Родитель 1c47d75ea6
Коммит 90e3b3c7f9
5 изменённых файлов: 0 добавлений и 96 удалений

Просмотреть файл

@ -14,7 +14,6 @@ enum class UserSpecified
{
Nothing,
Help,
Pack,
Unpack
};
@ -63,13 +62,6 @@ struct State
return true;
}
bool SetCertificateName(const std::string& name)
{
if (!certName.empty() || name.empty()) { return false; }
certName = name;
return true;
}
bool SetDirectoryName(const std::string& name)
{
if (!directoryName.empty() || name.empty()) { return false; }
@ -138,18 +130,6 @@ int Help(char* toolName, std::map<std::string, Command>& commands, State& state)
std::cout << std::endl;
std::cout << "For help with a specific command, enter " << toolName << " <command> -?" << std::endl;
return 0;
case UserSpecified::Pack:
command = commands.find("pack");
std::cout << " " << toolName << " pack -p <package> -c <certificate> -d <directory> [options] " << std::endl;
std::cout << std::endl;
std::cout << "Description:" << std::endl;
std::cout << "------------" << std::endl;
std::cout << " Creates an appx package at output <package> name by adding all files from" << std::endl;
std::cout << " content <directory> (including subfolders), and signs the package using " << std::endl;
std::cout << " the specified <certificate>. You must include a valid app package manifest " << std::endl;
std::cout << " named AppxManifest.xml in the content directory if you do not specify the " << std::endl;
std::cout << " -mv option." << std::endl;
break;
case UserSpecified::Unpack:
command = commands.find("unpack");
std::cout << " " << toolName << " upack -p <package> -d <directory> [options] " << std::endl;
@ -218,17 +198,6 @@ int ParseAndRun(std::map<std::string, Command>& commands, State& state, int argc
case UserSpecified::Help:
case UserSpecified::Nothing:
return Help(argv[0], commands, state);
case UserSpecified::Pack:
if (state.packageName.empty() || state.certName.empty() || state.directoryName.empty())
{
Error(argv[0]);
return -1;
}
return PackAppx(state.unpackOptions, state.validationOptions,
const_cast<char*>(state.packageName.c_str()),
const_cast<char*>(state.certName.c_str()),
const_cast<char*>(state.directoryName.c_str())
);
case UserSpecified::Unpack:
if (state.packageName.empty() || state.directoryName.empty())
@ -265,31 +234,6 @@ int main(int argc, char* argv[])
State state;
std::map<std::string, Command> commands = {
{ "pack", Command("Create a new package from files on disk", [&]() { return state.Specify(UserSpecified::Pack); },
{
{ "-p", Option(true, "REQUIRED, specify output package file name.",
[&](const std::string& name) { return state.SetPackageName(name); })
},
{ "-c", Option(true, "REQUIRED, specify input certificate name.",
[&](const std::string& name) { return state.SetCertificateName(name); })
},
{ "-d", Option(true, "REQUIRED, specify input directory name.",
[&](const std::string& name) { return state.SetDirectoryName(name); })
},
{"-mv", Option(false, "Skips manifest validation. By default manifest validation is enabled.",
[&](const std::string&) { return state.SkipManifestValidation(); })
},
{ "-sv", Option(false, "Allow unknown signature origin. By default unknown signatures are rejected.",
[&](const std::string&) { return state.AllowSignatureOriginUnknown(); })
},
{ "-ss", Option(false, "Skips enforcement of signed packages. By default packages must be signed.",
[&](const std::string&) { return state.SkipSignature(); })
},
{ "-?", Option(false, "Displays this help text.",
[&](const std::string&) { return false; })
}
})
},
{ "unpack", Command("Create a new package from files on disk", [&]() { return state.Specify(UserSpecified::Unpack); },
{
{ "-p", Option(true, "REQUIRED, specify input package name.",

Просмотреть файл

@ -2005,14 +2005,6 @@ enum APPX_PACKUNPACK_OPTION
// xPlatAppx specific
XPLATAPPX_API HRESULT STDMETHODCALLTYPE PackAppx(
APPX_PACKUNPACK_OPTION packUnpackOptions,
APPX_VALIDATION_OPTION validationOption,
char* utf8FolderToPack,
char* utf8CertificatePath,
char* utf8Destination
);
XPLATAPPX_API HRESULT STDMETHODCALLTYPE UnpackAppx(
APPX_PACKUNPACK_OPTION packUnpackOptions,
APPX_VALIDATION_OPTION validationOption,

Просмотреть файл

@ -9,5 +9,4 @@ _CoCreateAppxFactoryWithHeap
_CreateStreamOnFile
_CreateStreamOnFileUTF16
_GetLogTextUTF8
_PackAppx
_UnpackAppx

Просмотреть файл

@ -5,7 +5,6 @@
CreateStreamOnFile;
CreateStreamOnFileUTF16;
GetLogTextUTF8;
PackAppx;
UnpackAppx;
local:
*;

Просмотреть файл

@ -162,36 +162,6 @@ XPLATAPPX_API HRESULT STDMETHODCALLTYPE UnpackAppx(
});
}
XPLATAPPX_API HRESULT STDMETHODCALLTYPE PackAppx(
APPX_PACKUNPACK_OPTION packUnpackOptions,
APPX_VALIDATION_OPTION validationOption,
char* utf8FolderToPack,
char* utf8CertificatePath,
char* utf8Destination)
{
return xPlat::ResultOf([&]() {
// TODO: what if source and destination are something OTHER than a file paths?
ThrowErrorIfNot(xPlat::Error::InvalidParameter,
(utf8FolderToPack != nullptr && utf8Destination != nullptr && utf8CertificatePath != nullptr),
"Invalid parameters"
);
xPlat::ComPtr<IStream> stream;
ThrowHrIfFailed(CreateStreamOnFile(utf8Destination, false, &stream));
xPlat::ComPtr<IAppxFactory> factory;
ThrowHrIfFailed(CoCreateAppxFactoryWithHeap(InternalAllocate, InternalFree, validationOption, &factory));
// TODO: plumb these through
APPX_PACKAGE_SETTINGS option {0};
xPlat::ComPtr<IAppxPackageWriter> writer;
ThrowHrIfFailed(factory->CreatePackageWriter(stream.Get(), &option, &writer));
auto from = xPlat::ComPtr<IStorageObject>::Make<xPlat::DirectoryObject>(utf8FolderToPack);
writer.As<IAppxPackage>()->Pack(packUnpackOptions, utf8CertificatePath, from.Get());
});
}
XPLATAPPX_API HRESULT STDMETHODCALLTYPE GetLogTextUTF8(COTASKMEMALLOC* memalloc, char** logText)
{
return xPlat::ResultOf([&](){