mirror of
https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git
synced 2026-04-21 18:40:25 +10:00
Update Shell and Fix Bugs
This commit is contained in:
34
shortcut/main.cpp
Normal file
34
shortcut/main.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user