Update Shell and Fix Bugs

This commit is contained in:
Bruce
2025-11-28 16:47:12 +08:00
parent bd4e0b41a3
commit 87efdc39df
30 changed files with 58707 additions and 547 deletions

View File

@@ -5,12 +5,6 @@ VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pkgread", "pkgread\pkgread.vcxproj", "{A7753282-AA16-43D9-8ACA-7065239DD702}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dlltest", "dlltest\dlltest.vcxproj", "{F5CCB3AB-AC43-432A-862D-4F264760B09B}"
ProjectSection(ProjectDependencies) = postProject
{8EAC0230-4990-4E41-8E0F-D641D1561396} = {8EAC0230-4990-4E41-8E0F-D641D1561396}
{33D91B58-1981-4A3C-B4D1-86EE406CDE12} = {33D91B58-1981-4A3C-B4D1-86EE406CDE12}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "priformatcli", "..\priformatcli\priformatcli\priformatcli.vcxproj", "{33D91B58-1981-4A3C-B4D1-86EE406CDE12}"
ProjectSection(ProjectDependencies) = postProject
{EF4012D4-EF08-499C-B803-177739350B2D} = {EF4012D4-EF08-499C-B803-177739350B2D}
@@ -30,7 +24,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "appinstaller", "appinstalle
{33D91B58-1981-4A3C-B4D1-86EE406CDE12} = {33D91B58-1981-4A3C-B4D1-86EE406CDE12}
{A7753282-AA16-43D9-8ACA-7065239DD702} = {A7753282-AA16-43D9-8ACA-7065239DD702}
{798ED492-EECE-457D-8FD8-129DA93CE126} = {798ED492-EECE-457D-8FD8-129DA93CE126}
{F5CCB3AB-AC43-432A-862D-4F264760B09B} = {F5CCB3AB-AC43-432A-862D-4F264760B09B}
{E04CCAB9-35DB-495C-A279-5B483C707CD0} = {E04CCAB9-35DB-495C-A279-5B483C707CD0}
EndProjectSection
EndProject
@@ -54,16 +47,6 @@ Global
{A7753282-AA16-43D9-8ACA-7065239DD702}.Release|x64.Build.0 = Release|x64
{A7753282-AA16-43D9-8ACA-7065239DD702}.Release|x86.ActiveCfg = Release|Win32
{A7753282-AA16-43D9-8ACA-7065239DD702}.Release|x86.Build.0 = Release|Win32
{F5CCB3AB-AC43-432A-862D-4F264760B09B}.Debug|Any CPU.ActiveCfg = Debug|Win32
{F5CCB3AB-AC43-432A-862D-4F264760B09B}.Debug|x64.ActiveCfg = Debug|x64
{F5CCB3AB-AC43-432A-862D-4F264760B09B}.Debug|x64.Build.0 = Debug|x64
{F5CCB3AB-AC43-432A-862D-4F264760B09B}.Debug|x86.ActiveCfg = Debug|Win32
{F5CCB3AB-AC43-432A-862D-4F264760B09B}.Debug|x86.Build.0 = Debug|Win32
{F5CCB3AB-AC43-432A-862D-4F264760B09B}.Release|Any CPU.ActiveCfg = Release|Win32
{F5CCB3AB-AC43-432A-862D-4F264760B09B}.Release|x64.ActiveCfg = Release|x64
{F5CCB3AB-AC43-432A-862D-4F264760B09B}.Release|x64.Build.0 = Release|x64
{F5CCB3AB-AC43-432A-862D-4F264760B09B}.Release|x86.ActiveCfg = Release|Win32
{F5CCB3AB-AC43-432A-862D-4F264760B09B}.Release|x86.Build.0 = Release|Win32
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Debug|Any CPU.ActiveCfg = Debug|Win32
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Debug|x64.ActiveCfg = Debug|x64
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Debug|x64.Build.0 = Debug|x64

Binary file not shown.

View File

@@ -164,6 +164,7 @@
<ClInclude Include="..\pkgread\pkgread.h" />
<ClInclude Include="..\priformatcli\priformatcli.h" />
<ClInclude Include="appxinfo.h" />
<ClInclude Include="bridge.h" />
<ClInclude Include="cmdargs.h" />
<ClInclude Include="dynarr.h" />
<ClInclude Include="filepath.h" />

View File

@@ -90,6 +90,9 @@
<ClInclude Include="localeex.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="bridge.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">

View File

@@ -347,4 +347,4 @@ struct pkginfo
std::wstring_convert <std::codecvt_utf8 <wchar_t>> conv;
return conv.from_bytes (utf8);
}
};
};

87
appinstaller/bridge.h Normal file
View File

@@ -0,0 +1,87 @@
#pragma once
#include <Windows.h>
#include "mpstr.h"
#include "nstring.h"
using namespace System;
using namespace System::Runtime::InteropServices;
std::wstring HResultToMessage (HRESULT hr)
{
_com_error err (hr);
auto msgptr = err.ErrorMessage ();
return msgptr ? msgptr : L"";
}
[ComVisible (true)]
public ref class _I_HResult
{
private:
HRESULT hr = S_OK;
String ^errorcode = "";
String ^detailmsg = "";
public:
_I_HResult (HRESULT hres)
{
hr = hres;
detailmsg = CStringToMPString (HResultToMessage (hres));
}
_I_HResult (HRESULT hres, String ^error, String ^message)
{
hr = hres;
errorcode = error;
detailmsg = message;
}
property HRESULT HResult { HRESULT get () { return hr; }}
property String ^ErrorCode { String ^get () { return errorcode; }}
property String ^Message { String ^get () { return detailmsg; }}
property bool Succeeded { bool get () { return SUCCEEDED (hr); }}
property bool Failed { bool get () { return FAILED (hr); }}
};
System::String ^FormatString (System::String ^fmt, ... array <Object ^> ^args) { return System::String::Format (fmt, args); }
String ^ EscapeToInnerXml (String ^str)
{
using namespace System::Xml;
auto doc = gcnew System::Xml::XmlDocument ();
doc->LoadXml ("<body></body>");
auto root = doc->FirstChild;
root->InnerText = str;
return root->InnerXml;
}
std::wstring EscapeToInnerXml (const std::wstring &str) { return MPStringToStdW (EscapeToInnerXml (CStringToMPString (str))); }
[ComVisible (true)]
public ref class _I_String
{
public:
ref class _I_NString
{
public:
bool NEquals (String ^l, String ^r) { return IsNormalizeStringEquals (MPStringToPtrW (l), MPStringToPtrW (r)); }
bool Empty (String ^l) { return IsNormalizeStringEmpty (MPStringToStdW (l)); }
int Compare (String ^l, String ^r) { return NormalizeStringCompare (MPStringToPtrW (l), MPStringToPtrW (r)); }
int Length (String ^l) { return GetNormalizeStringLength (MPStringToStdW (l)); }
};
private:
_I_NString ^nstr = gcnew _I_NString ();
public:
property _I_NString ^NString { _I_NString ^get () { return nstr; }}
String ^Trim (String ^src)
{
std::wstring csrc = MPStringToStdW (src);
return CStringToMPString (::StringTrim (csrc));
}
String ^ToLower (String ^src) { return CStringToMPString (StringToLower (MPStringToStdW (src))); }
String ^ToUpper (String ^src) { return CStringToMPString (StringToUpper (MPStringToStdW (src))); }
String ^Format (String ^fmt, ... array <Object ^> ^args) { return FormatString (fmt, args); }
String ^FormatInnerHTML (String ^fmt, ... array <Object ^> ^args)
{
std::wstring ihtml = EscapeToInnerXml (MPStringToStdW (fmt));
auto pih = CStringToMPString (ihtml);
auto newargs = gcnew array <Object ^> (args->Length);
for (size_t i = 0; i < args->Length; i ++)
{
auto %p = newargs [i];
p = Format ("<span>{0}</span>", EscapeToInnerXml (Format ("{0}", args [i])));
}
return Format (pih, newargs);
}
};

View File

