Files
App-Installer-For-Windows-8…/shortcut/main.cpp
冰糖XH 745a89fa9c Add ARM platform & pugixml_arm, update VS solution
Upgrade solution to Visual Studio 17 and add ARM build configurations across projects. Several .vcxproj files were updated to include Debug/Release|ARM property groups, property sheet imports and LinkIncremental settings; platform toolset set for ARM configs where appropriate. A new pugixml_arm project and its sources/filters were added. Also added ExtensibilityGlobals (SolutionGuid) to the .sln.
2026-03-26 13:54:29 +08:00

39 lines
831 B
C++

#ifdef _M_ARM
#define _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE 1
#endif
#include <iostream>
#include <string>
#include <Windows.h>
#include <locale>
#include "../notice/notice.h"
int wmain (int argc, wchar_t **argv)
{
setlocale (LC_ALL, "");
std::wcout.imbue (std::locale ("", LC_CTYPE));
if (argc < 4 && argc > 1)
{
std::wcout << L"Error: invalid args." << std::endl;
return 1;
}
else if (argc <= 1)
{
std::wcout << L"Usage: " << std::endl <<
L"\tshortcut.exe <lnk_file_path> <target_file_path> <app_id>" << std::endl;
return 0;
}
auto res = CreateShortcutWithAppIdW (argv [1], argv [2], argv [3]);
if (SUCCEEDED (res.hr))
{
std::wcout << L"Create successfully!" << std::endl;
return 0;
}
else
{
std::wcout << L"Create failed. Reason: " << res.message << std::endl;
return 1;
}
return 0;
}