mirror of
https://github.com/modernw/AppInstallerForWin8.git
synced 2026-04-11 16:57:18 +10:00
添加项目文件。
This commit is contained in:
34
ShoutcutCreater/AddPackageSample.cpp
Normal file
34
ShoutcutCreater/AddPackageSample.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
||||
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
||||
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
||||
//// PARTICULAR PURPOSE.
|
||||
////
|
||||
//// Copyright (c) Microsoft Corporation. All rights reserved
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "PackageManager.h"
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
void callback (unsigned progress)
|
||||
{
|
||||
std::cout << '\r' << progress << "%" << std::ends;
|
||||
}
|
||||
|
||||
[MTAThread]
|
||||
int __cdecl main(Platform::Array<String^>^ args)
|
||||
{
|
||||
wcout << L"Copyright (c) Microsoft Corporation. All rights reserved." << endl;
|
||||
wcout << L"Add Package" << endl << endl;
|
||||
|
||||
if (args->Length < 2)
|
||||
{
|
||||
wcout << L"Usage: addpkg.exe packageUri" << endl;
|
||||
return 1;
|
||||
}
|
||||
HANDLE completedEvent = nullptr;
|
||||
int returnValue = 0;
|
||||
String^ inputPackageUri = args[1];
|
||||
cout << endl;
|
||||
AddPackageFromPath (inputPackageUri->Data (), &callback);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user