@@ -44,7 +44,7 @@ BOOL WritePrivateProfileStringA (const std::string &filePath, const std::string
}
BOOL WritePrivateProfileStringW (const std::wstring &filePath, const std::wstring &section, const std::wstring &key, const std::wstring &value)
{
return WritePrivateProfileStringW ( section.c_str (), key.c_str (), value.c_str (), filePath.c_str ());
return WritePrivateProfileStringW (section.c_str (), key.c_str (), value.c_str (), filePath.c_str ());
}
size_t GetPrivateProfileSectionA (const std::string &filePath, const std::string &section, std::vector <std::string> &output)
{
@@ -106,7 +106,7 @@ bool WritePrivateProfileSectionA (const std::string &filePath, const std::string
{
std::string buf;
for (const auto &line : lines) buf.append (line).push_back ('\0');
buf.push_back ('\0');
buf.push_back ('\0');
return WritePrivateProfileSectionA (section.c_str (), buf.c_str (), filePath.c_str ()) != 0;
}
bool WritePrivateProfileSectionW (const std::wstring &filePath, const std::wstring &section, const std::vector <std::wstring> &lines)
@@ -167,7 +167,7 @@ size_t GetPrivateProfileKeysA (const std::string &filePath, const std::string &s
}
bool DeletePrivateProfileKeyA (const std::string &filePath, const std::string &section, const std::string &key)
{
return WritePrivateProfileStringA (section.c_str (), key.c_str (), NULL, filePath.c_str ()) != FALSE;
return WritePrivateProfileStringA (section.c_str (), key.c_str (), NULL, filePath.c_str ()) != FALSE;
}
bool DeletePrivateProfileKeyW (const std::wstring &filePath, const std::wstring &section, const std::wstring &key)
{
@@ -260,19 +260,19 @@ class initkey
#define OPERATOR_TYPE_READ(_type_, _method_) \
operator _type_ () { return _method_ (); }
OPERATOR_TYPE_READ (int, read_int)
OPERATOR_TYPE_READ (unsigned int, read_uint)
OPERATOR_TYPE_READ (long, read_long)
OPERATOR_TYPE_READ (unsigned long, read_ulong)
OPERATOR_TYPE_READ (long long, read_llong)
OPERATOR_TYPE_READ (unsigned long long, read_ullong)
OPERATOR_TYPE_READ (short, read_short)
OPERATOR_TYPE_READ (unsigned short, read_ushort)
OPERATOR_TYPE_READ (float, read_float)
OPERATOR_TYPE_READ (double, read_double)
OPERATOR_TYPE_READ (bool, read_bool)
#ifdef OPERATOR_TYPE_READ
#undef OPERATOR_TYPE_READ
#endif
OPERATOR_TYPE_READ (unsigned int, read_uint)
OPERATOR_TYPE_READ (long, read_long)
OPERATOR_TYPE_READ (unsigned long, read_ulong)
OPERATOR_TYPE_READ (long long, read_llong)
OPERATOR_TYPE_READ (unsigned long long, read_ullong)
OPERATOR_TYPE_READ (short, read_short)
OPERATOR_TYPE_READ (unsigned short, read_ushort)
OPERATOR_TYPE_READ (float, read_float)
OPERATOR_TYPE_READ (double, read_double)
OPERATOR_TYPE_READ (bool, read_bool)
#ifdef OPERATOR_TYPE_READ
#undef OPERATOR_TYPE_READ
#endif
};
class initsection
{
@@ -285,8 +285,8 @@ class initsection
if (IsNormalizeStringEmpty (res)) return defaultvalue;
return (T)process (res.c_str ());
}
template <typename T, typename CT> bool write_t (const std::basic_string <CT> &key, T value)
{
template <typename T, typename CT> bool write_t (const std::basic_string <CT> &key, T value)
{
std::basic_string <CT> temp;
return write_string (key, TypeToString (value, temp));
}
@@ -424,22 +424,22 @@ class initfile
#define METHOD_INIT_READ(_type_, _typename_, _dfltvalue_, _process_) \
_type_ read_##_typename_ (INIT_READ_WARGS (_type_, _dfltvalue_)) const { return read_t (section, key, dflt, _process_); }
METHOD_INIT_READ (int, int, 0, _wtoi)
METHOD_INIT_READ (unsigned int, uint, 0, _wtou)
METHOD_INIT_READ (long, long, 0, _wtol)
METHOD_INIT_READ (unsigned long, ulong, 0, _wtoul)
METHOD_INIT_READ (long long, llong, 0, _wtoll)
METHOD_INIT_READ (unsigned long, ullong, 0, _wtou64)
METHOD_INIT_READ (short, short, 0, _wtoi16)
METHOD_INIT_READ (unsigned short, ushort, 0, _wtoui16)
METHOD_INIT_READ (int16_t, i16, 0, _wtoi16)
METHOD_INIT_READ (uint16_t, u16, 0, _wtoui16)
METHOD_INIT_READ (int32_t, i32, 0, _wtoi32)
METHOD_INIT_READ (uint32_t, u32, 0, _wtoui32)
METHOD_INIT_READ (int64_t, i64, 0, _wtoi64)
METHOD_INIT_READ (uint64_t, u64, 0, _wtou64)
METHOD_INIT_READ (float, float , 0, _wtof)
METHOD_INIT_READ (double, double, 0, _wtod)
int8_t read_i8 (INIT_READ_WARGS (int8_t, 0)) const { return read_t <int8_t, int16_t> (section, key, dflt, _wtoi8); }
METHOD_INIT_READ (unsigned int, uint, 0, _wtou)
METHOD_INIT_READ (long, long, 0, _wtol)
METHOD_INIT_READ (unsigned long, ulong, 0, _wtoul)
METHOD_INIT_READ (long long, llong, 0, _wtoll)
METHOD_INIT_READ (unsigned long, ullong, 0, _wtou64)
METHOD_INIT_READ (short, short, 0, _wtoi16)
METHOD_INIT_READ (unsigned short, ushort, 0, _wtoui16)
METHOD_INIT_READ (int16_t, i16, 0, _wtoi16)
METHOD_INIT_READ (uint16_t, u16, 0, _wtoui16)
METHOD_INIT_READ (int32_t, i32, 0, _wtoi32)
METHOD_INIT_READ (uint32_t, u32, 0, _wtoui32)
METHOD_INIT_READ (int64_t, i64, 0, _wtoi64)
METHOD_INIT_READ (uint64_t, u64, 0, _wtou64)
METHOD_INIT_READ (float, float, 0, _wtof)
METHOD_INIT_READ (double, double, 0, _wtod)
int8_t read_i8 (INIT_READ_WARGS (int8_t, 0)) const { return read_t <int8_t, int16_t> (section, key, dflt, _wtoi8); }
uint8_t read_u8 (INIT_READ_WARGS (uint8_t, 0)) const { return read_t <uint8_t, uint16_t> (section, key, dflt, _wtoui8); }
bool read_bool (INIT_READ_WARGS (bool, false)) const
{
@@ -462,16 +462,16 @@ _type_ read_##_typename_ (INIT_READ_WARGS (_type_, _dfltvalue_)) const { return
#define METHOD_INIT_WRITE(_type_) \
bool write (INIT_WRITE_WARGS (_type_)) { return write_t (section, key, value); }
METHOD_INIT_WRITE (short)
METHOD_INIT_WRITE (unsigned short)
METHOD_INIT_WRITE (int)
METHOD_INIT_WRITE (unsigned int)
METHOD_INIT_WRITE (long)
METHOD_INIT_WRITE (unsigned long)
METHOD_INIT_WRITE (long long)
METHOD_INIT_WRITE (unsigned long long)
METHOD_INIT_WRITE (float)
METHOD_INIT_WRITE (double)
bool write (INIT_WRITE_WARGS (bool)) { return write (section, key, value ? L"true" : L"false"); }
METHOD_INIT_WRITE (unsigned short)
METHOD_INIT_WRITE (int)
METHOD_INIT_WRITE (unsigned int)
METHOD_INIT_WRITE (long)
METHOD_INIT_WRITE (unsigned long)
METHOD_INIT_WRITE (long long)
METHOD_INIT_WRITE (unsigned long long)
METHOD_INIT_WRITE (float)
METHOD_INIT_WRITE (double)
bool write (INIT_WRITE_WARGS (bool)) { return write (section, key, value ? L"true" : L"false"); }
bool write (INIT_WRITE_WARGS (int8_t)) { return write_t (section, key, (int16_t)value); }
bool write (INIT_WRITE_WARGS (uint8_t)) { return write_t (section, key, (uint16_t)value); }
bool write (pcwstring section, pcwstring key, void *buf, size_t bufsize) { return WritePrivateProfileStructW (filepath, section, key, buf, bufsize); }
@@ -485,4 +485,114 @@ bool write (INIT_WRITE_WARGS (_type_)) { return write_t (section, key, value); }
#ifdef INIT_WRITE_WARGS
#undef INIT_WRITE_WARGS
#endif
};
};
#ifdef __cplusplus_cli
namespace Win32
{
using namespace System;
using namespace System::Runtime::InteropServices;
[ComVisible (true)]
public ref class Key
{
private:
String ^filepath = "";
String ^section = "";
String ^key = "";
public:
property String ^FilePath { String ^get () { return filepath; }}
property String ^Section { String ^get () { return section; }}
property String ^KeyName { String ^get () { return key; }}
Key (String ^file, String ^sect, String ^k): filepath (file), section (sect), key (k) {}
Object ^Get (Object ^dflt)
{
auto res = GetPrivateProfileStringW (
MPStringToStdW (filepath),
MPStringToStdW (section),
MPStringToStdW (key),
dflt ? MPStringToStdW (dflt->ToString ()).c_str () : L""
);
return CStringToMPString (res);
}
Object ^Get ()
{
auto res = GetPrivateProfileStringW (
MPStringToStdW (filepath),
MPStringToStdW (section),
MPStringToStdW (key)
);
return CStringToMPString (res);
}
bool Set (Object ^value)
{
return WritePrivateProfileStringW (
MPStringToStdW (filepath),
MPStringToStdW (section),
MPStringToStdW (key),
MPStringToStdW (value ? value->ToString () : L"")
);
}
property Object ^Value { Object ^get () { return Get (); } void set (Object ^value) { Set (value); } }
Key %operator = (Object ^value) { Value = value; return *this; }
operator String ^ () { return Value->ToString (); }
explicit operator bool ()
{
auto boolstr = Value->ToString ()->Trim ()->ToLower ();
if (boolstr == "true" || boolstr == "zhen" || boolstr == "yes" || boolstr == "Õæ") return true;
else if (boolstr == "false" || boolstr == "jia" || boolstr == "no" || boolstr == "¼Ù") return false;
else return false;
}
#define OPERATOR_TRANSITION_DEFINE(type, transfunc, defaultret) \
operator type () { try { transfunc (Value->ToString ()); } catch (...) { return defaultret; }}
OPERATOR_TRANSITION_DEFINE (int8_t, Convert::ToSByte, 0)
OPERATOR_TRANSITION_DEFINE (uint8_t, Convert::ToByte, 0)
OPERATOR_TRANSITION_DEFINE (int16_t, Convert::ToInt16, 0)
OPERATOR_TRANSITION_DEFINE (uint16_t, Convert::ToUInt16, 0)
OPERATOR_TRANSITION_DEFINE (int32_t, Convert::ToInt32, 0)
OPERATOR_TRANSITION_DEFINE (uint32_t, Convert::ToUInt32, 0)
OPERATOR_TRANSITION_DEFINE (int64_t, Convert::ToInt64, 0)
OPERATOR_TRANSITION_DEFINE (uint64_t, Convert::ToUInt64, 0)
OPERATOR_TRANSITION_DEFINE (float, Convert::ToSingle, 0)
OPERATOR_TRANSITION_DEFINE (double, Convert::ToDouble, 0)
OPERATOR_TRANSITION_DEFINE (System::Decimal, Convert::ToDecimal, 0)
OPERATOR_TRANSITION_DEFINE (System::DateTime, Convert::ToDateTime, Convert::ToDateTime (0))
#ifdef OPERATOR_TRANSITION_DEFINE
#undef OPERATOR_TRANSITION_DEFINE
#endif
};
[ComVisible (true)]
public ref class Section
{
private:
String ^filepath = "";
String ^section = "";
public:
property String ^FilePath { String ^get () { return filepath; } }
property String ^SectionName { String ^get () { return section; } }
Section (String ^file, String ^sect): filepath (file), section (sect) {}
Key ^GetKey (String ^key) { return gcnew Key (filepath, section, key); }
Object ^Get (String ^key, Object ^dflt) { return GetKey (key)->Get (dflt); }
Object ^Get (String ^key) { return GetKey (key)->Get (); }
bool Set (String ^key, Object ^value) { return GetKey (key)->Set (value); }
Key ^operator [] (String ^key) { return GetKey (key); }
};
[ComVisible (true)]
public ref class InitConfig
{
private:
String ^filepath = "";
public:
property String ^FilePath { String ^get () { return filepath; } void set (String ^path) { filepath = path; } }
InitConfig (String ^path): filepath (path) {}
InitConfig () {}
Section ^GetSection (String ^section) { return gcnew Section (filepath, section); }
Key ^GetKey (String ^section, String ^key) { return gcnew Key (filepath, section, key); }
Object ^Get (String ^section, String ^key, String ^dflt) { return GetKey (section, key)->Get (dflt); }
Object ^Get (String ^section, String ^key) { return GetKey (section, key)->Get (); }
Section ^Get (String ^section) { return GetSection (section); }
bool Set (String ^section, String ^key, String ^value) { return GetKey (section, key)->Set (value); }
Section ^operator [] (String ^section) { return GetSection (section); }
};
}
#endif

View File

@@ -21,6 +21,7 @@
#include "pkgmgr.h"
#include "notice.h"
#include "certmgr.h"
#include "bridge.h"
using namespace System;
using namespace System::Runtime::InteropServices;
@@ -91,6 +92,118 @@ HRESULT GetWebBrowser2Interface (System::Windows::Forms::WebBrowser ^fwb, IWebBr
Marshal::Release (pUnk);
return hr;
}
[ComVisible (true)]
public ref class _I_InitConfig
{
public:
Win32::InitConfig ^Create (String ^filepath) { return gcnew Win32::InitConfig (filepath); }
Win32::InitConfig ^GetConfig () { return Create (CStringToMPString (g_initfile.filepath)); }
};
[ComVisible (true)]
public ref class _I_Package
{
public:
ref class _I_Package_Manager
{
public:
_I_Package_Manager () {}
};
private:
_I_Package_Manager ^mgr = gcnew _I_Package_Manager ();
public:
String ^GetPackagesToJson ()
{
rapidjson::Document doc;
doc.SetArray ();
auto &alloc = doc.GetAllocator ();
for (auto &it : g_pkginfo)
{
rapidjson::Value member (rapidjson::kStringType);
member.SetString (ws2utf8 (it.filepath).c_str (), alloc);
doc.PushBack (member, alloc);
}
rapidjson::StringBuffer buffer;
rapidjson::Writer <rapidjson::StringBuffer> writer (buffer);
doc.Accept (writer);
std::string utf8 = buffer.GetString ();
std::wstring_convert <std::codecvt_utf8 <wchar_t>> conv;
return CStringToMPString (conv.from_bytes (utf8));
}
String ^GetPackageInfoToJson (String ^filepath)
{
std::wstring fpath = MPStringToStdW (filepath);
for (auto &it : g_pkginfo)
{
if (PathEquals (it.filepath, fpath))
{
return CStringToMPString (it.parseJson ());
}
}
return "{}";
}
property _I_Package_Manager ^Manager { _I_Package_Manager ^get () { return mgr; }}
String ^GetCapabilityDisplayName (String ^capabilityName)
{
return CStringToMPString (GetPackageCapabilityDisplayName (MPStringToStdW (capabilityName)));
}
_I_HResult ^GetPackageInstallResult (String ^filepath)
{
std::wstring path = MPStringToStdW (filepath);
if (g_pkgresult.find (path) == g_pkgresult.end ()) return nullptr;
auto &pres = g_pkgresult.at (path);
return gcnew _I_HResult (
pres.result,
CStringToMPString (pres.error),
CStringToMPString (pres.reason)
);
}
_I_HResult ^Activate (String ^appid)
{
DWORD dwProgressId = 0;
HRESULT hr = ActivateAppxApplication (MPStringToStdW (appid ? appid : "").c_str (), &dwProgressId);
return gcnew _I_HResult (hr);
}
};
[ComVisible (true)]
public ref class _I_Bridge_Base
{
protected:
_I_String ^str = gcnew _I_String ();
_I_Package ^pkg = gcnew _I_Package ();
_I_InitConfig ^initconfig = gcnew _I_InitConfig ();
public:
property _I_String ^String { _I_String ^get () { return str; }}
property _I_Package ^Package { _I_Package ^get () { return pkg; }}
property _I_InitConfig ^Config { _I_InitConfig ^get () { return initconfig; }}
};
[ComVisible (true)]
public interface class IScriptBridge
{
public:
virtual Object ^CallEvent (String ^funcName, Object ^e) = 0;
};
[ComVisible (true)]
public ref class _I_Window
{
private:
IScriptBridge ^wndinst = nullptr;
public:
_I_Window (IScriptBridge ^wnd): wndinst (wnd) {}
Object ^CallEvent (String ^name, ... array <Object ^> ^args) { return wndinst->CallEvent (name, args [0]); }
};
[ComVisible (true)]
public ref class _I_Bridge_Base2: public _I_Bridge_Base
{
protected:
_I_Window ^window;
public:
_I_Bridge_Base2 (IScriptBridge ^wnd)
{
window = gcnew _I_Window (wnd);
}
property _I_Window ^Window { _I_Window ^get () { return window; }}
};
public ref class SplashForm: public System::Windows::Forms::Form
{
@@ -185,17 +298,21 @@ public ref class SplashForm: public System::Windows::Forms::Form
}
catch (...) {}
if (splashimg) picbox->Image = splashimg;
if (backcolor != Drawing::Color::Transparent)
try
{
background = backcolor;
picbox->BackColor = backcolor;
this->BackColor = backcolor;
}
else
{
picbox->BackColor = background;
this->BackColor = background;
if (backcolor != Drawing::Color::Transparent)
{
background = backcolor;
picbox->BackColor = backcolor;
this->BackColor = backcolor;
}
else
{
picbox->BackColor = background;
this->BackColor = background;
}
}
catch (...) {}
if (this->Owner != nullptr)
{
this->Owner->Resize += gcnew System::EventHandler (this, &SplashForm::OnResizeOwner);
@@ -271,23 +388,7 @@ public ref class SplashForm: public System::Windows::Forms::Form
}
}
};
System::String ^FormatString (System::String ^fmt, ... array <Object ^> ^args) { return System::String::Format (fmt, args); }
std::wstring HResultToMessage (HRESULT hr)
{
_com_error err (hr);
auto msgptr = err.ErrorMessage ();
return msgptr ? msgptr : L"";
}
String ^ EscapeToInnerXml (String ^str)
{
using namespace System::Xml;
auto doc = gcnew System::Xml::XmlDocument ();
doc->LoadXml ("<body></body>");
auto root = doc->FirstChild;
root->InnerText = str;
return root->InnerXml;
}
std::wstring EscapeToInnerXml (const std::wstring &str) { return MPStringToStdW (EscapeToInnerXml (CStringToMPString (str))); }
enum class InstallType
{
normal,
@@ -452,42 +553,19 @@ void ActivateApp (Object ^appid)
auto res = ActivateAppxApplication (MPStringToStdW (appid->ToString ()));
}
[ComVisible (true)]
public ref class AppListWnd: public System::Windows::Forms::Form
public ref class AppListWnd: public System::Windows::Forms::Form, public IScriptBridge
{
public:
using WebBrowser = System::Windows::Forms::WebBrowser;
using Timer = System::Windows::Forms::Timer;
[ComVisible (true)]
ref class IBridge
ref class IBridge: public _I_Bridge_Base2
{
private:
AppListWnd ^wndinst = nullptr;
public:
IBridge (AppListWnd ^wnd): wndinst (wnd) {}
ref class _I_HResult
{
private:
HRESULT hr = S_OK;
String ^errorcode = "";
String ^detailmsg = "";
public:
_I_HResult (HRESULT hres)
{
hr = hres;
detailmsg = CStringToMPString (HResultToMessage (hres));
}
_I_HResult (HRESULT hres, String ^error, String ^message)
{
hr = hres;
errorcode = error;
detailmsg = message;
}
property HRESULT HResult { HRESULT get () { return hr; }}
property String ^ErrorCode { String ^get () { return errorcode; }}
property String ^Message { String ^get () { return detailmsg; }}
property bool Succeeded { bool get () { return SUCCEEDED (hr); }}
property bool Failed { bool get () { return FAILED (hr); }}
};
using String = System::String;
IBridge (AppListWnd ^wnd): wndinst (wnd), _I_Bridge_Base2 (wnd) {}
ref class _I_System
{
private:
@@ -541,23 +619,6 @@ public ref class AppListWnd: public System::Windows::Forms::Form
}
}
};
ref class _I_Resources
{
public:
String ^GetById (unsigned int uiResId) { return GetRCStringCli (uiResId); }
unsigned ToId (String ^lpResName)
{
auto it = g_nameToId.find (MPStringToStdA (lpResName));
return (it != g_nameToId.end ()) ? it->second : 0;
}
String ^ToName (unsigned int ulResId)
{
for (auto &it : g_nameToId) { if (it.second == ulResId) return CStringToMPString (it.first); }
return "";
}
String ^GetByName (String ^lpResId) { return GetById (ToId (lpResId)); }
String ^operator [] (unsigned int uiResId) { return GetRCStringCli (uiResId); }
};
private:
_I_UI ^ui = gcnew _I_UI (wndinst);
_I_Resources ^ires = gcnew _I_Resources ();
@@ -613,112 +674,12 @@ public ref class AppListWnd: public System::Windows::Forms::Form
return "{}";
}
};
ref class _I_String
{
public:
ref class _I_NString
{
public:
bool NEquals (String ^l, String ^r) { return IsNormalizeStringEquals (MPStringToPtrW (l), MPStringToPtrW (r)); }
bool Empty (String ^l) { return IsNormalizeStringEmpty (MPStringToStdW (l)); }
int Compare (String ^l, String ^r) { return NormalizeStringCompare (MPStringToPtrW (l), MPStringToPtrW (r)); }
int Length (String ^l) { return GetNormalizeStringLength (MPStringToStdW (l)); }
};
private:
_I_NString ^nstr = gcnew _I_NString ();
public:
property _I_NString ^NString { _I_NString ^get () { return nstr; }}
String ^Trim (String ^src)
{
std::wstring csrc = MPStringToStdW (src);
return CStringToMPString (::StringTrim (csrc));
}
String ^ToLower (String ^src) { return CStringToMPString (StringToLower (MPStringToStdW (src))); }
String ^ToUpper (String ^src) { return CStringToMPString (StringToUpper (MPStringToStdW (src))); }
String ^Format (String ^fmt, ... array <Object ^> ^args) { return FormatString (fmt, args); }
String ^FormatInnerHTML (String ^fmt, ... array <Object ^> ^args)
{
std::wstring ihtml = EscapeToInnerXml (MPStringToStdW (fmt));
auto pih = CStringToMPString (ihtml);
auto newargs = gcnew array <Object ^> (args->Length);
for (size_t i = 0; i < args->Length; i ++)
{
auto %p = newargs [i];
p = Format ("<span>{0}</span>", EscapeToInnerXml (Format ("{0}", args [i])));
}
return Format (pih, newargs);
}
};
ref class _I_Package
{
public:
String ^GetPackagesToJson ()
{
rapidjson::Document doc;
doc.SetArray ();
auto &alloc = doc.GetAllocator ();
for (auto &it : g_pkginfo)
{
rapidjson::Value member (rapidjson::kStringType);
member.SetString (ws2utf8 (it.filepath).c_str (), alloc);
doc.PushBack (member, alloc);
}
rapidjson::StringBuffer buffer;
rapidjson::Writer <rapidjson::StringBuffer> writer (buffer);
doc.Accept (writer);
std::string utf8 = buffer.GetString ();
std::wstring_convert <std::codecvt_utf8 <wchar_t>> conv;
return CStringToMPString (conv.from_bytes (utf8));
}
String ^GetPackageInfoToJson (String ^filepath)
{
std::wstring fpath = MPStringToStdW (filepath);
for (auto &it : g_pkginfo)
{
if (PathEquals (it.filepath, fpath))
{
return CStringToMPString (it.parseJson ());
}
}
return "{}";
}
String ^GetCapabilityDisplayName (String ^capabilityName)
{
return CStringToMPString (GetPackageCapabilityDisplayName (MPStringToStdW (capabilityName)));
}
_I_HResult ^GetPackageInstallResult (String ^filepath)
{
std::wstring path = MPStringToStdW (filepath);
if (g_pkgresult.find (path) == g_pkgresult.end ()) return nullptr;
auto &pres = g_pkgresult.at (path);
return gcnew _I_HResult (
pres.result,
CStringToMPString (pres.error),
CStringToMPString (pres.reason)
);
}
void Activate (String ^appid) { ActivateApp (appid); }
};
ref class _I_Window
{
private:
AppListWnd ^wndinst = nullptr;
public:
_I_Window (AppListWnd ^wnd): wndinst (wnd) {}
Object ^CallEvent (String ^name, ... array <Object ^> ^args) { return wndinst->CallEvent (name, args [0]); }
};
private:
_I_System ^system = gcnew _I_System (wndinst);
_I_IEFrame ^ieframe = gcnew _I_IEFrame (wndinst);
_I_String ^str = gcnew _I_String ();
_I_Package ^pkg = gcnew _I_Package ();
_I_Window ^wnd = gcnew _I_Window (wndinst);
public:
property _I_System ^System { _I_System ^get () { return system; }}
property _I_IEFrame ^IEFrame { _I_IEFrame ^get () { return ieframe; }}
property _I_String ^String { _I_String ^get () { return str; }}
property _I_Package ^Package { _I_Package ^get () { return pkg; }}
property _I_Window ^Window { _I_Window ^get () { return wnd; }}
};
private:
WebBrowser ^webui = nullptr;
@@ -818,7 +779,11 @@ public ref class AppListWnd: public System::Windows::Forms::Form
}
void OnPress_AppItem ()
{
OnPress_Cancel ();
// OnPress_Cancel ();
if (!this->IsHandleCreated) return;
if (InvokeRequired) this->Invoke (gcnew Action (this, &AppListWnd::Close));
else this->Close ();
return;
}
void OnDeactivate (Object ^sender, EventArgs ^e)
{
@@ -892,7 +857,7 @@ public ref class AppListWnd: public System::Windows::Forms::Form
return nullptr;
}
Object ^ExecScript (... array <Object ^> ^alpScript) { return InvokeCallScriptFunction ("eval", alpScript); }
Object ^CallEvent (String ^funcName, Object ^e)
Object ^CallEvent (String ^funcName, Object ^e) override
{
std::wstring fname = MPStringToStdW (funcName);
if (IsNormalizeStringEquals (fname.c_str (), L"OnPress_CancelButton")) OnPress_Cancel ();
@@ -940,7 +905,7 @@ public ref class AppListWnd: public System::Windows::Forms::Form
}
};
[ComVisible (true)]
public ref class MainHtmlWnd: public System::Windows::Forms::Form
public ref class MainHtmlWnd: public System::Windows::Forms::Form, public IScriptBridge
{
public:
using WebBrowser = System::Windows::Forms::WebBrowser;
@@ -950,38 +915,16 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
String ^pagetag = "splash";
InstallType insmode = InstallType::normal;
size_t nowinstall = 0;
ITaskbarList3 *taskbar = nullptr;
public:
[ComVisible (true)]
ref class IBridge
ref class IBridge: public _I_Bridge_Base2
{
private:
MainHtmlWnd ^wndinst = nullptr;
public:
IBridge (MainHtmlWnd ^wnd): wndinst (wnd) {}
ref class _I_HResult
{
private:
HRESULT hr = S_OK;
String ^errorcode = "";
String ^detailmsg = "";
public:
_I_HResult (HRESULT hres)
{
hr = hres;
detailmsg = CStringToMPString (HResultToMessage (hres));
}
_I_HResult (HRESULT hres, String ^error, String ^message)
{
hr = hres;
errorcode = error;
detailmsg = message;
}
property HRESULT HResult { HRESULT get () { return hr; }}
property String ^ErrorCode { String ^get () { return errorcode; }}
property String ^Message { String ^get () { return detailmsg; }}
property bool Succeeded { bool get () { return SUCCEEDED (hr); }}
property bool Failed { bool get () { return FAILED (hr); }}
};
using String = System::String;
IBridge (MainHtmlWnd ^wnd): wndinst (wnd), _I_Bridge_Base2 (wnd) {}
ref class _I_System
{
private:
@@ -998,8 +941,6 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
int m_width = 0;
int m_height = 0;
public:
property int width { int get () { return m_width; } }
property int height { int get () { return m_height; }}
property int Width { int get () { return m_width; } }
property int Height { int get () { return m_height; }}
int getWidth () { return m_width; }
@@ -1019,7 +960,26 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
return uri->AbsoluteUri;
}
}
property String ^SplashBackgroundColor { String ^get () { return CStringToMPString (g_vemani.splash_screen_backgroundcolor (L"App")); } }
property String ^SplashBackgroundColor
{
String ^get ()
{
std::wnstring ret = L"";
auto personal = g_initfile [L"Personalization"];
auto thememode = personal [L"AppInstaller:ThemeMode"];
auto custommode = personal [L"AppInstaller:CustomThemeMode"];
bool nowdark =
IsNormalizeStringEquals (thememode.read_wstring ().c_str (), L"dark") ||
IsNormalizeStringEquals (thememode.read_wstring ().c_str (), L"auto") && IsAppInDarkMode () ||
IsNormalizeStringEquals (thememode.read_wstring ().c_str (), L"custom") && IsNormalizeStringEquals (custommode.read_wstring ().c_str (), L"dark") ||
IsNormalizeStringEquals (thememode.read_wstring ().c_str (), L"custom") && IsNormalizeStringEquals (custommode.read_wstring ().c_str (), L"auto") && IsAppInDarkMode ();
if (nowdark) ret = g_vemani.splash_screen_backgroundcolor_darkmode (L"App");
else ret = g_vemani.splash_screen_backgroundcolor (L"App");
if (ret.empty ()) ret = g_vemani.splash_screen_backgroundcolor (L"App");
if (ret.empty ()) ret = g_vemani.background_color (L"App");
return CStringToMPString (ret);
}
}
void ShowSplash () { if (wndinst->SplashScreen->IsHandleCreated) wndinst->SplashScreen->Show (); else wndinst->SplashScreen->ReInit (); }
void FadeAwaySplash () { wndinst->SplashScreen->FadeAway (); }
void FadeOutSplash () { wndinst->SplashScreen->FadeOut (); }
@@ -1047,86 +1007,6 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
}
}
};
ref class _I_Resources
{
public:
String ^GetById (unsigned int uiResId) { return GetRCStringCli (uiResId); }
unsigned ToId (String ^lpResName)
{
auto it = g_nameToId.find (MPStringToStdA (lpResName));
return (it != g_nameToId.end ()) ? it->second : 0;
}
String ^ToName (unsigned int ulResId)
{
for (auto &it : g_nameToId) { if (it.second == ulResId) return CStringToMPString (it.first); }
return "";
}
String ^GetByName (String ^lpResId) { return GetById (ToId (lpResId)); }
String ^operator [] (unsigned int uiResId) { return GetRCStringCli (uiResId); }
};
ref class _I_Version
{
private:
UINT16 major = 0, minor = 0, build = 0, revision = 0;
public:
property UINT16 Major { UINT16 get () { return major; } void set (UINT16 value) { major = value; } }
property UINT16 Minor { UINT16 get () { return minor; } void set (UINT16 value) { minor = value; } }
property UINT16 Build { UINT16 get () { return build; } void set (UINT16 value) { build = value; } }
property UINT16 Revision { UINT16 get () { return revision; } void set (UINT16 value) { revision = value; } }
property array <UINT16> ^Data
{
array <UINT16> ^get ()
{
return gcnew array <UINT16> {
major, minor, build, revision
};
}
void set (array <UINT16> ^arr)
{
major = minor = build = revision = 0;
for (size_t i = 0; i < arr->Length; i ++)
{
switch (i)
{
case 0: major = arr [i]; break;
case 1: minor = arr [i]; break;
case 2: build = arr [i]; break;
case 3: revision = arr [i]; break;
default: break;
}
}
}
}
property String ^DataStr
{
String ^get () { return Stringify (); }
void set (String ^str) { Parse (str); }
}
_I_Version (UINT16 p_ma, UINT16 p_mi, UINT16 p_b, UINT16 p_r):
major (p_ma), minor (p_mi), build (p_b), revision (p_r) {}
_I_Version (UINT16 p_ma, UINT16 p_mi, UINT16 p_b):
major (p_ma), minor (p_mi), build (p_b), revision (0) {}
_I_Version (UINT16 p_ma, UINT16 p_mi):
major (p_ma), minor (p_mi), build (0), revision (0) {}
_I_Version (UINT16 p_ma):
major (p_ma), minor (0), build (0), revision (0) {}
_I_Version () {}
_I_Version %Parse (String ^ver)
{
auto strarr = ver->Split ('.');
auto arr = gcnew array <UINT16> (4);
for (size_t i = 0; i < strarr->Length; i ++)
{
try { arr [i] = Convert::ToUInt16 (strarr [i]); }
catch (...) {}
}
Data = arr;
return *this;
}
String ^Stringify () { return major + "." + minor + "." + build + "." + revision; }
String ^ToString () override { return Stringify (); }
bool Valid () { return Major != 0 && Minor != 0 && Build != 0 && Revision != 0; }
};
ref class _I_Locale
{
public:
@@ -1227,100 +1107,6 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
return "{}";
}
};
ref class _I_String
{
public:
ref class _I_NString
{
public:
bool NEquals (String ^l, String ^r) { return IsNormalizeStringEquals (MPStringToPtrW (l), MPStringToPtrW (r)); }
bool Empty (String ^l) { return IsNormalizeStringEmpty (MPStringToStdW (l)); }
int Compare (String ^l, String ^r) { return NormalizeStringCompare (MPStringToPtrW (l), MPStringToPtrW (r)); }
int Length (String ^l) { return GetNormalizeStringLength (MPStringToStdW (l)); }
};
private:
_I_NString ^nstr = gcnew _I_NString ();
public:
property _I_NString ^NString { _I_NString ^get () { return nstr; }}
String ^Trim (String ^src)
{
std::wstring csrc = MPStringToStdW (src);
return CStringToMPString (::StringTrim (csrc));
}
String ^ToLower (String ^src) { return CStringToMPString (StringToLower (MPStringToStdW (src))); }
String ^ToUpper (String ^src) { return CStringToMPString (StringToUpper (MPStringToStdW (src))); }
String ^Format (String ^fmt, ... array <Object ^> ^args) { return FormatString (fmt, args); }
String ^FormatInnerHTML (String ^fmt, ... array <Object ^> ^args)
{
std::wstring ihtml = EscapeToInnerXml (MPStringToStdW (fmt));
auto pih = CStringToMPString (ihtml);
auto newargs = gcnew array <Object ^> (args->Length);
for (size_t i = 0; i < args->Length; i ++)
{
auto %p = newargs [i];
p = Format ("<span>{0}</span>", EscapeToInnerXml (Format ("{0}", args [i])));
}
return Format (pih, newargs);
}
};
ref class _I_Package
{
public:
ref class _I_Package_Manager
{
public:
_I_Package_Manager () {}
};
private:
_I_Package_Manager ^mgr = gcnew _I_Package_Manager ();
public:
String ^GetPackagesToJson ()
{
rapidjson::Document doc;
doc.SetArray ();
auto &alloc = doc.GetAllocator ();
for (auto &it : g_pkginfo)
{
rapidjson::Value member (rapidjson::kStringType);
member.SetString (ws2utf8 (it.filepath).c_str (), alloc);
doc.PushBack (member, alloc);
}
rapidjson::StringBuffer buffer;
rapidjson::Writer <rapidjson::StringBuffer> writer (buffer);
doc.Accept (writer);
std::string utf8 = buffer.GetString ();
std::wstring_convert <std::codecvt_utf8 <wchar_t>> conv;
return CStringToMPString (conv.from_bytes (utf8));
}
String ^GetPackageInfoToJson (String ^filepath)
{
std::wstring fpath = MPStringToStdW (filepath);
for (auto &it : g_pkginfo)
{
if (PathEquals (it.filepath, fpath))
{
return CStringToMPString (it.parseJson ());
}
}
return "{}";
}
property _I_Package_Manager ^Manager { _I_Package_Manager ^get () { return mgr; }}
String ^GetCapabilityDisplayName (String ^capabilityName)
{
return CStringToMPString (GetPackageCapabilityDisplayName (MPStringToStdW (capabilityName)));
}
_I_HResult ^GetPackageInstallResult (String ^filepath)
{
std::wstring path = MPStringToStdW (filepath);
if (g_pkgresult.find (path) == g_pkgresult.end ()) return nullptr;
auto &pres = g_pkgresult.at (path);
return gcnew _I_HResult (
pres.result,
CStringToMPString (pres.error),
CStringToMPString (pres.reason)
);
}
};
ref class _I_Window
{
private:
@@ -1332,14 +1118,10 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
private:
_I_System ^system = gcnew _I_System (wndinst);
_I_IEFrame ^ieframe = gcnew _I_IEFrame (wndinst);
_I_String ^str = gcnew _I_String ();
_I_Package ^pkg = gcnew _I_Package ();
_I_Window ^wnd = gcnew _I_Window (wndinst);
public:
property _I_System ^System { _I_System ^get () { return system; }}
property _I_IEFrame ^IEFrame { _I_IEFrame ^get () { return ieframe; }}
property _I_String ^String { _I_String ^get () { return str; }}
property _I_Package ^Package { _I_Package ^get () { return pkg; }}
property _I_Window ^Window { _I_Window ^get () { return wnd; }}
};
protected:
@@ -1427,28 +1209,24 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
splash->ChangePosAndSize ();
splash->Show ();
splash->Update ();
webui->Navigate (CStringToMPString (CombinePath (GetProgramRootDirectoryW (), L"html\\install.html")));
splash->SetSplashImage (GetSuitSplashImage ());
System::Windows::Forms::Application::DoEvents ();
auto htmlpath = CombinePath (GetProgramRootDirectoryW (), L"html\\install.html");
webui->Navigate (CStringToMPString (htmlpath));
if (!IsFileExists (htmlpath))
{
std::wstring msg = L"Error: cannot find file \"" + htmlpath + L"\".";
MessageBoxW (InvokeGetHWND (), msg.c_str (), GetRCStringSW (IDS_WINTITLE).c_str (), MB_ICONERROR);
this->Close ();
return;
}
}
void OnPreviewKeyDown_WebBrowser (System::Object ^sender, System::Windows::Forms::PreviewKeyDownEventArgs ^e)
{
if (e->KeyCode == System::Windows::Forms::Keys::F5 || (e->KeyCode == System::Windows::Forms::Keys::R && e->Control))
e->IsInputKey = true;
}
void OnResize (Object ^sender, EventArgs ^e)
{
ResizeEvent ();
}
void OnResizeEnd (Object ^sender, EventArgs ^e)
{
ResizeEvent ();
}
std::wstring GetSuitSplashImage ()
{
std::wstring path = g_scaleres [this->Width >= 800 * DPI && this->Height >= 600 * DPI ? L"splashlarge" : L"splash"];
if (IsNormalizeStringEmpty (path)) path = g_vemani.splash_screen_image (L"App");
return path;
}
void ResizeEvent ()
void ResponseSplashChange ()
{
splash->SetSplashImage (GetSuitSplashImage ());
ExecScript (
@@ -1464,6 +1242,45 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
"}) ();"
);
}
void OnResize (Object ^sender, EventArgs ^e) { ResizeEvent (); }
void OnResizeEnd (Object ^sender, EventArgs ^e) {}
std::wstring GetSuitSplashImage ()
{
int limitw = 800 * DPI;
int limith = 600 * DPI;
std::wstring tag = L"splash";
int noww = this->Width;
int nowh = this->Height;
if (noww >= limitw && nowh >= limith)
tag = L"splashlarge";
std::wstring path = g_scaleres [tag];
if (IsNormalizeStringEmpty (path))
path = g_scaleres [L"splash"];
if (IsNormalizeStringEmpty (path))
path = g_vemani.splash_screen_image (L"App");
return path;
}
void ResizeEvent ()
{
auto &ini = g_initfile;
auto setsect = ini ["Settings"];
auto lasts = setsect [L"AppInstaller:LastWndState"];
auto savepos = setsect [L"AppInstaller:SavePosAndSizeBeforeCancel"];
auto lastw = setsect [L"AppInstaller:LastWidth"];
auto lasth = setsect [L"AppInstaller:LastHeight"];
switch (this->WindowState)
{
case System::Windows::Forms::FormWindowState::Normal:
case System::Windows::Forms::FormWindowState::Maximized:
lasts = (int)this->WindowState;
}
if (this->WindowState == System::Windows::Forms::FormWindowState::Normal && savepos)
{
lastw = (int)(this->ClientSize.Width / DPI);
lasth = (int)(this->ClientSize.Height / DPI);
}
ResponseSplashChange ();
}
System::Threading::Thread ^ThreadPackageLoadTask ()
{
auto thread = gcnew Threading::Thread (gcnew Threading::ThreadStart (this, &MainHtmlWnd::PackageLoadTask));
@@ -1621,12 +1438,14 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
{
InvokeCallScriptFunction ("setInstallingProgress", dwProgress);
InvokeCallScriptFunction ("setInstallingStatus", String::Format (GetRCStringCli (IDS_INSTALLING_SINSTALLING_PROGRESS), dwProgress));
taskbar->SetProgressValue (InvokeGetHWND (), dwProgress, 100);
}
void InstallProgressCallbackMultiple (DWORD dwProgress)
{
double progress = (dwProgress * 0.01 + nowinstall) / (double)g_pkginfo.size () * 100;
InvokeCallScriptFunction ("setInstallingProgress", progress);
InvokeCallScriptFunction ("setInstallingStatus", String::Format (GetRCStringCli (IDS_INSTALLING_MSINSTALLING_PROGRESS), dwProgress, nowinstall + 1, g_pkginfo.size ()));
taskbar->SetProgressValue (InvokeGetHWND (), progress * g_pkginfo.size (), 100 * g_pkginfo.size ());
}
System::Threading::Thread ^ThreadPackageInstallTask ()
{
@@ -1655,6 +1474,7 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
}
else pir.result = AddAppxPackageFromPath (pi.filepath, blankdeplist, DEPOLYOPTION_NONE, gcnew InstallProgressCallbackDelegate (this, &MainHtmlWnd::InstallProgressCallback), pir.error, pir.reason);
g_pkgresult [pi.filepath] = pir;
taskbar->SetProgressState (InvokeGetHWND (), TBPF_NOPROGRESS);
if (pir.succeeded ())
{
InvokeCallScriptFunction ("noticeLoadInstallSuccessPage", false);
@@ -1722,8 +1542,10 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
pir.error,
pir.reason
);
if (pir.failed ()) taskbar->SetProgressState (InvokeGetHWND (), TBPF_ERROR);
g_pkgresult [it.filepath] = pir;
}
taskbar->SetProgressState (InvokeGetHWND (), TBPF_NOPROGRESS);
bool allsuccess = true;
for (auto &it : g_pkgresult)
{
@@ -1910,6 +1732,7 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
MainHtmlWnd ()
{
InitSize ();
System::Windows::Forms::Application::DoEvents ();
splash = gcnew SplashForm (
CStringToMPString (GetSuitSplashImage ()),
StringToColor (CStringToMPString (g_vemani.splash_screen_backgroundcolor (L"App"))),
@@ -1917,17 +1740,44 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
);
System::Windows::Forms::Application::DoEvents ();
Init ();
ITaskbarList3 *ptr = nullptr;
HRESULT hr = CoCreateInstance (CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (void **)&ptr);
if (SUCCEEDED (hr))
{
taskbar = ptr;
taskbar->HrInit ();
}
else
{
taskbar = nullptr;
if (ptr) ptr->Release ();
}
}
Object ^CallScriptFunction (String ^lpFuncName, ... array <Object ^> ^alpParams)
{
try { return this->webui->Document->InvokeScript (lpFuncName, alpParams); }
catch (Exception ^e) {}
catch (Exception ^e)
{
try
{
this->webui->Document->InvokeScript ("messageBoxAsync", gcnew array <Object ^> {
e->Message,
e->Source,
0,
CStringToMPString (g_vemani.background_color (L"App"))
});
}
catch (Exception ^ex)
{
MessageBoxW (InvokeGetHWND (), MPStringToStdW (e->Message).c_str (), MPStringToStdW (e->Source).c_str (), 0);
}
}
return nullptr;
}
Object ^CallScriptFunction (String ^lpScriptName)
{
try { return this->webui->Document->InvokeScript (lpScriptName); }
catch (Exception ^e) {}
catch (Exception ^ex) { System::Windows::Forms::MessageBox::Show ("Error calling JavaScript function: " + ex->Message); }
return nullptr;
}
Object ^InvokeCallScriptFunction (String ^lpFuncName, ... array <Object ^> ^alpParams)
@@ -1951,7 +1801,7 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
return nullptr;
}
Object ^ExecScript (... array <Object ^> ^alpScript) { return InvokeCallScriptFunction ("eval", alpScript); }
Object ^CallEvent (String ^funcName, Object ^e)
Object ^CallEvent (String ^funcName, Object ^e) override
{
std::wstring fname = MPStringToStdW (funcName);
if (IsNormalizeStringEquals (fname.c_str (), L"OnPress_Button1")) OnPress_Button1 ();
@@ -1985,6 +1835,11 @@ public ref class MainHtmlWnd: public System::Windows::Forms::Form
web2->ExecWB (OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, &v, nullptr);
}
}
~MainHtmlWnd ()
{
if (taskbar) taskbar->Release ();
taskbar = nullptr;
}
};
using MainWnd = MainHtmlWnd;
std::vector <std::wstring> LoadFileListW (const std::wstring &filePath)
@@ -2051,10 +1906,7 @@ DWORD CmdMapsToFlags (std::map <cmdkey, cmdvalue> cmdpairs, std::vector <std::wn
}
}
}
else if (key.key.equals (L"language"))
{
SetThreadUILanguage (LocaleCodeToLcid (value.value));
}
else if (key.key.equals (L"language")) SetThreadUILanguage (LocaleCodeToLcid (value.value));
} break;
}
}
@@ -2083,6 +1935,13 @@ HRESULT SetCurrentAppUserModelID (PCWSTR appID)
catch (...) { return E_FAIL; }
return E_FAIL;
}
void InstallPackageTaskVerySilent ()
{
for (auto &it : g_pkgfiles)
{
AddAppxPackageFromPath (it.c_str ());
}
}
[STAThread]
int APIENTRY wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
{
@@ -2110,7 +1969,17 @@ int APIENTRY wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCm
}
}
g_wcmdflags = CmdMapsToFlags (pair_cmdkv, g_pkgfiles);
if (g_wcmdflags & (DWORD)CMDPARAM::VERYSILENT)
{
try
{
InstallPackageTaskVerySilent ();
return 0;
}
catch (...) { return 1; }
}
}
SetWebBrowserEmulation ();
System::Windows::Forms::Application::EnableVisualStyles ();
System::Windows::Forms::Application::SetCompatibleTextRenderingDefault (false);
auto mwnd = gcnew MainHtmlWnd ();

View File

@@ -77,9 +77,43 @@ std::map <std::string, unsigned> g_nameToId = {
MAKENAMEIDMAP (IDS_FAILED_STITLE),
MAKENAMEIDMAP (IDS_APPLIST_WINTITLE),
MAKENAMEIDMAP (IDS_APPLIST_TITLE),
MAKENAMEIDMAP (IDS_APPLIST_CANCEL)
MAKENAMEIDMAP (IDS_APPLIST_CANCEL),
MAKENAMEIDMAP (IDS_MSGBOX_OK),
MAKENAMEIDMAP (IDS_MSGBOX_CANCEL),
MAKENAMEIDMAP (IDS_MSGBOX_ABORT),
MAKENAMEIDMAP (IDS_MSGBOX_RETRY),
MAKENAMEIDMAP (IDS_MSGBOX_IGNORE),
MAKENAMEIDMAP (IDS_MSGBOX_YES),
MAKENAMEIDMAP (IDS_MSGBOX_NO),
MAKENAMEIDMAP (IDS_MSGBOX_CLOSE),
MAKENAMEIDMAP (IDS_MSGBOX_HELP),
MAKENAMEIDMAP (IDS_MSGBOX_TRYAGAIN),
MAKENAMEIDMAP (IDS_MSGBOX_CONTINUE)
};
#ifdef MAKENAMEIDMAP
#undef MAKENAMEIDMAP
#endif
#ifdef __cplusplus_cli
using namespace System;
using namespace System::Runtime::InteropServices;
[ComVisible (true)]
public ref class _I_Resources
{
public:
String ^GetById (unsigned int uiResId) { return GetRCStringCli (uiResId); }
unsigned ToId (String ^lpResName)
{
auto it = g_nameToId.find (MPStringToStdA (lpResName));
return (it != g_nameToId.end ()) ? it->second : 0;
}
String ^ToName (unsigned int ulResId)
{
for (auto &it : g_nameToId) { if (it.second == ulResId) return CStringToMPString (it.first); }
return "";
}
String ^GetByName (String ^lpResId) { return GetById (ToId (lpResId)); }
String ^operator [] (unsigned int uiResId) { return GetRCStringCli (uiResId); }
};
#endif

Binary file not shown.

View File

@@ -147,6 +147,15 @@ class vemanifest
return !bg.empty () ? bg : visual.attribute ("BackgroundColor").as_string ();
}
std::wstring splash_screen_backgroundcolor (const std::wstring &id = L"App") const { return pugi::as_wide (this->splash_screen_backgroundcolor (pugi::as_utf8 (id))); }
std::string splash_screen_backgroundcolor_darkmode (const std::string &id = "App") const
{
pugi::xml_node visual = visual_element_node (id);
if (!visual) return "";
pugi::xml_node splash = visual.child ("SplashScreen");
std::string bg = splash ? splash.attribute ("DarkModeBackgroundColor").as_string () : "";
return !bg.empty () ? bg : visual.attribute ("DarkModeBackgroundColor").as_string ();
}
std::wstring splash_screen_backgroundcolor_darkmode (const std::wstring &id = L"App") const { return pugi::as_wide (this->splash_screen_backgroundcolor_darkmode (pugi::as_utf8 (id))); }
bool is_appid_exists (const std::string &id) const
{
pugi::xml_node root = doc.document_element ();

View File

@@ -121,4 +121,73 @@ typedef struct version
}
return result;
}
} Version;
} Version;
#ifdef __cplusplus_cli
using namespace System;
using namespace System::Runtime::InteropServices;
[ComVisible (true)]
public ref class _I_Version
{
private:
UINT16 major = 0, minor = 0, build = 0, revision = 0;
public:
property UINT16 Major { UINT16 get () { return major; } void set (UINT16 value) { major = value; } }
property UINT16 Minor { UINT16 get () { return minor; } void set (UINT16 value) { minor = value; } }
property UINT16 Build { UINT16 get () { return build; } void set (UINT16 value) { build = value; } }
property UINT16 Revision { UINT16 get () { return revision; } void set (UINT16 value) { revision = value; } }
property array <UINT16> ^Data
{
array <UINT16> ^get ()
{
return gcnew array <UINT16> {
major, minor, build, revision
};
}
void set (array <UINT16> ^arr)
{
major = minor = build = revision = 0;
for (size_t i = 0; i < arr->Length; i ++)
{
switch (i)
{
case 0: major = arr [i]; break;
case 1: minor = arr [i]; break;
case 2: build = arr [i]; break;
case 3: revision = arr [i]; break;
default: break;
}
}
}
}
property String ^DataStr
{
String ^get () { return Stringify (); }
void set (String ^str) { Parse (str); }
}
_I_Version (UINT16 p_ma, UINT16 p_mi, UINT16 p_b, UINT16 p_r):
major (p_ma), minor (p_mi), build (p_b), revision (p_r) {}
_I_Version (UINT16 p_ma, UINT16 p_mi, UINT16 p_b):
major (p_ma), minor (p_mi), build (p_b), revision (0) {}
_I_Version (UINT16 p_ma, UINT16 p_mi):
major (p_ma), minor (p_mi), build (0), revision (0) {}
_I_Version (UINT16 p_ma):
major (p_ma), minor (0), build (0), revision (0) {}
_I_Version () {}
_I_Version %Parse (String ^ver)
{
auto strarr = ver->Split ('.');
auto arr = gcnew array <UINT16> (4);
for (size_t i = 0; i < strarr->Length; i ++)
{
try { arr [i] = Convert::ToUInt16 (strarr [i]); }
catch (...) {}
}
Data = arr;
return *this;
}
String ^Stringify () { return major + "." + minor + "." + build + "." + revision; }
String ^ToString () override { return Stringify (); }
bool Valid () { return Major != 0 && Minor != 0 && Build != 0 && Revision != 0; }
};
#endif

View File

@@ -242,7 +242,7 @@ Windows::Data::Xml::Dom::XmlDocument ^SimpleToastNoticeXml (const std::wstring &
auto node = dynamic_cast <Windows::Data::Xml::Dom::XmlElement ^> (imageNodes->Item (0));
if (node)
{
node->SetAttribute (L"src", ref new Platform::String (imguri && imguri->ToString ()->Data () ? imguri->ToString ()->Data () : img.c_str ()));
node->SetAttribute (L"src", ref new Platform::String (imguri && imguri->DisplayUri ? imguri->DisplayUri->Data () : img.c_str ()));
node->SetAttribute (L"alt", ref new Platform::String (L"image"));
}
}
@@ -313,7 +313,7 @@ Windows::Data::Xml::Dom::XmlDocument ^SimpleToastNoticeXml2 (const std::wstring
auto node = dynamic_cast <Windows::Data::Xml::Dom::XmlElement ^> (imageNodes->Item (0));
if (node)
{
node->SetAttribute (L"src", ref new Platform::String (imguri && imguri->ToString ()->Data () ? imguri->ToString ()->Data () : img.c_str ()));
node->SetAttribute (L"src", ref new Platform::String (imguri && imguri->DisplayUri ? imguri->DisplayUri->Data () : img.c_str ()));
node->SetAttribute (L"alt", ref new Platform::String (L"image"));
}
}

View File

@@ -65,7 +65,12 @@ static std::wstring StringToWString (const std::string &str, UINT codePage = CP_
using onprogress = AsyncOperationProgressHandler <DeploymentResult ^, DeploymentProgress>;
using onprogresscomp = AsyncOperationWithProgressCompletedHandler <DeploymentResult ^, DeploymentProgress>;
using progressopt = IAsyncOperationWithProgress <DeploymentResult ^, DeploymentProgress> ^;
template <typename TAsyncOpCreator> HRESULT RunPackageManagerOperation (TAsyncOpCreator asyncCreator, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
typedef struct PROGRESSCALLBACK_DATA__
{
PKGMRR_PROGRESSCALLBACK pfCallback;
void *pCustom;
} PROGRESSCALLBACK_DATA, PPROGRESSCALLBACK_DATA;
template <typename TAsyncOpCreator> HRESULT RunPackageManagerOperation (TAsyncOpCreator asyncCreator, PROGRESSCALLBACK_DATA pCallbackData, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
{
g_swExceptionCode = L"";
g_swExceptionDetail = L"";
@@ -80,8 +85,8 @@ template <typename TAsyncOpCreator> HRESULT RunPackageManagerOperation (TAsyncOp
hCompEvt = CreateEventExW (nullptr, nullptr, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
if (!hCompEvt) return E_FAIL;
auto depopt = asyncCreator ();
depopt->Progress = ref new onprogress ([pfCallback, pCustom] (progressopt operation, DeploymentProgress progress) {
if (pfCallback) pfCallback ((DWORD)progress.percentage, pCustom);
depopt->Progress = ref new onprogress ([pCallbackData] (progressopt operation, DeploymentProgress progress) {
if (pCallbackData.pfCallback) pCallbackData.pfCallback ((DWORD)progress.percentage, pCallbackData.pCustom);
});
depopt->Completed = ref new onprogresscomp ([&hCompEvt] (progressopt, Windows::Foundation::AsyncStatus) {
SetEvent (hCompEvt);
@@ -136,11 +141,13 @@ template <typename TAsyncOpCreator> HRESULT RunPackageManagerOperation (TAsyncOp
[MTAThread]
HRESULT AddAppxPackageFromURI (LPCWSTR lpPkgFileUri, PCREGISTER_PACKAGE_DEFENDENCIES alpDepUrlList, DWORD dwDeployOption, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
{
PROGRESSCALLBACK_DATA pdata = {pfCallback, pCustom};
return RunPackageManagerOperation ([=] () {
auto pkgmgr = ref new PackageManager ();
auto depuris = ref new Platform::Collections::Vector <Uri ^> ();
Platform::Collections::Vector <Uri ^> ^depuris = nullptr;
if (alpDepUrlList)
{
depuris = ref new Platform::Collections::Vector <Uri ^> ();
for (size_t i = 0; i < alpDepUrlList->dwSize; i ++)
{
auto &pstr = alpDepUrlList->alpDepUris [i];
@@ -166,13 +173,13 @@ HRESULT AddAppxPackageFromURI (LPCWSTR lpPkgFileUri, PCREGISTER_PACKAGE_DEFENDEN
}
catch (Exception ^e) { continue; }
}
if (depuris->Size == 0) depuris = nullptr;
}
if (depuris->Size > 0) depuris = nullptr;
else depuris = nullptr;
auto pkguri = ref new Uri (ref new String (lpPkgFileUri));
auto pkguristr = pkguri->ToString ();
auto ope = pkgmgr->AddPackageAsync (pkguri, depuris, (DeploymentOptions)dwDeployOption);
return ope;
}, pfCallback, pCustom, pErrorCode, pDetailMsg);
auto depopt = pkgmgr->AddPackageAsync (pkguri, depuris, (DeploymentOptions)dwDeployOption);
return depopt;
}, pdata, pErrorCode, pDetailMsg);
}
[MTAThread]
HRESULT AddAppxPackageFromPath (LPCWSTR lpPkgPath, PCREGISTER_PACKAGE_DEFENDENCIES alpDepUrlList, DWORD dwDeployOption, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
@@ -444,22 +451,25 @@ HRESULT GetAppxPackages (PKGMGR_FINDENUMCALLBACK pfCallback, void *pCustom, LPWS
[MTAThread]
HRESULT RemoveAppxPackage (LPCWSTR lpPkgFullName, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
{
PROGRESSCALLBACK_DATA pdata = {pfCallback, pCustom};
return RunPackageManagerOperation ([=] () {
auto pkgmgr = ref new PackageManager ();
return pkgmgr->RemovePackageAsync (ref new String (lpPkgFullName));
}, pfCallback, pCustom, pErrorCode, pDetailMsg);
}, pdata, pErrorCode, pDetailMsg);
}
[MTAThread]
HRESULT CleanupAppxPackage (LPCWSTR lpPkgName, LPCWSTR lpUserSID, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
{
PROGRESSCALLBACK_DATA pdata = {pfCallback, pCustom};
return RunPackageManagerOperation ([=] () {
auto pkgmgr = ref new PackageManager ();
return pkgmgr->CleanupPackageForUserAsync (ref new String (lpPkgName), ref new String (lpUserSID));
}, pfCallback, pCustom, pErrorCode, pDetailMsg);
}, pdata, pErrorCode, pDetailMsg);
}
[MTAThread]
HRESULT RegisterAppxPackageByUri (LPCWSTR lpManifestUri, PCREGISTER_PACKAGE_DEFENDENCIES alpDependencyUriList, DWORD dwDeployOption, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
{
PROGRESSCALLBACK_DATA pdata = {pfCallback, pCustom};
return RunPackageManagerOperation ([=] () {
auto pkgmgr = ref new PackageManager ();
auto depuris = ref new Platform::Collections::Vector <Uri ^> ();
@@ -491,9 +501,9 @@ HRESULT RegisterAppxPackageByUri (LPCWSTR lpManifestUri, PCREGISTER_PACKAGE_DEFE
catch (Exception ^e) { continue; }
}
}
if (depuris->Size > 0) depuris = nullptr;
if (depuris->Size == 0) depuris = nullptr;
return pkgmgr->RegisterPackageAsync (ref new Uri (ref new String (lpManifestUri)), depuris, (DeploymentOptions)dwDeployOption);
}, pfCallback, pCustom, pErrorCode, pDetailMsg);
}, pdata, pErrorCode, pDetailMsg);
}
[MTAThread]
HRESULT RegisterAppxPackageByPath (LPCWSTR lpManifestPath, PCREGISTER_PACKAGE_DEFENDENCIES alpDependencyUriList, DWORD dwDeployOption, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
@@ -505,6 +515,7 @@ HRESULT RegisterAppxPackageByPath (LPCWSTR lpManifestPath, PCREGISTER_PACKAGE_DE
[MTAThread]
HRESULT RegisterAppxPackageByFullName (LPCWSTR lpPackageFullName, PCREGISTER_PACKAGE_DEFENDENCIES alpDepFullNameList, DWORD dwDeployOption, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
{
PROGRESSCALLBACK_DATA pdata = {pfCallback, pCustom};
return RunPackageManagerOperation ([=] () {
auto pkgmgr = ref new PackageManager ();
auto depuris = ref new Platform::Collections::Vector <String ^> ();
@@ -517,9 +528,9 @@ HRESULT RegisterAppxPackageByFullName (LPCWSTR lpPackageFullName, PCREGISTER_PAC
catch (Exception ^e) { continue; }
}
}
if (depuris->Size > 0) depuris = nullptr;
if (depuris->Size == 0) depuris = nullptr;
return pkgmgr->RegisterPackageByFullNameAsync (ref new String (lpPackageFullName), depuris, (DeploymentOptions)dwDeployOption);
}, pfCallback, pCustom, pErrorCode, pDetailMsg);
}, pdata, pErrorCode, pDetailMsg);
}
template <typename TFunction> HRESULT ExecPackageManagerFunctionNoReturn (TFunction func, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
{
@@ -561,6 +572,7 @@ HRESULT SetAppxPackageStatus (LPCWSTR lpPackageFullName, DWORD dwStatus, LPWSTR
[MTAThread]
HRESULT StageAppxPackageFromURI (LPCWSTR lpFileUri, PCREGISTER_PACKAGE_DEFENDENCIES alpDepUriList, DWORD dwDeployOption, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
{
PROGRESSCALLBACK_DATA pdata = {pfCallback, pCustom};
return RunPackageManagerOperation ([=] () {
auto pkgmgr = ref new PackageManager ();
auto depuris = ref new Platform::Collections::Vector <Uri ^> ();
@@ -592,9 +604,9 @@ HRESULT StageAppxPackageFromURI (LPCWSTR lpFileUri, PCREGISTER_PACKAGE_DEFENDENC
catch (Exception ^e) { continue; }
}
}
if (depuris->Size > 0) depuris = nullptr;
if (depuris->Size == 0) depuris = nullptr;
return pkgmgr->StagePackageAsync (ref new Uri (ref new String (lpFileUri)), depuris, (DeploymentOptions)dwDeployOption);
}, pfCallback, pCustom, pErrorCode, pDetailMsg);
}, pdata, pErrorCode, pDetailMsg);
}
[MTAThread]
HRESULT StageAppxPackageFromPath (LPCWSTR lpPkgPath, PCREGISTER_PACKAGE_DEFENDENCIES alpDepUriList, DWORD dwDeployOption, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
@@ -606,14 +618,16 @@ HRESULT StageAppxPackageFromPath (LPCWSTR lpPkgPath, PCREGISTER_PACKAGE_DEFENDEN
[MTAThread]
HRESULT StageAppxUserData (LPCWSTR lpPackageFullName, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
{
PROGRESSCALLBACK_DATA pdata = {pfCallback, pCustom};
return RunPackageManagerOperation ([=] () {
auto pkgmgr = ref new PackageManager ();
return pkgmgr->StageUserDataAsync (ref new String (lpPackageFullName));
}, pfCallback, pCustom, pErrorCode, pDetailMsg);
}, pdata, pErrorCode, pDetailMsg);
}
[MTAThread]
HRESULT UpdateAppxPackageFromURI (LPCWSTR lpPkgFileUri, PCREGISTER_PACKAGE_DEFENDENCIES alpDepUrlList, DWORD dwDeployOption, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)
{
PROGRESSCALLBACK_DATA pdata = {pfCallback, pCustom};
return RunPackageManagerOperation ([=] () {
auto pkgmgr = ref new PackageManager ();
auto depuris = ref new Platform::Collections::Vector <Uri ^> ();
@@ -645,9 +659,9 @@ HRESULT UpdateAppxPackageFromURI (LPCWSTR lpPkgFileUri, PCREGISTER_PACKAGE_DEFEN
catch (Exception ^e) { continue; }
}
}
if (depuris->Size > 0) depuris = nullptr;
if (depuris->Size == 0) depuris = nullptr;
return pkgmgr->UpdatePackageAsync (ref new Uri (ref new String (lpPkgFileUri)), depuris, (DeploymentOptions)dwDeployOption);
}, pfCallback, pCustom, pErrorCode, pDetailMsg);
}, pdata, pErrorCode, pDetailMsg);
}
[MTAThread]
HRESULT UpdateAppxPackageFromPath (LPCWSTR lpPkgPath, PCREGISTER_PACKAGE_DEFENDENCIES alpDepUrlList, DWORD dwDeployOption, PKGMRR_PROGRESSCALLBACK pfCallback, void *pCustom, LPWSTR *pErrorCode, LPWSTR *pDetailMsg)

View File

@@ -7,6 +7,6 @@
Lnk32x32Logo="Icons\Main.ico"
BackgroundColor='#0078D7'>
<DefaultTile ShowName='allLogos'/>
<SplashScreen Image="VisualElements\SplashLarge.png" BackgroundColor="#0078d7" />
<SplashScreen Image="VisualElements\SplashLarge.png" BackgroundColor="#0078d7" DarkModeBackgroundColor='#001629' />
</VisualElements>
</Application>

Binary file not shown.

View File

@@ -11,6 +11,44 @@ body * {
-ms-overflow-style: -ms-autohiding-scrollbar;
}
*,
button,
input,
select,
textarea,
a,
label,
p,
span,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
li,
dl,
dt,
dd,
table,
th,
td,
tr,
img,
iframe,
object,
embed,
audio,
video,
canvas,
form,
fieldset,
legend {
font-family: "Microsoft YaHei", "Segoe UI", "Ebrima", "Nirmala", "Gadugi", "Segoe UI Emoji", "Segoe UI Symbol", "Meiryo", "Leelawadee", "Microsoft JhengHei", "Malgun Gothic", "Estrangelo Edessa", "Microsoft Himalaya", "Microsoft New Tai Lue", "Microsoft PhagsPa", "Microsoft Tai Le", "Microsoft Yi Baiti", "Mongolian Baiti", "MV Boli", "Myanmar Text", "Javanese Text", "Cambria Math";
}
.pagecontainer {
padding: 0px;
position: absolute;
@@ -54,7 +92,8 @@ body * {
.page.splash {
padding: 0px;
background-color: #333;
/* background-color: #333; */
background-color: #0078d7;
}
.page.splash>img {
@@ -331,14 +370,28 @@ progress.win-ring:indeterminate::-ms-fill {
box-sizing: border-box;
}
.content #moreinfo-flyout-content p>span:nth-child(1) {
#moreinfo-flyout-content p>span:nth-child(1) {
-ms-user-select: none;
}
.content #moreinfo-flyout-content>span:nth-child(2) {
#moreinfo-flyout-content>span:nth-child(2) {
color: darkgray;
}
#moreinfo-flyout p {
margin: 0;
font-weight: normal;
}
#moreinfo-flyout ul {
margin: 0;
padding-left: 16px;
}
#moreinfo-flyout ul li {
margin: 0;
}
.progress * {
width: 100%;
}
@@ -380,6 +433,15 @@ progress.win-ring:indeterminate::-ms-fill {
display: none;
}
.page>.controls {
display: flex;
}
.page.splash>.controls,
.page.loading>.controls {
display: none;
}
.page.splash>.splash {
display: block;
}
@@ -413,23 +475,28 @@ progress.win-ring:indeterminate::-ms-fill {
display: block;
}
.page.select>.controls.select,
.page.installsuccess>.controls.installsuccess,
.page.installfailed>.controls.installfailed {
.page.select .controls,
.page.preinstall .controls,
.page.installing .controls,
.page.installsuccess .controls,
.page.installfailed .controls {
display: flex;
display: -ms-flexbox;
}
.page.preinstall>.controls.preinstall,
.page.installing>.controls.installing {
.page.preinstall .controls,
.page.installing .controls {
display: flex;
display: -ms-flexbox;
flex-direction: row;
-ms-flex-direction: row;
}
.page.select>.controls.select>.checkbox {
.page.select>.controls>.checkbox {
display: none;
}
.page.select>.controls.select>.command button:nth-of-type(2) {
.page.select>.controls>.command button:nth-of-type(2) {
/*display: none;*/
}
@@ -488,7 +555,7 @@ progress.win-ring:indeterminate::-ms-fill {
display: none;
}
.page.installing>.controls.installing .command {
.page.installing>.controls .command {
display: none;
}
@@ -496,8 +563,8 @@ progress.win-ring:indeterminate::-ms-fill {
display: block;
}
.page.installsuccess>.controls.installsuccess .checkbox,
.page.installfailed>.controls.installfailed .checkbox {
.page.installsuccess>.controls .checkbox,
.page.installfailed>.controls .checkbox {
display: none;
}
@@ -541,7 +608,7 @@ progress.win-ring:indeterminate::-ms-fill {
display: block;
}
.page.installsuccess>.controls.installsuccess>.command button:nth-of-type(2),
.page.installfailed>.controls.installsuccess>.command button:nth-of-type(2) {
.page.installsuccess>.controls>.command button:nth-of-type(2),
.page.installfailed>.controls>.command button:nth-of-type(2) {
display: none;
}

View File

@@ -8,9 +8,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="js/module.js"></script>
<script type="text/javascript" src="js/polyfill-ie.js"></script>
<link rel="stylesheet" href="libs/winjs/2.0/css/ui-light.css">
<script type="text/javascript" src="libs/winjs/2.0/js/base.js"></script>
<script type="text/javascript" src="libs/winjs/2.0/js/ui.js"></script>
<link rel="stylesheet" href="libs/winjs/2.0/css/ui-light.css" id="winjs-style">
<script type="text/javascript" src="libs/winjs/1.0/js/base.js"></script>
<script type="text/javascript" src="libs/winjs/1.0/js/ui.js"></script>
<script type="text/javascript" src="js/color.js"></script>
<script type="text/javascript" src="js/promise.js"></script>
<script type="text/javascript" src="js/bridge.js"></script>
@@ -22,8 +22,12 @@
<script type="text/javascript" src="js/event.js"></script>
<script type="text/javascript" src="js/tileback.js"></script>
<script type="text/javascript" src="js/pages.js"></script>
<script type="text/javascript" src="js/theme.js"></script>
<script type="text/javascript" src="js/load.js"></script>
<script type="text/javascript" src="js/init.js"></script>
<link rel="stylesheet" type="text/css" href="libs/msgbox/msgbox.css">
<script type="text/javascript" src="libs/msgbox/msgbox.js"></script>
<link rel="stylesheet" type="text/css" href="theme/light/default.css" id="theme-style">
</head>
<body>
@@ -176,30 +180,7 @@
</ul>
</div>
<a class="moreinfo" data-res-byname="IDS_MOREINFO" tabindex="0"></a>
<div data-win-control="WinJS.UI.Flyout" id="moreinfo-flyout" style="max-width: 80%; max-height: 80%;">
<div id="moreinfo-flyout-content" style="-ms-user-select: element; user-select: text; padding: 0 0 25px 0; box-sizing: border-box;;">
<div style="width: 100%;">
<p><span colspan="2" style="font-weight: bold;" data-res-byname="IDS_MOREINFO_ID"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDNAME"></span>: <span class="id name"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDPUBLISHER"></span>: <span class="id publisher"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDVERSION"></span>: <span class="id version"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDARCH"></span>: <span class="id arch"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDFAMILY"></span>: <span class="id family"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDFULL"></span>: <span class="id full"></span></p>
</div>
<div style="width: 100%; display: none;">
<p><span colspan="2" style="font-weight:bold;" data-res-byname="IDS_MOREINFO_PROP"></span></p>
<p><span data-res-byname="IDS_MOREINFO_PROPFREAMWORK"></span>: <span class="prop framework"></span></p>
<p><span data-res-byname="IDS_MOREINFO_PROPRESPKG"></span>: <span class="prop respkg"></span></p>
</div>
<div style="width: 100%;">
<p><span colspan="2" style="font-weight:bold;" data-res-byname="IDS_MOREINFO_INFO"></span></p>
<p><span data-res-byname="IDS_MOREINFO_INFOSYS"></span>: <span class="info sys"></span></p>
<p><span data-res-byname="IDS_MOREINFO_INFOLANG"></span>: </p>
<ul class="info langs"></ul>
</div>
</div>
</div>
<script>
(function() {
"use strict";
@@ -298,18 +279,6 @@
});
})();
</script>
<script>
(function() {
"Use strict";
var page = document.querySelector(".page");
var content = page.querySelector(".content.preinstall");
var moreinfo = page.querySelector(".moreinfo");
Windows.UI.Event.Util.addEvent(moreinfo, "click", function() {
var flyout = document.getElementById("moreinfo-flyout").winControl;
flyout.show(this);
});
})();
</script>
</div>
<div class="progress installing">
<div>
@@ -321,7 +290,7 @@
<p data-res-byname="IDS_FAILED_REASONNAME"></p>
<textarea class="win-textarea" readonly></textarea>
</div>
<div class="controls select preinstall installing installsuccess installfailed">
<div class="controls">
<div class="checkbox">
<input type="checkbox" id="preinst-enablelaunch" class="win-checkbox">
<label for="preinst-enablelaunch" data-res-byname="IDS_LAUNCHWHENREADY"></label>
@@ -333,6 +302,42 @@
</div>
</div>
</div>
<div data-win-control="WinJS.UI.Flyout" id="moreinfo-flyout" style="max-width: 80%; max-height: 80%; position: absolute;">
<div id="moreinfo-flyout-content" style="-ms-user-select: element; user-select: text; padding: 0 0 25px 0; box-sizing: border-box;;">
<div style="width: 100%;">
<p><span colspan="2" style="font-weight: bold;" data-res-byname="IDS_MOREINFO_ID"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDNAME"></span>: <span class="id name"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDPUBLISHER"></span>: <span class="id publisher"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDVERSION"></span>: <span class="id version"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDARCH"></span>: <span class="id arch"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDFAMILY"></span>: <span class="id family"></span></p>
<p><span data-res-byname="IDS_MOREINFO_IDFULL"></span>: <span class="id full"></span></p>
</div>
<div style="width: 100%; display: none;">
<p><span colspan="2" style="font-weight:bold;" data-res-byname="IDS_MOREINFO_PROP"></span></p>
<p><span data-res-byname="IDS_MOREINFO_PROPFREAMWORK"></span>: <span class="prop framework"></span></p>
<p><span data-res-byname="IDS_MOREINFO_PROPRESPKG"></span>: <span class="prop respkg"></span></p>
</div>
<div style="width: 100%;">
<p><span colspan="2" style="font-weight:bold;" data-res-byname="IDS_MOREINFO_INFO"></span></p>
<p><span data-res-byname="IDS_MOREINFO_INFOSYS"></span>: <span class="info sys"></span></p>
<p><span data-res-byname="IDS_MOREINFO_INFOLANG"></span>: </p>
<ul class="info langs"></ul>
</div>
</div>
</div>
<script>
(function() {
"Use strict";
var page = document.querySelector(".page");
var content = page.querySelector(".content.preinstall");
var moreinfo = page.querySelector(".moreinfo");
Windows.UI.Event.Util.addEvent(moreinfo, "click", function() {
var flyout = document.getElementById("moreinfo-flyout").winControl;
flyout.show(this);
});
})();
</script>
</body>
</html>

View File

@@ -57,6 +57,16 @@
break;
}
}
var strutils = Bridge.NString;
if (swPageLabel == "splash" || swPageLabel == "loading") {
var controls = page.querySelector(".controls");
if (controls) controls.style.display = "none";
} else {
var controls = page.querySelector(".controls");
if (controls) controls.style.display = "flex";
if (controls.style.display == 'none') controls.style.display = "-ms-flex";
if (controls.style.display == 'none') controls.style.display = "-ms-flexbox";
}
(function() {
if (Bridge.NString.equals(swPageLabel, "loading")) {
var content = page.querySelector(".content.loading");
@@ -90,7 +100,7 @@
}
}
var content = page.querySelector(".content." + Bridge.String.trim(swPageLabel));
var controls = page.querySelector(".controls." + Bridge.String.trim(swPageLabel));
var controls = page.querySelector(".controls");
var progress = page.querySelector(".progress");
var reason = page.querySelector(".reason");
var titlepart = [];

5
shared/html/js/theme.js Normal file
View File

@@ -0,0 +1,5 @@
(function(global) {
"use strict";
function changeDarkMode(mode) {}
})(this);

View File

@@ -0,0 +1,75 @@
.notice-back {
background-color: rgba(0, 0, 0, 0.5);
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
height: auto;
width: auto;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
transition: all 0.15s linear;
opacity: 0;
}
.notice-body {
background: #0078d7;
padding: 25px 172px;
left: 0;
right: 0;
top: auto;
bottom: auto;
max-height: 80%;
height: auto;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
min-height: 0 !important;
box-sizing: border-box;
}
.notice-body>h1,
.notice-body>h2,
.notice-body>h3,
.notice-body>h4,
.notice-body>h5,
.notice-body>h6,
.notice-body>p,
.notice-body>a,
.notice-body>span {
font-family: "Microsoft YaHei", "Segoe UI", "Ebrima", "Nirmala", "Gadugi", "Segoe UI Emoji", "Segoe UI Symbol", "Meiryo", "Leelawadee", "Microsoft JhengHei", "Malgun Gothic", "Estrangelo Edessa", "Microsoft Himalaya", "Microsoft New Tai Lue", "Microsoft PhagsPa", "Microsoft Tai Le", "Microsoft Yi Baiti", "Mongolian Baiti", "MV Boli", "Myanmar Text", "Javanese Text", "Cambria Math";
white-space: pre-wrap;
word-break: break-all;
}
.notice-title {
color: white;
font-weight: normal;
white-space: pre-wrap;
}
.notice-text {
color: white;
font-weight: normal;
white-space: pre-wrap;
-ms-overflow-style: -ms-autohiding-scrollbar;
}
.notice-controls {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: flex-end;
align-items: center;
margin-top: 10px;
/*gap: 20px;*/
}
.notice-btn {
margin-left: 20px;
}

View File

@@ -0,0 +1,349 @@
function IsBlackLabel(text) {
if (text === null || text === undefined) return true;
var trimmed = String(text).replace(/^\s+|\s+$/g, '');
return trimmed === '';
}
var MBFLAGS = {
MB_OK: 0x00000000,
MB_OKCANCEL: 0x00000001,
MB_ABORTRETRYIGNORE: 0x00000002,
MB_YESNOCANCEL: 0x00000003,
MB_YESNO: 0x00000004,
MB_RETRYCANCEL: 0x00000005,
MB_CANCELTRYCONTINUE: 0x00000006,
MB_HELP: 0x00004000,
MB_DEFBUTTON1: 0x00000000,
MB_DEFBUTTON2: 0x00000100,
MB_DEFBUTTON3: 0x00000200,
MB_DEFBUTTON4: 0x00000300,
MB_ICONERROR: 0x00000010,
MB_ICONWARNING: 0x00000030,
MB_ICONINFORMATION: 0x00000040
};
var MBRET = {
IDOK: 1,
IDCANCEL: 2,
IDABORT: 3,
IDRETRY: 4,
IDIGNORE: 5,
IDYES: 6,
IDNO: 7,
IDCLOSE: 8,
IDHELP: 9,
IDTRYAGAIN: 10,
IDCONTINUE: 11
};
Object.freeze(MBFLAGS);
Object.freeze(MBRET);
function GetLocaleStringFromResId(resId) { return Bridge.Resources.byid(resId); }
var msgboxResult = {};
function MessageBox(_lpText, _lpCaption, _uType, _objColor) {
var id = MessageBoxForJS(_lpText, _lpCaption, _uType, _objColor, function(valueReturn) {
getRes = valueReturn;
msgboxResult[id] = valueReturn;
});
return id;
}
function GetMessageBoxResult(msgboxId) {
var result = msgboxResult[msgboxId];
if (result === undefined || result === null) return null;
msgboxResult[msgboxId] = null;
return result;
}
function ClearAllMessageBoxResults() {
msgboxResult = null;
msgboxResult = {};
}
// 注意callback 函数无返回值,传入参数:整数型 按下的按钮值。
/*
使用示例:
MessageBoxForJS("请选择一个按钮", "", MBFLAGS.MB_OKCANCEL, "#0078d7", function(value) {
console.log("MessageBoxForJS callback value: " + value);
})
*/
function MessageBoxForJS(_lpText, _lpCaption, _uType, _objColor, _callback) {
var msgbox = document.createElement("div");
msgbox.classList.add("notice-back");
msgbox.classList.add("win-ui-dark");
var uniqueId = "msgbox_" + new Date().getTime();
msgbox.id = uniqueId;
var msgbody = document.createElement("div");
msgbody.classList.add("notice-body");
if (!IsBlackLabel(_objColor)) {
msgbody.style.backgroundColor = _objColor;
}
msgbox.appendChild(msgbody);
var msgcontainter = document.createElement("div");
msgcontainter.style.height = "100%";
msgcontainter.style.width = "100%";
msgcontainter.style.maxHeight = "100%";
msgcontainter.style.minHeight = "0px";
msgcontainter.style.boxSizing = "border-box";
msgbody.appendChild(msgcontainter);
var msgcaption = document.createElement("div");
msgcontainter.appendChild(msgcaption);
msgcontainter.style.display = "flex";
msgcontainter.style.flexDirection = "column";
var msgcontent = document.createElement("div");
msgcontent.style.flex = "1 1 auto";
msgcontent.style.marginRight = "3px";
msgcontent.style.overflowX = "hidden";
msgcontent.style.overflowY = "auto";
msgcontent.style.minHeight = "0px";
msgcontainter.appendChild(msgcontent);
if (_lpCaption instanceof HTMLElement) {
msgcaption.appendChild(_lpCaption);
msgcaption.classList.add("notice-title");
} else {
if (!IsBlackLabel(_lpCaption)) {
var msgtitle = document.createElement("h2");
msgtitle.textContent = _lpCaption;
msgtitle.classList.add("notice-title");
msgcaption.appendChild(msgtitle);
} else {
var msgtitle = document.createElement("h2");
msgtitle.textContent = "";
msgtitle.classList.add("notice-title");
msgcaption.appendChild(msgtitle);
}
}
if (_lpText instanceof HTMLElement) {
_lpText.classList.add("notice-text");
msgcontent.appendChild(_lpText);
} else {
if (!IsBlackLabel(_lpText)) {
var msgtext = document.createElement("p");
msgtext.textContent = _lpText;
msgtext.classList.add("notice-text");
if (IsBlackLabel(_lpCaption)) {
msgtext.style.marginTop = "0";
}
msgcontent.appendChild(msgtext);
} else {
var msgtext = document.createElement("p");
msgtext.innerText = "";
msgtext.classList.add("notice-text");
if (IsBlackLabel(_lpCaption)) {
msgtext.style.marginTop = "0";
}
msgcontent.appendChild(msgtext);
}
}
var msgctrls = document.createElement("div");
msgctrls.classList.add("notice-controls");
msgcontainter.appendChild(msgctrls);
var cnt = 0;
var cbFuncPress = function(valueReturn) {
getRes = valueReturn;
msgbox.style.opacity = 0;
setTimeout(function() {
document.body.removeChild(msgbox);
}, 500);
if (_callback) {
_callback(valueReturn);
}
};
var pfCreateButton = function(displayNameResId, valueReturn) {
var btn = document.createElement("button");
btn.innerHTML = GetLocaleStringFromResId(displayNameResId);
btn.classList.add("notice-btn");
btn.addEventListener("click", function() {
cbFuncPress(valueReturn);
});
msgctrls.appendChild(btn);
};
if ((_uType & MBFLAGS.MB_HELP) === MBFLAGS.MB_HELP) {
pfCreateButton(808, MBRET.IDHELP);
}
for (cnt = 0; cnt <= MBFLAGS.MB_RETRYCANCEL; cnt++) {
if ((_uType & 0xF) === cnt) {
switch (cnt) {
case MBFLAGS.MB_OK:
{
pfCreateButton(800, MBRET.IDOK);
}
break;
case MBFLAGS.MB_OKCANCEL:
{
pfCreateButton(800, MBRET.IDOK);
pfCreateButton(801, MBRET.IDCANCEL);
}
break;
case MBFLAGS.MB_ABORTRETRYIGNORE:
{
pfCreateButton(802, MBRET.IDABORT);
pfCreateButton(803, MBRET.IDRETRY);
pfCreateButton(804, MBRET.IDIGNORE);
}
break;
case MBFLAGS.MB_YESNOCANCEL:
{
pfCreateButton(805, MBRET.IDYES);
pfCreateButton(806, MBRET.IDNO);
pfCreateButton(801, MBRET.IDCANCEL);
}
break;
case MBFLAGS.MB_YESNO:
{
pfCreateButton(805, MBRET.IDYES);
pfCreateButton(806, MBRET.IDNO);
}
break;
case MBFLAGS.MB_RETRYCANCEL:
{
pfCreateButton(803, MBRET.IDRETRY);
pfCreateButton(801, MBRET.IDCANCEL);
}
break;
case MBFLAGS.MB_CANCELTRYCONTINUE:
{
pfCreateButton(801, MBRET.IDCANCEL);
pfCreateButton(803, MBRET.IDRETRY);
pfCreateButton(810, MBRET.IDCONTINUE);
}
break;
}
}
}
var btns = msgctrls.querySelectorAll("button");
var defaultBtnCnt = 0;
if ((_uType & MBFLAGS.MB_DEFBUTTON1) === MBFLAGS.MB_DEFBUTTON1) defaultBtnCnt = 0;
if ((_uType & MBFLAGS.MB_DEFBUTTON2) === MBFLAGS.MB_DEFBUTTON2) defaultBtnCnt = 1;
if ((_uType & MBFLAGS.MB_DEFBUTTON3) === MBFLAGS.MB_DEFBUTTON3) defaultBtnCnt = 2;
if ((_uType & MBFLAGS.MB_DEFBUTTON4) === MBFLAGS.MB_DEFBUTTON4) defaultBtnCnt = 3;
for (cnt = 0; cnt < btns.length; cnt++) {
if (cnt === defaultBtnCnt) {
btns[cnt].focus();
break;
}
}
document.body.appendChild(msgbox);
setTimeout(function() {
msgbox.style.opacity = 1;
}, 1);
return msgbox.id;
}
function MsgBoxObj() {
this.elementId = "";
this.callback = null;
this.type = MBFLAGS.MB_OK;
this._boundCallback = this._internalCallback.bind(this);
this._text = "";
this._title = "";
this._color = "#0078d7";
this.show = function() {
this.elementId = MessageBoxForJS(
this._text,
this._title,
this.type,
this._color,
this._boundCallback
);
setTimeout(function() {
var element = document.getElementById(this.elementId);
if (element) {
var bodyElement = element.querySelector(".notice-body");
if (bodyElement) {
bodyElement.style.transition = "all 0.5s linear";
}
}
}.bind(this), 100);
}
Object.defineProperty(this, "text", {
get: function() {
return this._text;
},
set: function(value) {
this._text = value;
if (this.elementId) {
var element = document.getElementById(this.elementId);
if (element) {
var textElement = element.querySelector(".notice-text");
if (textElement) {
if (value instanceof HTMLElement) {
value.classList.add("notice-text");
textElement.parentNode.replaceChild(value, textElement);
} else {
textElement.innerHTML = value;
}
}
}
}
}
});
Object.defineProperty(this, "title", {
get: function() {
return this._title;
},
set: function(value) {
this._title = value;
if (this.elementId) {
var element = document.getElementById(this.elementId);
if (element) {
var titleElement = element.querySelector(".notice-title");
if (titleElement) {
titleElement.innerHTML = value;
}
}
}
}
});
Object.defineProperty(this, "color", {
get: function() {
return this._color;
},
set: function(value) {
this._color = value;
if (this.elementId) {
var element = document.getElementById(this.elementId);
if (element) {
var bodyElement = element.querySelector(".notice-body");
if (bodyElement) {
bodyElement.style.backgroundColor = value;
}
}
}
}
});
this.getElement = function() {
return document.getElementById(this.elementId);
};
}
MsgBoxObj.prototype._internalCallback = function(returnValue) {
if (typeof this.callback === "function") {
this.callback(returnValue);
}
};
/**
* 异步显示消息框,返回一个 Promise 对象。
* @param {string | HTMLElement} swText 内容
* @param {string} swTitle 标题
* @param {MBFLAGS} uType 标志,使用 MBFLAGS 常量
* @param {string} swColor 背景颜色文本。
* @returns
*/
function messageBoxAsync(swText, swTitle, uType, swColor, pfCallback) {
if (typeof Promise === "undefined") {
console.error("Promise is not supported in this environment.");
MessageBoxForJS(swText, swTitle, uType, swColor, pfCallback);
}
return new Promise(function(resolve, reject) {
try {
MessageBoxForJS(swText, swTitle, uType, swColor, function(valueReturn) {
if (resolve) resolve(valueReturn);
});
} catch (ex) {
if (reject) reject(ex);
}
});
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,63 @@
/// <loc filename="Metadata\base.strings_loc_oam.xml" format="messagebundle" />
/*!
© Microsoft. All rights reserved.
This library is supported for use in Windows Store apps only.
Build: 1.0.9200.20602.win8_ldr.130108-1504
Version: Microsoft.WinJS.1.0
*/
(function (global) {
global.strings = global.strings || {};
var appxVersion = "Microsoft.WinJS.1.0";
var developerPrefix = "Developer.";
if (appxVersion.indexOf(developerPrefix) === 0) {
appxVersion = appxVersion.substring(developerPrefix.length);
}
function addStrings(keyPrefix, strings) {
Object.keys(strings).forEach(function (key) {
global.strings[keyPrefix + key.replace("\\", "/")] = strings[key];
});
}
addStrings(
"ms-resource://"+appxVersion+"/base/",
{
"attributeBindingSingleProperty": "Attribute binding requires a single destination attribute name, often in the form \"this['aria-label']\" or \"width\".",
"bindingInitializerNotFound": "Initializer not found:'{0}'",
"cannotBindToThis": "Can't bind to 'this'.",
"creatingNewProperty": "Creating new property {0}. Full path:{1}",
"dataSourceNotFound": "Data source not found:{0}",
"duplicateBindingDetected": "Binding against element with id {0} failed because a duplicate id was detected.",
"elementNotFound": "Element not found:{0}",
"errorActivatingControl": "Error activating control: {0}",
"errorInitializingBindings": "Error initializing bindings: {0}",
"exceptionFromBindingInitializer": "Exception thrown from binding initializer: {0}",
"idBindingNotSupported": "Declarative binding to ID field is not supported. Initializer: {0}",
"illegalListLength": "List length must be assigned a finite positive number",
"invalidBinding": "Invalid binding:'{0}'. Expected to be '<destProp>:<sourceProp>;'. {1}",
"invalidFragmentUri": "Unsupported uri for fragment loading. Fragments in the local context can only load from package content or local sources. To load fragments from other sources, use a web context.",
"invalidOptionsRecord": "Invalid options record: '{0}', expected to be in the format of an object literal. {1}",
"malformedFormatStringInput": "Malformed, did you mean to escape your '{0}'?",
"nestedDOMElementBindingNotSupported": "Binding through a property {0} of type HTMLElement is not supported, Full path:{1}.",
"nestingExceeded": "NestingExceeded",
"notFound": "NotFound: {0}",
"notSupportedForProcessing": "Value is not supported within a declarative processing context, if you want it to be supported mark it using WinJS.Utilities.markSupportedForProcessing. The value was: '{0}'",
"nonStaticHTML": "Unable to add dynamic content. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe. For example, using the innerHTML property or the document.write method to add a script element will generate this exception. If the content is safe and from a trusted source, use a method to explicitly manipulate elements and attributes, such as createElement, or use setInnerHTMLUnsafe (or other unsafe method).",
"propertyDoesNotExist": "{0} doesn't exist. Full path:{1}",
"propertyIsUndefined": "{0} is undefined",
"sparseArrayNotSupported": "Sparse arrays are not supported with proxy: true",
"unexpectedTokenExpectedToken": "Unexpected token: {0}, expected token: {1}, at offset {2}",
"unexpectedTokenExpectedTokens": "Unexpected token: {0}, expected one of: {1}, at offset {2}",
"unexpectedTokenGeneric": "Unexpected token: {0}, at offset {1}",
"unsupportedDataTypeForBinding": "Unsupported data type"
}
);
}(this));

View File

@@ -0,0 +1,300 @@
/// <loc filename="Metadata\ui.strings_loc_oam.xml" format="messagebundle" />
/*!
© Microsoft. All rights reserved.
This library is supported for use in Windows Store apps only.
Build: 1.0.9200.20602.win8_ldr.130108-1504
Version: Microsoft.WinJS.1.0
*/
(function (global) {
global.strings = global.strings || {};
var appxVersion = "Microsoft.WinJS.1.0";
var developerPrefix = "Developer.";
if (appxVersion.indexOf(developerPrefix) === 0) {
appxVersion = appxVersion.substring(developerPrefix.length);
}
function addStrings(keyPrefix, strings) {
Object.keys(strings).forEach(function (key) {
global.strings[keyPrefix + key.replace("\\", "/")] = strings[key];
});
}
addStrings(
"ms-resource://"+appxVersion+"/ui/",
{
"appBarAriaLabel": "App Bar",
"appBarCommandAriaLabel": "App Bar Item",
"automaticallyLoadPagesIsInvalid": "Invalid argument: automaticallyLoadPages must be a boolean.",
"averageRating": "Average Rating",
"backbuttonarialabel": "Back",
"badAlignment": "Invalid argument: Flyout alignment should be 'center' (default), 'left', or 'right'.",
"badAxis": "Invalid argument: orientation must be a string, either 'horizontal' or 'vertical'",
"badButtonElement": "Invalid argument: For a button, toggle, or flyout command, the element must be null or a button element",
"badClick": "Invalid argument: The onclick property for an {0} must be a function",
"badCurrentPage": "Invalid argument: currentPage must be a number greater than or equal to zero and be within the bounds of the datasource",
"badFlyout": "Invalid argument: The flyout property for an {0} must be a Flyout or String id of a Flyout",
"badHrElement": "Invalid argument: For a separator, the element must be null or an hr element",
"badItemSpacingAmount": "Invalid argument: itemSpacing must be a number greater than or equal to zero",
"badLayout": "Invalid argument: The layout property must be 'custom' or 'commands'",
"badPlacement": "Invalid argument: Flyout placement should be 'top' (default), 'bottom', 'left', 'right', or 'auto'.",
"badReference": "Invalid argument: Invalid href to settings flyout fragment",
"cannotChangeCommandsWhenVisible": "Invalid argument: You must call hide() before changing {0} commands",
"cannotChangeHiddenProperty": "Unable to set hidden property while parent {0} is visible.",
"cannotChangeLayoutWhenVisible": "Invalid argument: The layout property cannot be set when the AppBar is visible, call hide() first",
"cannotChangePlacementWhenVisible": "Invalid argument: The placement property cannot be set when the AppBar is visible, call hide() first",
"clearYourRating" : "Clear your rating",
"closeOverlay" : "Close",
"duplicateConstruction": "Invalid argument: Controls may only be instantiated one time for each DOM element",
"flipViewNavigationDuringStateChange": "Error: After changing itemDataSource or itemTemplate, any navigation in the FlipView control should be delayed until the pageselected event is fired.",
"flipViewPanningContainerAriaLabel": "Scrolling Container",
"flyoutAriaLabel": "Flyout",
"indexIsInvalid": "Invalid argument: index must be a non-negative integer.",
"invalidCountReturned": "Error: data adapter should return undefined, null, CountResult.unknown, or a non-negative integer for the count.",
"invalidIndexReturned": "Error: data adapter should return undefined, null or a non-negative integer for the index.",
"invalidItemReturned": "Error: data adapter returned item that is not an object.",
"invalidItemsManagerCallback": "Invalid argument: {0} must be a function.",
"invalidKeyReturned": "Error: data adapter returned item with undefined or null key.",
"invalidViewBoxChildren": "ViewBox expects to only have one child element",
"invalidTemplate": "Invalid template: Templates must be created before being passed to the ListView, and must contain a valid tree of elements.",
"invalidZoomFactor": "Invalid zoomFactor",
"invalidRequestedCountReturned": "Error: data adapter should return CountResult.unknown, CountResult.failure, or a non-negative integer for the count.",
"itemIsInvalid": "Invalid argument: item must be a DOM element that was returned by the Items Manager, and has not been replaced or released.",
"itemRendererIsInvalid": "Invalid argument: itemRenderer must be a function.",
"keyIsInvalid": "Invalid argument: key must be a string.",
"layoutIsInvalid": "Invalid argument: layout must be one of following values: 'verticalgrid', 'horizontalgrid' or 'list'.",
"layoutNotInitialized": "Layout is not initialized.",
"listDataAdapterIsInvalid": "Invalid argument: listDataAdapter must be an object or an array.",
"listDataSourceIsInvalid": "Invalid argument: dataSource must be an object.",
"listViewInvalidItem": "Item must provide index, key or description of corresponding item.",
"listViewViewportAriaLabel": "Scrolling Container",
"loadingBehaviorIsInvalid": "Invalid argument: loadingBehavior must be 'incremental' or 'randomAccess'.",
"menuCommandAriaLabel": "Menu Item",
"menuAriaLabel": "Menu",
"modeIsInvalid": "Invalid argument: mode must be one of following values: 'none', 'single' or 'multi'.",
"mustContainCommands": "Invalid HTML: AppBars/Menus must contain only AppBarCommands/MenuCommands",
"noAnchor": "Invalid argument: Showing flyout requires a DOM element as its parameter.",
"noitemsManagerForCount": "Invalid operation: can't get count if no dataSource has been set",
"notCompatibleWithSemanticZoom": "ListView can only be used with SemanticZoom if randomAccess loading behavior is specified.",
"off" : "Off",
"on" : "On",
"pagesToLoadIsInvalid": "Invalid argument: pagesToLoad must be a positive number.",
"pagesToLoadThresholdIsInvalid": "Invalid argument: pagesToLoadThreshold must be a positive number.",
"requiresCommands": "Invalid argument: commands must not be empty",
"selectAMPM": "Select A.M P.M",
"selectDay": "Select Day",
"selectHour": "Select Hour",
"selectMinute": "Select Minute",
"selectMonth": "Select Month",
"selectYear": "Select Year",
"settingsFlyoutAriaLabel": "Settings Flyout",
"tentativeRating": "Tentative Rating",
"tooltipStringsIsInvalid": "Invalid argument: tooltipStrings must be null or an array of strings.",
"unrated": "Unrated",
"userRating": "User Rating",
// AppBar Icons follow, the format of the ui.js and ui.resjson differ for
// the AppBarIcon namespace. The remainder of the file therefore differs.
// Code point comments are the icon glyphs in the 'Segoe UI Symbol' font.
"appBarIcons\\previous": "\uE100", //  group:Media
"appBarIcons\\next": "\uE101", //  group:Media
"appBarIcons\\play": "\uE102", //  group:Media
"appBarIcons\\pause": "\uE103", //  group:Media
"appBarIcons\\edit": "\uE104", //  group:File
"appBarIcons\\save": "\uE105", //  group:File
"appBarIcons\\clear": "\uE106", //  group:File
"appBarIcons\\delete": "\uE107", //  group:File
"appBarIcons\\remove": "\uE108", //  group:File
"appBarIcons\\add": "\uE109", //  group:File
"appBarIcons\\cancel": "\uE10A", //  group:Editing
"appBarIcons\\accept": "\uE10B", //  group:General
"appBarIcons\\more": "\uE10C", //  group:General
"appBarIcons\\redo": "\uE10D", //  group:Editing
"appBarIcons\\undo": "\uE10E", //  group:Editing
"appBarIcons\\home": "\uE10F", //  group:General
"appBarIcons\\up": "\uE110", //  group:General
"appBarIcons\\forward": "\uE111", //  group:General
"appBarIcons\\right": "\uE111", //  group:General
"appBarIcons\\back": "\uE112", //  group:General
"appBarIcons\\left": "\uE112", //  group:General
"appBarIcons\\favorite": "\uE113", //  group:Media
"appBarIcons\\camera": "\uE114", //  group:System
"appBarIcons\\settings": "\uE115", //  group:System
"appBarIcons\\video": "\uE116", //  group:Media
"appBarIcons\\sync": "\uE117", //  group:Media
"appBarIcons\\download": "\uE118", //  group:Media
"appBarIcons\\mail": "\uE119", //  group:Mail and calendar
"appBarIcons\\find": "\uE11A", //  group:Data
"appBarIcons\\help": "\uE11B", //  group:General
"appBarIcons\\upload": "\uE11C", //  group:Media
"appBarIcons\\emoji": "\uE11D", //  group:Communications
"appBarIcons\\twopage": "\uE11E", //  group:Layout
"appBarIcons\\leavechat": "\uE11F", //  group:Communications
"appBarIcons\\mailforward": "\uE120", //  group:Mail and calendar
"appBarIcons\\clock": "\uE121", //  group:General
"appBarIcons\\send": "\uE122", //  group:Mail and calendar
"appBarIcons\\crop": "\uE123", //  group:Editing
"appBarIcons\\rotatecamera": "\uE124", //  group:System
"appBarIcons\\people": "\uE125", //  group:Communications
"appBarIcons\\closepane": "\uE126", //  group:Layout
"appBarIcons\\openpane": "\uE127", //  group:Layout
"appBarIcons\\world": "\uE128", //  group:General
"appBarIcons\\flag": "\uE129", //  group:Mail and calendar
"appBarIcons\\previewlink": "\uE12A", //  group:General
"appBarIcons\\globe": "\uE12B", //  group:Communications
"appBarIcons\\trim": "\uE12C", //  group:Editing
"appBarIcons\\attachcamera": "\uE12D", //  group:System
"appBarIcons\\zoomin": "\uE12E", //  group:Layout
"appBarIcons\\bookmarks": "\uE12F", //  group:Editing
"appBarIcons\\document": "\uE130", //  group:File
"appBarIcons\\protecteddocument": "\uE131", //  group:File
"appBarIcons\\page": "\uE132", //  group:Layout
"appBarIcons\\bullets": "\uE133", //  group:Editing
"appBarIcons\\comment": "\uE134", //  group:Communications
"appBarIcons\\mail2": "\uE135", //  group:Mail and calendar
"appBarIcons\\contactinfo": "\uE136", //  group:Communications
"appBarIcons\\hangup": "\uE137", //  group:Communications
"appBarIcons\\viewall": "\uE138", //  group:Data
"appBarIcons\\mappin": "\uE139", //  group:General
"appBarIcons\\phone": "\uE13A", //  group:Communications
"appBarIcons\\videochat": "\uE13B", //  group:Communications
"appBarIcons\\switch": "\uE13C", //  group:Communications
"appBarIcons\\contact": "\uE13D", //  group:Communications
"appBarIcons\\rename": "\uE13E", //  group:File
"appBarIcons\\pin": "\uE141", //  group:System
"appBarIcons\\musicinfo": "\uE142", //  group:Media
"appBarIcons\\go": "\uE143", //  group:General
"appBarIcons\\keyboard": "\uE144", //  group:System
"appBarIcons\\dockleft": "\uE145", //  group:Layout
"appBarIcons\\dockright": "\uE146", //  group:Layout
"appBarIcons\\dockbottom": "\uE147", //  group:Layout
"appBarIcons\\remote": "\uE148", //  group:System
"appBarIcons\\refresh": "\uE149", //  group:Data
"appBarIcons\\rotate": "\uE14A", //  group:Layout
"appBarIcons\\shuffle": "\uE14B", //  group:Media
"appBarIcons\\list": "\uE14C", //  group:Editing
"appBarIcons\\shop": "\uE14D", //  group:General
"appBarIcons\\selectall": "\uE14E", //  group:Data
"appBarIcons\\orientation": "\uE14F", //  group:Layout
"appBarIcons\\import": "\uE150", //  group:Data
"appBarIcons\\importall": "\uE151", //  group:Data
"appBarIcons\\browsephotos": "\uE155", //  group:Media
"appBarIcons\\webcam": "\uE156", //  group:System
"appBarIcons\\pictures": "\uE158", //  group:Media
"appBarIcons\\savelocal": "\uE159", //  group:File
"appBarIcons\\caption": "\uE15A", //  group:Media
"appBarIcons\\stop": "\uE15B", //  group:Media
"appBarIcons\\showresults": "\uE15C", //  group:Data
"appBarIcons\\volume": "\uE15D", //  group:Media
"appBarIcons\\repair": "\uE15E", //  group:System
"appBarIcons\\message": "\uE15F", //  group:Communications
"appBarIcons\\page2": "\uE160", //  group:Layout
"appBarIcons\\calendarday": "\uE161", //  group:Mail and calendar
"appBarIcons\\calendarweek": "\uE162", //  group:Mail and calendar
"appBarIcons\\calendar": "\uE163", //  group:Mail and calendar
"appBarIcons\\characters": "\uE164", //  group:Editing
"appBarIcons\\mailreplyall": "\uE165", //  group:Mail and calendar
"appBarIcons\\read": "\uE166", //  group:Mail and calendar
"appBarIcons\\link": "\uE167", //  group:Communications
"appBarIcons\\accounts": "\uE168", //  group:Communications
"appBarIcons\\showbcc": "\uE169", //  group:Mail and calendar
"appBarIcons\\hidebcc": "\uE16A", //  group:Mail and calendar
"appBarIcons\\cut": "\uE16B", //  group:Editing
"appBarIcons\\attach": "\uE16C", //  group:Mail and calendar
"appBarIcons\\paste": "\uE16D", //  group:Editing
"appBarIcons\\filter": "\uE16E", //  group:Data
"appBarIcons\\copy": "\uE16F", //  group:Editing
"appBarIcons\\emoji2": "\uE170", //  group:Mail and calendar
"appBarIcons\\important": "\uE171", //  group:Mail and calendar
"appBarIcons\\mailreply": "\uE172", //  group:Mail and calendar
"appBarIcons\\slideshow": "\uE173", //  group:Media
"appBarIcons\\sort": "\uE174", //  group:Data
"appBarIcons\\manage": "\uE178", //  group:System
"appBarIcons\\allapps": "\uE179", //  group:System
"appBarIcons\\disconnectdrive": "\uE17A", //  group:System
"appBarIcons\\mapdrive": "\uE17B", //  group:System
"appBarIcons\\newwindow": "\uE17C", //  group:System
"appBarIcons\\openwith": "\uE17D", //  group:System
"appBarIcons\\contactpresence": "\uE181", //  group:Communications
"appBarIcons\\priority": "\uE182", //  group:Mail and calendar
"appBarIcons\\uploadskydrive": "\uE183", //  group:File
"appBarIcons\\gototoday": "\uE184", //  group:Mail and calendar
"appBarIcons\\font": "\uE185", //  group:Editing
"appBarIcons\\fontcolor": "\uE186", //  group:Editing
"appBarIcons\\contact2": "\uE187", //  group:Communications
"appBarIcons\\folder": "\uE188", //  group:File
"appBarIcons\\audio": "\uE189", //  group:Media
"appBarIcons\\placeholder": "\uE18A", //  group:General
"appBarIcons\\view": "\uE18B", //  group:Layout
"appBarIcons\\setlockscreen": "\uE18C", //  group:System
"appBarIcons\\settile": "\uE18D", //  group:System
"appBarIcons\\cc": "\uE190", //  group:Media
"appBarIcons\\stopslideshow": "\uE191", //  group:Media
"appBarIcons\\permissions": "\uE192", //  group:System
"appBarIcons\\highlight": "\uE193", //  group:Editing
"appBarIcons\\disableupdates": "\uE194", //  group:System
"appBarIcons\\unfavorite": "\uE195", //  group:Media
"appBarIcons\\unpin": "\uE196", //  group:System
"appBarIcons\\openlocal": "\uE197", //  group:File
"appBarIcons\\mute": "\uE198", //  group:Media
"appBarIcons\\italic": "\uE199", //  group:Editing
"appBarIcons\\underline": "\uE19A", //  group:Editing
"appBarIcons\\bold": "\uE19B", //  group:Editing
"appBarIcons\\movetofolder": "\uE19C", //  group:File
"appBarIcons\\likedislike": "\uE19D", //  group:Data
"appBarIcons\\dislike": "\uE19E", //  group:Data
"appBarIcons\\like": "\uE19F", //  group:Data
"appBarIcons\\alignright": "\uE1A0", //  group:Editing
"appBarIcons\\aligncenter": "\uE1A1", //  group:Editing
"appBarIcons\\alignleft": "\uE1A2", //  group:Editing
"appBarIcons\\zoom": "\uE1A3", //  group:Layout
"appBarIcons\\zoomout": "\uE1A4", //  group:Layout
"appBarIcons\\openfile": "\uE1A5", //  group:File
"appBarIcons\\otheruser": "\uE1A6", //  group:System
"appBarIcons\\admin": "\uE1A7", //  group:System
"appBarIcons\\street": "\uE1C3", //  group:General
"appBarIcons\\map": "\uE1C4", //  group:General
"appBarIcons\\clearselection": "\uE1C5", //  group:Data
"appBarIcons\\fontdecrease": "\uE1C6", //  group:Editing
"appBarIcons\\fontincrease": "\uE1C7", //  group:Editing
"appBarIcons\\fontsize": "\uE1C8", //  group:Editing
"appBarIcons\\cellphone": "\uE1C9", //  group:Communications
"appBarIcons\\reshare": "\uE1CA", //  group:Communications
"appBarIcons\\tag": "\uE1CB", //  group:Data
"appBarIcons\\repeatone": "\uE1CC", //  group:Media
"appBarIcons\\repeatall": "\uE1CD", //  group:Media
"appBarIcons\\outlinestar": "\uE1CE", //  group:Data
"appBarIcons\\solidstar": "\uE1CF", //  group:Data
"appBarIcons\\calculator": "\uE1D0", //  group:General
"appBarIcons\\directions": "\uE1D1", //  group:General
"appBarIcons\\target": "\uE1D2", //  group:General
"appBarIcons\\library": "\uE1D3", //  group:Media
"appBarIcons\\phonebook": "\uE1D4", //  group:Communications
"appBarIcons\\memo": "\uE1D5", //  group:Communications
"appBarIcons\\microphone": "\uE1D6", //  group:System
"appBarIcons\\postupdate": "\uE1D7", //  group:Communications
"appBarIcons\\backtowindow": "\uE1D8", //  group:Layout
"appBarIcons\\fullscreen": "\uE1D9", //  group:Layout
"appBarIcons\\newfolder": "\uE1DA", //  group:File
"appBarIcons\\calendarreply": "\uE1DB", //  group:Mail and calendar
"appBarIcons\\unsyncfolder": "\uE1DD", //  group:File
"appBarIcons\\reporthacked": "\uE1DE", //  group:Communications
"appBarIcons\\syncfolder": "\uE1DF", //  group:File
"appBarIcons\\blockcontact": "\uE1E0", //  group:Communications
"appBarIcons\\switchapps": "\uE1E1", //  group:System
"appBarIcons\\addfriend": "\uE1E2", //  group:Communications
"appBarIcons\\touchpointer": "\uE1E3", //  group:System
"appBarIcons\\gotostart": "\uE1E4", //  group:System
"appBarIcons\\zerobars": "\uE1E5", //  group:System
"appBarIcons\\onebar": "\uE1E6", //  group:System
"appBarIcons\\twobars": "\uE1E7", //  group:System
"appBarIcons\\threebars": "\uE1E8", //  group:System
"appBarIcons\\fourbars": "\uE1E9" //  group:System
}
);
}(this));

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
* {
transition: all 0.5s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.page {
background-color: #1d1d1d;
}
.page.splash {
background-color: #001629;
}
.page.splash .content,
.page.splash .content * {
transition: none;
}
.page .content.loading,
.page .content.main,
.page .progress,
.page .reason p,
.page .controls .checkbox {
color: white;
}
.page .content.main .pkgapplabel {
color: #299fff;
}
.page .reason textarea {
background-color: rgba (255, 255, 255, 0);
color: white;
border: 2px solid white;
box-sizing: border-box;
}

View File

@@ -0,0 +1,19 @@
.page {
background-color: #F3F3F3;
}
.page.splash {
background-color: #0078d7;
}
.page .content.loading,
.page .content.main,
.page .progress,
.page .reason p,
.page .controls .checkbox {
color: black;
}
.page .content.main .pkgapplabel {
color: #0078d7;
}