Coding for Package Manager.

This commit is contained in:
Bruce
2026-01-20 22:34:22 +08:00
parent 7483ed6930
commit 75cb72964d
71 changed files with 5518 additions and 13351 deletions

View File

@@ -60,6 +60,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bridge", "Bridge\Bridge.csp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WAShell", "WAShell\WAShell.csproj", "{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Manager", "Manager\Manager.csproj", "{DC074727-72E4-43C5-BAAF-E0D548104797}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IEHelper", "IEHelper\IEHelper.vcxproj", "{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModernNotice", "ModernNotice\ModernNotice.csproj", "{C5587B6E-19C4-4484-AA97-5C20FBB07E43}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -250,6 +256,40 @@ Global
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|x64.Build.0 = Release|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|x86.ActiveCfg = Release|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|x86.Build.0 = Release|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|x64.ActiveCfg = Debug|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|x64.Build.0 = Debug|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|x86.ActiveCfg = Debug|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|x86.Build.0 = Debug|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|Any CPU.Build.0 = Release|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|x64.ActiveCfg = Release|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|x64.Build.0 = Release|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|x86.ActiveCfg = Release|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|x86.Build.0 = Release|Any CPU
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Debug|Any CPU.ActiveCfg = Debug|Win32
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Debug|x64.ActiveCfg = Debug|x64
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Debug|x64.Build.0 = Debug|x64
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Debug|x86.ActiveCfg = Debug|Win32
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Debug|x86.Build.0 = Debug|Win32
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Release|Any CPU.ActiveCfg = Release|Win32
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Release|x64.ActiveCfg = Release|x64
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Release|x64.Build.0 = Release|x64
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Release|x86.ActiveCfg = Release|Win32
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Release|x86.Build.0 = Release|Win32
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|x64.ActiveCfg = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|x64.Build.0 = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|x86.ActiveCfg = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|x86.Build.0 = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|Any CPU.Build.0 = Release|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|x64.ActiveCfg = Release|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|x64.Build.0 = Release|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|x86.ActiveCfg = Release|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -48,6 +48,10 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net40\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@@ -57,12 +61,24 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DataInterface.cs" />
<Compile Include="PackageManager.cs" />
<Compile Include="PackageReader.cs" />
<Compile Include="PkgMgrNative.cs" />
<Compile Include="PkgReadNative.cs" />
<Compile Include="PriFileNative.cs" />
<Compile Include="PriReader.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DataUtils\DataUtils.csproj">
<Project>{ffd3fd52-37a8-4f43-883c-de8d996cb0e0}</Project>
<Name>DataUtils</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -0,0 +1,232 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.ComponentModel;
namespace AppxPackage
{
[Serializable]
public sealed class Ref<T>
{
private T _value;
public Ref ()
{
_value = default (T);
}
public Ref (T value)
{
_value = value;
}
/// <summary>
/// 模拟 & 引用访问
/// </summary>
public T Value
{
get { return _value; }
set { _value = value; }
}
/// <summary>
/// 直接赋值(像 *ref = value
/// </summary>
public void Set (T value)
{
_value = value;
}
/// <summary>
/// 取值(像 value = *ref
/// </summary>
public T Get ()
{
return _value;
}
public override string ToString ()
{
return _value == null ? string.Empty : _value.ToString ();
}
public override int GetHashCode ()
{
return _value == null ? 0 : _value.GetHashCode ();
}
public override bool Equals (object obj)
{
if (ReferenceEquals (this, obj)) return true;
if (obj is Ref<T>) return Equals (_value, ((Ref<T>)obj)._value);
return Equals (_value, obj);
}
public static implicit operator T (Ref<T> r)
{
return r == null ? default (T) : r._value;
}
public static implicit operator Ref<T>(T value)
{
return new Ref<T> (value);
}
}
}
namespace AppxPackage.Info
{
public enum Architecture
{
x86 = 0,
ARM = 5,
x64 = 9,
Neutral = 11,
ARM64 = 12,
Unknown = ushort.MaxValue
};
public enum PackageType
{
Unknown = 0,
Appx = 1,
Bundle = 2
};
public enum PackageRole
{
Unknown = 0,
Application = 1,
Framework = 2,
Resource = 3
};
public interface IIdentity
{
string Name { get; }
string Publisher { get; }
string FamilyName { get; }
string FullName { get; }
string ResourceId { get; }
DataUtils.Version Version { get; }
List<Architecture> ProcessArchitecture { get; }
}
public interface IProperties
{
string DisplayName { get; }
string Description { get; }
string Publisher { get; }
string Logo { get; }
string LogoBase64 { get; }
bool Framework { get; }
bool ResourcePackage { get; }
}
public interface ICapabilities
{
List<string> Capabilities { get; }
List<string> DeviceCapabilities { get; }
}
public class DependencyInfo
{
public string Name { get; private set; } = "";
public string Publisher { get; private set; } = "";
public DataUtils.Version Version { get; private set; } = new DataUtils.Version ();
public DependencyInfo (string name, string publisher, DataUtils.Version ver)
{
Name = name;
Publisher = publisher;
Version = ver;
}
public DependencyInfo (string name, DataUtils.Version ver): this (name, "", ver) { }
public DependencyInfo () { }
}
public enum DXFeatureLevel
{
Unspecified = 0,
Level9 = 0x1,
Level10 = 0x2,
Level11 = 0x4,
Level12 = 0x8
}
public interface IResources
{
List <string> Languages { get; }
List <int> Languages_LCID { get; }
List <int> Scales { get; }
List <DXFeatureLevel> DXFeatures { get; }
}
public interface IPrerequisites
{
DataUtils.Version OSMinVersion { get; }
DataUtils.Version OSMaxVersionTested { get; }
string OSMinVersionDescription { get; }
string OSMaxVersionDescription { get; }
}
[Serializable]
[StructLayout (LayoutKind.Sequential)]
public struct HRESULT: IEquatable<HRESULT>
{
private readonly int _value;
public HRESULT (int value)
{
_value = value;
}
public int Value
{
get { return _value; }
}
public bool Succeeded
{
get { return _value >= 0; }
}
public bool Failed
{
get { return _value < 0; }
}
public void ThrowIfFailed ()
{
if (Failed)
Marshal.ThrowExceptionForHR (_value);
}
public Exception GetException ()
{
return Failed ? Marshal.GetExceptionForHR (_value) : null;
}
public override string ToString ()
{
return string.Format ("HRESULT 0x{0:X8}", _value);
}
public override int GetHashCode ()
{
return _value;
}
public override bool Equals (object obj)
{
if (obj is HRESULT) return Equals ((HRESULT)obj);
return false;
}
public bool Equals (HRESULT other)
{
return _value == other._value;
}
public static implicit operator int (HRESULT hr)
{
return hr._value;
}
public static implicit operator HRESULT (int value)
{
return new HRESULT (value);
}
public static bool operator == (HRESULT a, HRESULT b)
{
return a._value == b._value;
}
public static bool operator != (HRESULT a, HRESULT b)
{
return a._value != b._value;
}
public static bool operator >= (HRESULT a, int value)
{
return a._value >= value;
}
public static bool operator <= (HRESULT a, int value)
{
return a._value <= value;
}
public static bool operator > (HRESULT a, int value)
{
return a._value > value;
}
public static bool operator < (HRESULT a, int value)
{
return a._value < value;
}
}
}

View File

@@ -0,0 +1,603 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AppxPackage.Info;
using NativeWrappers;
using System.Runtime.InteropServices;
using DataUtils;
using System.Net;
using System.IO;
namespace AppxPackage
{
public enum DeploymentOptions
{
None = 0,
ForceAppShutdown = 0x00000001,
DevelopmentMode = 0x00000002,
InstallAllResources = 0x00000020
};
public enum PackageStatus
{
Normal = 0,
LicenseInvalid = 1,
Modified = 2,
Tampered = 3
};
public static class ImageUriToBase64
{
public static string ConvertToDataUri (string uriString)
{
if (string.IsNullOrEmpty (uriString)) throw new ArgumentNullException ("uriString");
Uri uri = new Uri (uriString, UriKind.Absolute);
byte [] data;
string mime;
if (uri.IsFile)
{
string path = uri.LocalPath;
data = File.ReadAllBytes (path);
mime = GetMimeFromExtension (Path.GetExtension (path));
}
else
{
using (WebClient wc = new WebClient ())
{
data = wc.DownloadData (uri);
mime = GetMimeFromExtension (Path.GetExtension (uri.AbsolutePath));
}
}
string base64 = Convert.ToBase64String (data);
return "data:" + mime + ";base64," + base64;
}
private static string GetMimeFromExtension (string ext)
{
if (string.IsNullOrEmpty (ext)) return "application/octet-stream";
switch (ext.ToLowerInvariant ())
{
case ".png": return "image/png";
case ".jpg":
case ".jpeg": return "image/jpeg";
case ".gif": return "image/gif";
case ".bmp": return "image/bmp";
case ".webp": return "image/webp";
case ".svg": return "image/svg+xml";
default: return "application/octet-stream";
}
}
}
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
public class PMIdentity: IIdentity
{
private string name = "";
private string publisher = "";
private DataUtils.Version version = new DataUtils.Version ();
private IEnumerable<Architecture> archs;
private string familyName = "";
private string fullName = "";
private string resourceId = "";
public PMIdentity (string _name, string _publisher, DataUtils.Version _ver, IEnumerable<Architecture> _archs, string _family, string _full, string _resid)
{
name = _name;
publisher = _publisher;
version = _ver;
archs = _archs ?? new List<Architecture> ();
familyName = _family;
fullName = _full;
resourceId = _resid;
}
public PMIdentity (PackageManageHelper.FIND_PACKAGE_ID pkgId) :
this (
Marshal.PtrToStringUni (pkgId.lpName),
Marshal.PtrToStringUni (pkgId.lpPublisher),
new DataUtils.Version (pkgId.qwVersion),
new Architecture [] { (Architecture)pkgId.wProcessArchitecture },
Marshal.PtrToStringUni (pkgId.lpFamilyName),
Marshal.PtrToStringUni (pkgId.lpFullName),
Marshal.PtrToStringUni (pkgId.lpResourceId)
)
{ }
public string FamilyName => familyName;
public string FullName => fullName;
public string Name => name;
public List<Architecture> ProcessArchitecture => archs.ToList ();
public string Publisher => publisher;
public string ResourceId => resourceId;
DataUtils.Version IIdentity.Version => version;
}
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
public class PMProperties: IProperties
{
private string desc = "";
private string displayName = "";
private bool framework = false;
private string logo = "";
private string publisher = "";
private bool isres = false;
public PMProperties (string _name, string _pub, string _desc, string _logo, bool _fw, bool _res)
{
desc = _desc;
displayName = _name;
framework = _fw;
logo = _logo;
publisher = _pub;
isres = _res;
}
public PMProperties (PackageManageHelper.FIND_PACKAGE_PROPERTIES prop) :
this (
Marshal.PtrToStringUni (prop.lpDisplayName),
Marshal.PtrToStringUni (prop.lpPublisher),
Marshal.PtrToStringUni (prop.lpDescription),
Marshal.PtrToStringUni (prop.lpLogoUri),
prop.bIsFramework,
prop.bIsResourcePackage
)
{ }
public string Description => desc;
public string DisplayName => displayName;
public bool Framework => framework;
public string Logo => logo;
public string LogoBase64
{
get
{
try { return ImageUriToBase64.ConvertToDataUri (Logo); }
catch (Exception) { }
return "";
}
}
public string Publisher => publisher;
public bool ResourcePackage => isres;
}
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
public class PMPackageInfo
{
public PMIdentity Identity { get; private set; }
public PMProperties Properties { get; private set; }
public bool IsBundle { get; private set; }
public bool DevelopmentMode { get; private set; }
public string InstallLocation { get; private set; }
public List<string> Users { get; private set; }
public List<string> SIDs { get; private set; }
public PMPackageInfo (PackageManageHelper.FIND_PACKAGE_INFO info)
{
Identity = new PMIdentity (info.piIdentity);
Properties = new PMProperties (info.piProperties);
IsBundle = info.piProperties.bIsBundle;
DevelopmentMode = info.piProperties.bIsDevelopmentMode;
InstallLocation = Marshal.PtrToStringUni (info.lpInstallLocation);
Users = (Marshal.PtrToStringUni (info.lpUsers) ?? "").Split (';').ToList ();
SIDs = (Marshal.PtrToStringUni (info.lpSIDs) ?? "").Split (';').ToList ();
}
}
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
public static class PackageManager
{
private static DataUtils._I_HResult FromNative (int hr,IntPtr pErrorCode,IntPtr pDetailMsg)
{
string errCode = null;
string detail = null;
try
{
if (pErrorCode != IntPtr.Zero) errCode = Marshal.PtrToStringUni (pErrorCode);
if (pDetailMsg != IntPtr.Zero) detail = Marshal.PtrToStringUni (pDetailMsg);
}
finally
{
if (pErrorCode != IntPtr.Zero) PackageManageHelper.PackageManagerFreeString (pErrorCode);
if (pDetailMsg != IntPtr.Zero) PackageManageHelper.PackageManagerFreeString (pDetailMsg);
}
return new DataUtils._I_HResult (hr, errCode, detail);
}
public delegate void PackageProgressCallback (uint progress);
internal sealed class ProgressCallbackHolder
{
private readonly PackageProgressCallback _callback;
public ProgressCallbackHolder (PackageProgressCallback cb)
{
_callback = cb;
Native = new PackageManageHelper.PKGMRR_PROGRESSCALLBACK (OnNative);
}
public PackageManageHelper.PKGMRR_PROGRESSCALLBACK Native { get; private set; }
private void OnNative (uint progress, IntPtr custom)
{
if (_callback != null)
_callback (progress);
}
}
internal sealed class ResultCallbackHolder
{
public readonly List<PMPackageInfo> RetList = new List<PMPackageInfo> ();
public PackageManageHelper.PKGMGR_FINDENUMCALLBACK Callback;
public ResultCallbackHolder ()
{
Callback = OnResult;
}
private void OnResult (
IntPtr nativeInfo,
IntPtr pCustom)
{
RetList.Add (new PMPackageInfo (PackageManageHelper.PtrToFindPackageInfo (nativeInfo)));
}
}
public static DataUtils._I_HResult AddPackage (Uri fileUri, IEnumerable<Uri> depUris, DeploymentOptions options, PackageProgressCallback progress = null)
{
if (fileUri == null) throw new ArgumentNullException ("Required File URI");
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
var depList = depUris == null ? new List<string> () : depUris.Select (u => u.AbsoluteUri).ToList ();
ProgressCallbackHolder holder = null;
try
{
depArray = NativeUtil.AllocStringArray (depList);
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.AddAppxPackageFromURI (fileUri.AbsoluteUri, depArray, (uint)options, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
NativeUtil.FreeStringArray (depArray, depList.Count);
GC.KeepAlive (holder);
}
}
public static DataUtils._I_HResult AddPackage (string filePath, IEnumerable<string> depUris, DeploymentOptions options, PackageProgressCallback progress = null)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
var depList = depUris == null ? new List<string> () : depUris.ToList ();
ProgressCallbackHolder holder = null;
try
{
depArray = NativeUtil.AllocStringArray (depList);
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.AddAppxPackageFromPath (filePath, depArray, (uint)options, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
NativeUtil.FreeStringArray (depArray, depList.Count);
GC.KeepAlive (holder);
}
}
public static Tuple <DataUtils._I_HResult, List <PMPackageInfo>> GetPackages ()
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
ResultCallbackHolder callback = null;
try
{
callback = new ResultCallbackHolder ();
int hr = PackageManageHelper.GetAppxPackages (callback.Callback, IntPtr.Zero, out pErrCode, out pDetail);
return Tuple.Create (FromNative (hr, pErrCode, pDetail), callback.RetList);
}
finally
{
GC.KeepAlive (callback);
}
}
public static DataUtils._I_HResult RemovePackage (string packageFullName, PackageProgressCallback progress = null)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
ProgressCallbackHolder holder = null;
try
{
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.RemoveAppxPackage (packageFullName, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
GC.KeepAlive (holder);
}
}
public static DataUtils._I_HResult ClearupPackage (string packageName, string userSID, PackageProgressCallback progress = null)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
ProgressCallbackHolder holder = null;
try
{
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.CleanupAppxPackage (packageName, userSID, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
GC.KeepAlive (holder);
}
}
public static DataUtils._I_HResult RegisterPackage (Uri manifestUri, IEnumerable<Uri> depUris, DeploymentOptions options, PackageProgressCallback progress = null)
{
if (manifestUri == null) throw new ArgumentNullException ("Required File URI");
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
var depList = depUris == null ? new List<string> () : depUris.Select (u => u.AbsoluteUri).ToList ();
ProgressCallbackHolder holder = null;
try
{
depArray = NativeUtil.AllocStringArray (depList);
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.RegisterAppxPackageByUri (manifestUri.AbsoluteUri, depArray, (uint)options, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
NativeUtil.FreeStringArray (depArray, depList.Count);
GC.KeepAlive (holder);
}
}
public static DataUtils._I_HResult RegisterPackage (string manifestPath, IEnumerable<string> depUris, DeploymentOptions options, PackageProgressCallback progress = null)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
var depList = depUris == null ? new List<string> () : depUris.ToList ();
ProgressCallbackHolder holder = null;
try
{
depArray = NativeUtil.AllocStringArray (depList);
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.RegisterAppxPackageByUri (manifestPath, depArray, (uint)options, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
NativeUtil.FreeStringArray (depArray, depList.Count);
GC.KeepAlive (holder);
}
}
public static DataUtils._I_HResult RegisterPackageByFullName (string pkgFullName, IEnumerable<string> depFullNames, DeploymentOptions options, PackageProgressCallback progress = null)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
var depList = depFullNames == null ? new List<string> () : depFullNames.ToList ();
ProgressCallbackHolder holder = null;
try
{
depArray = NativeUtil.AllocStringArray (depList);
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.RegisterAppxPackageByFullName (pkgFullName, depArray, (uint)options, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
NativeUtil.FreeStringArray (depArray, depList.Count);
GC.KeepAlive (holder);
}
}
public static DataUtils._I_HResult SetPackageStatus (string packageFullName, PackageStatus status)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
try
{
int hr = PackageManageHelper.SetAppxPackageStatus (packageFullName, (uint)status, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally { }
}
public static DataUtils._I_HResult StagePackage (Uri fileUri, IEnumerable<Uri> depUris, DeploymentOptions options, PackageProgressCallback progress = null)
{
if (fileUri == null) throw new ArgumentNullException ("Required File URI");
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
var depList = depUris == null ? new List<string> () : depUris.Select (u => u.AbsoluteUri).ToList ();
ProgressCallbackHolder holder = null;
try
{
depArray = NativeUtil.AllocStringArray (depList);
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.StageAppxPackageFromURI (fileUri.AbsoluteUri, depArray, (uint)options, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
NativeUtil.FreeStringArray (depArray, depList.Count);
GC.KeepAlive (holder);
}
}
public static DataUtils._I_HResult StagePackage (string filePath, IEnumerable<string> depUris, DeploymentOptions options, PackageProgressCallback progress = null)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
var depList = depUris == null ? new List<string> () : depUris.ToList ();
ProgressCallbackHolder holder = null;
try
{
depArray = NativeUtil.AllocStringArray (depList);
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.StageAppxPackageFromPath (filePath, depArray, (uint)options, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
NativeUtil.FreeStringArray (depArray, depList.Count);
GC.KeepAlive (holder);
}
}
public static DataUtils._I_HResult StageUserData (string packageFullName, PackageProgressCallback progress = null)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
ProgressCallbackHolder holder = null;
try
{
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.StageAppxUserData (packageFullName, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
GC.KeepAlive (holder);
}
}
public static DataUtils._I_HResult UpdatePackage (Uri fileUri, IEnumerable<Uri> depUris, DeploymentOptions options, PackageProgressCallback progress = null)
{
if (fileUri == null) throw new ArgumentNullException ("Required File URI");
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
var depList = depUris == null ? new List<string> () : depUris.Select (u => u.AbsoluteUri).ToList ();
ProgressCallbackHolder holder = null;
try
{
depArray = NativeUtil.AllocStringArray (depList);
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.UpdateAppxPackageFromURI (fileUri.AbsoluteUri, depArray, (uint)options, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
NativeUtil.FreeStringArray (depArray, depList.Count);
GC.KeepAlive (holder);
}
}
public static DataUtils._I_HResult UpdatePackage (string filePath, IEnumerable<string> depUris, DeploymentOptions options, PackageProgressCallback progress = null)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
var depList = depUris == null ? new List<string> () : depUris.ToList ();
ProgressCallbackHolder holder = null;
try
{
depArray = NativeUtil.AllocStringArray (depList);
PackageManageHelper.PKGMRR_PROGRESSCALLBACK nativeCb = null;
if (progress != null)
{
holder = new ProgressCallbackHolder (progress);
nativeCb = holder.Native;
}
int hr = PackageManageHelper.UpdateAppxPackageFromPath (filePath, depArray, (uint)options, nativeCb, IntPtr.Zero, out pErrCode, out pDetail);
return FromNative (hr, pErrCode, pDetail);
}
finally
{
NativeUtil.FreeStringArray (depArray, depList.Count);
GC.KeepAlive (holder);
}
}
public static Tuple<DataUtils._I_HResult, List<PMPackageInfo>> FindPackage (string packageName, string packagePublisher)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
ResultCallbackHolder callback = null;
try
{
callback = new ResultCallbackHolder ();
int hr = PackageManageHelper.FindAppxPackagesByIdentity (packageName, packagePublisher, callback.Callback, IntPtr.Zero, out pErrCode, out pDetail);
return Tuple.Create (FromNative (hr, pErrCode, pDetail), callback.RetList);
}
finally
{
GC.KeepAlive (callback);
}
}
public static Tuple<DataUtils._I_HResult, List<PMPackageInfo>> FindPackage (string packageFamilyName)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
ResultCallbackHolder callback = null;
try
{
callback = new ResultCallbackHolder ();
int hr = PackageManageHelper.FindAppxPackagesByFamilyName (packageFamilyName, callback.Callback, IntPtr.Zero, out pErrCode, out pDetail);
return Tuple.Create (FromNative (hr, pErrCode, pDetail), callback.RetList);
}
finally
{
GC.KeepAlive (callback);
}
}
public static Tuple<DataUtils._I_HResult, List<PMPackageInfo>> FindPackageByFullName (string packageFullName)
{
IntPtr depArray = IntPtr.Zero;
IntPtr pErrCode = IntPtr.Zero;
IntPtr pDetail = IntPtr.Zero;
ResultCallbackHolder callback = null;
try
{
callback = new ResultCallbackHolder ();
int hr = PackageManageHelper.FindAppxPackage (packageFullName, callback.Callback, IntPtr.Zero, out pErrCode, out pDetail);
return Tuple.Create (FromNative (hr, pErrCode, pDetail), callback.RetList);
}
finally
{
GC.KeepAlive (callback);
}
}
}
}

1197
AppxPackage/PackageReader.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,8 @@ namespace NativeWrappers
using HRESULT = System.Int32;
using BOOL = System.Int32;
using UINT64 = System.UInt64;
using System.Collections.Generic;
using System.Linq;
public static class PackageManageHelper
{
@@ -186,4 +188,41 @@ namespace NativeWrappers
return result;
}
}
internal static class NativeUtil
{
public static string ToAbsoluteUriString (Uri uri)
{
if (uri == null) return null;
return uri.AbsoluteUri;
}
public static IntPtr AllocStringArray (IEnumerable<string> values)
{
if (values == null) return IntPtr.Zero;
var list = values.Where (s => !string.IsNullOrEmpty (s)).ToList ();
if (list.Count == 0) return IntPtr.Zero;
IntPtr mem = Marshal.AllocHGlobal (IntPtr.Size * list.Count);
for (int i = 0; i < list.Count; i++)
{
IntPtr pStr = Marshal.StringToHGlobalUni (list [i]);
Marshal.WriteIntPtr (mem, i * IntPtr.Size, pStr);
}
return mem;
}
public static void FreeStringArray (IntPtr array, int count)
{
if (array == IntPtr.Zero) return;
for (int i = 0; i < count; i++)
{
IntPtr p = Marshal.ReadIntPtr (array, i * IntPtr.Size);
if (p != IntPtr.Zero)
Marshal.FreeHGlobal (p);
}
Marshal.FreeHGlobal (array);
}
}
}

View File

@@ -218,6 +218,12 @@ namespace NativeWrappers
}
return s;
}
public static string GetStringFromPkgRead (IntPtr nativePtr)
{
if (nativePtr == IntPtr.Zero) return null;
string s = Marshal.PtrToStringUni (nativePtr);
return s;
}
public static string PtrToStringNoFree (IntPtr nativePtr)
{

View File

@@ -32,10 +32,10 @@ namespace AppxPackage
public static extern string PriFileGetLastError ();
[DllImport (DLL, CallingConvention = CallingConvention.Cdecl)]
public static extern void FindPriStringResource (PCSPRIFILE pFilePri, ref LPCWSTRLIST hUriList);
public static extern void FindPriStringResource (PCSPRIFILE pFilePri, IntPtr hUriList);
[DllImport (DLL, CallingConvention = CallingConvention.Cdecl)]
public static extern void FindPriPathResource (PCSPRIFILE pFilePri, ref LPCWSTRLIST hPathList);
public static extern void FindPriPathResource (PCSPRIFILE pFilePri, IntPtr hPathList);
[DllImport (DLL, CallingConvention = CallingConvention.Cdecl)]
public static extern void ClearPriCacheData ();
@@ -44,7 +44,7 @@ namespace AppxPackage
public static extern IntPtr GetPriResource (PCSPRIFILE pFilePri, [MarshalAs (UnmanagedType.LPWStr)] string lpswResId);
[DllImport (DLL, CallingConvention = CallingConvention.Cdecl)]
public static extern void FindPriResource (PCSPRIFILE pFilePri, ref LPCWSTRLIST hUriList);
public static extern void FindPriResource (PCSPRIFILE pFilePri, IntPtr hUriList);
[DllImport (DLL, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs (UnmanagedType.Bool)]
@@ -64,14 +64,42 @@ namespace AppxPackage
Marshal.FreeHGlobal (ptr); // 如果 DLL 返回的内存要求 free
return s;
}
[DllImport (DLL, CallingConvention = CallingConvention.Cdecl)]
public static extern void FreePriString (IntPtr p);
}
[StructLayout (LayoutKind.Sequential)]
public struct LPCWSTRLIST
public static class LpcwstrListHelper
{
public uint dwLength; // DWORD
[MarshalAs (UnmanagedType.ByValArray, SizeConst = 1)]
public IntPtr [] aswArray; // LPCWSTR*,数组
}
public static IntPtr Create (IEnumerable<string> strings)
{
if (strings == null) return IntPtr.Zero;
var list = new List<string> (strings);
int count = list.Count;
int size = sizeof (uint) + IntPtr.Size * count;
IntPtr pMem = Marshal.AllocHGlobal (size);
Marshal.WriteInt32 (pMem, count);
IntPtr pArray = pMem + sizeof (uint);
for (int i = 0; i < count; i++)
{
IntPtr pStr = Marshal.StringToHGlobalUni (list [i]);
Marshal.WriteIntPtr (pArray, i * IntPtr.Size, pStr);
}
return pMem;
}
public static void Destroy (IntPtr pList)
{
if (pList == IntPtr.Zero)
return;
int count = Marshal.ReadInt32 (pList);
IntPtr pArray = pList + sizeof (uint);
for (int i = 0; i < count; i++)
{
IntPtr pStr = Marshal.ReadIntPtr (pArray, i * IntPtr.Size);
if (pStr != IntPtr.Zero)
Marshal.FreeHGlobal (pStr);
}
Marshal.FreeHGlobal (pList);
}
}
}

View File

@@ -2,11 +2,250 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices.ComTypes;
using System.Runtime.InteropServices;
namespace AppxPackage
{
class PriReader
public class PriReader: IDisposable
{
private IntPtr m_hPriFile = IntPtr.Zero;
public bool Valid { get { return m_hPriFile != IntPtr.Zero; } }
public void Dispose ()
{
if (Valid)
{
PriFileHelper.DestroyPriFileInstance (m_hPriFile);
m_hPriFile = IntPtr.Zero;
}
}
~PriReader () { Dispose (); }
public bool Create (IStream isfile)
{
try
{
Dispose ();
if (isfile == null) return false;
var pStream = Marshal.GetComInterfaceForObject (isfile, typeof (IStream));
m_hPriFile = PriFileHelper.CreatePriFileInstanceFromStream (pStream);
}
catch (Exception) { m_hPriFile = IntPtr.Zero; }
return Valid;
}
public bool Create (IntPtr pStream)
{
try
{
Dispose ();
if (pStream == IntPtr.Zero) return false;
m_hPriFile = PriFileHelper.CreatePriFileInstanceFromStream (pStream);
}
catch (Exception) { m_hPriFile = IntPtr.Zero; }
return Valid;
}
public bool Create ([MarshalAs (UnmanagedType.LPWStr)] string filePath)
{
try
{
Dispose ();
if (string.IsNullOrWhiteSpace (filePath)) return false;
m_hPriFile = PriFileHelper.CreatePriFileInstanceFromPath (filePath);
}
catch (Exception) { m_hPriFile = IntPtr.Zero; }
return Valid;
}
public PriReader (IStream isfile) { Create (isfile); }
public PriReader (IntPtr pStream) { Create (pStream); }
public PriReader ([MarshalAs (UnmanagedType.LPWStr)] string fileName) { Create (fileName); }
public PriReader () { }
public void AddSearch (IEnumerable <string> arr)
{
IntPtr buf = IntPtr.Zero;
try
{
if (arr == null) return;
buf = LpcwstrListHelper.Create (arr);
PriFileHelper.FindPriResource (m_hPriFile, buf);
}
finally
{
if (buf != IntPtr.Zero) LpcwstrListHelper.Destroy (buf);
}
}
public void AddSearch (string uri) { AddSearch (new string [] { uri }); }
public string Resource (string resName)
{
IntPtr ret = IntPtr.Zero;
try
{
ret = PriFileHelper.GetPriResource (m_hPriFile, resName);
if (ret == IntPtr.Zero) return string.Empty;
return PriFileHelper.PtrToString (ret);
}
finally
{
if (ret != IntPtr.Zero) PriFileHelper.FreePriString (ret);
}
}
public Dictionary<string, string> Resources (IEnumerable<string> resnames)
{
if (resnames == null) throw new ArgumentNullException (nameof (resnames));
var result = new Dictionary<string, string> ();
AddSearch (resnames);
foreach (var name in resnames) result [name] = Resource (name);
return result;
}
public static string LastError { get { return PriFileHelper.PriFileGetLastError (); } }
public string Path (string resName) { return Resource (resName); }
public Dictionary <string, string> Paths (IEnumerable <string> resNames) { return Resources (resNames); }
public string String (string resName) { return Resource (resName); }
public Dictionary <string, string> Strings (IEnumerable <string> resNames) { return Resources (resNames); }
}
public class PriReaderBundle: IDisposable
{
private class PriInst
{
public byte Type; // 0b01 lang, 0b10 scale, 0b11 both
public PriReader Reader;
public PriInst (byte type, IStream stream)
{
Type = (byte)(type & 0x03);
Reader = new PriReader (stream);
}
public PriInst (byte type, IntPtr stream)
{
Type = (byte)(type & 0x03);
Reader = new PriReader (stream);
}
public bool IsValid
{
get { return (Type & 0x03) != 0; }
}
}
private readonly List<PriInst> _priFiles = new List<PriInst> (3);
private readonly Dictionary<byte, PriInst> _mapPri = new Dictionary<byte, PriInst> ();
// type: 1 language, 2 scale, 3 both
public bool Set (byte type, IStream priStream)
{
byte realType = (byte)(type & 0x03);
if (realType == 0) return false;
PriInst inst;
if (_mapPri.TryGetValue (realType, out inst))
{
inst.Reader.Dispose ();
if (priStream != null) inst.Reader.Create (priStream);
}
else
{
if (priStream == null) return false;
inst = new PriInst (realType, priStream);
_priFiles.Add (inst);
_mapPri [realType] = inst;
}
return true;
}
public bool Set (byte type, IntPtr priStream)
{
byte realType = (byte)(type & 0x03);
if (realType == 0) return false;
PriInst inst;
if (_mapPri.TryGetValue (realType, out inst))
{
inst.Reader.Dispose ();
if (priStream != IntPtr.Zero) inst.Reader.Create (priStream);
}
else
{
if (priStream == IntPtr.Zero) return false;
inst = new PriInst (realType, priStream);
_priFiles.Add (inst);
_mapPri [realType] = inst;
}
return true;
}
private PriReader Get (byte type, bool mustReturn)
{
type = (byte)(type & 0x03);
PriInst inst;
if (_mapPri.TryGetValue (type, out inst)) return inst.Reader;
if (type != 0x03 && _mapPri.TryGetValue (0x03, out inst)) return inst.Reader;
if (_priFiles.Count > 0 && mustReturn) return _priFiles [0].Reader;
return null;
}
private static bool IsMsResourcePrefix (string s)
{
return PriFileHelper.IsMsResourcePrefix (s);
}
public void AddSearch (IEnumerable<string> arr)
{
if (arr == null) return;
List<string> strRes = new List<string> ();
List<string> pathRes = new List<string> ();
foreach (string it in arr)
{
if (IsMsResourcePrefix (it)) strRes.Add (it);
else pathRes.Add (it);
}
PriReader langPri = Get (1, true);
PriReader scalePri = Get (2, true);
if (langPri != null && strRes.Count > 0) langPri.AddSearch (strRes);
if (scalePri != null && pathRes.Count > 0) scalePri.AddSearch (pathRes);
}
public void AddSearch (string resName)
{
if (IsMsResourcePrefix (resName))
{
PriReader langPri = Get (1, true);
if (langPri != null) langPri.AddSearch (resName);
}
else
{
PriReader scalePri = Get (2, true);
if (scalePri != null) scalePri.AddSearch (resName);
}
}
public string Resource (string resName)
{
if (IsMsResourcePrefix (resName))
{
PriReader langPri = Get (1, true);
return langPri != null ? langPri.Resource (resName) : string.Empty;
}
else
{
PriReader scalePri = Get (2, true);
return scalePri != null ? scalePri.Resource (resName) : string.Empty;
}
}
public Dictionary<string, string> Resources (IEnumerable<string> resNames)
{
if (resNames == null) throw new ArgumentNullException ("resNames");
Dictionary<string, string> result = new Dictionary<string, string> ();
AddSearch (resNames);
foreach (string name in resNames) result [name] = Resource (name);
return result;
}
public string Path (string resName)
{
return Resource (resName);
}
public Dictionary<string, string> Paths (IEnumerable<string> resNames)
{
return Resources (resNames);
}
public string String (string resName)
{
return Resource (resName);
}
public Dictionary<string, string> Strings (IEnumerable<string> resNames)
{
return Resources (resNames);
}
public void Dispose ()
{
foreach (PriInst it in _priFiles) it.Reader.Dispose ();
_mapPri.Clear ();
_priFiles.Clear ();
}
}
}

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net40" />
</packages>

View File

@@ -60,6 +60,10 @@
<Project>{ffd3fd52-37a8-4f43-883c-de8d996cb0e0}</Project>
<Name>DataUtils</Name>
</ProjectReference>
<ProjectReference Include="..\ModernNotice\ModernNotice.csproj">
<Project>{c5587b6e-19c4-4484-aa97-5c20fbb07e43}</Project>
<Name>ModernNotice</Name>
</ProjectReference>
<ProjectReference Include="..\PrivateInit\PrivateInit.csproj">
<Project>{8e708d9a-6325-4aa9-b5a5-d1b5eca8eef7}</Project>
<Name>PrivateInit</Name>

View File

@@ -10,6 +10,8 @@ using System.Reflection;
using System.Windows.Forms;
using System.Drawing;
using Newtonsoft.Json;
using AppxPackage;
using ModernNotice;
namespace Bridge
{
@@ -73,9 +75,9 @@ namespace Bridge
[ClassInterface (ClassInterfaceType.AutoDual)]
public class _I_InitConfig
{
InitConfig Create (string filepath) => new InitConfig (filepath);
InitConfig GetConfig () => InitFileStore.Config;
InitConfig Current => InitFileStore.Config;
public InitConfig Create (string filepath) => new InitConfig (filepath);
public InitConfig GetConfig () => InitFileStore.Config;
public InitConfig Current => InitFileStore.Config;
}
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
@@ -147,6 +149,369 @@ namespace Bridge
}
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
public class _I_PackageManager
{
public enum JsAsyncResultKind
{
Success,
Failed,
None // 什么都不回调(极少数情况)
}
public sealed class JsAsyncResult
{
public JsAsyncResultKind Kind { get; private set; }
public object Value { get; private set; }
private JsAsyncResult (JsAsyncResultKind kind, object value)
{
Kind = kind;
Value = value;
}
public static JsAsyncResult Success (object value = null)
{
return new JsAsyncResult (JsAsyncResultKind.Success, value);
}
public static JsAsyncResult Failed (object value = null)
{
return new JsAsyncResult (JsAsyncResultKind.Failed, value);
}
public static JsAsyncResult None ()
{
return new JsAsyncResult (JsAsyncResultKind.None, null);
}
}
internal static class JsAsyncRunner
{
public static void Run (
Func<Action<object>, JsAsyncResult> work,
object jsSuccess,
object jsFailed,
object jsProgress)
{
var success = jsSuccess;
var failed = jsFailed;
var progress = jsProgress;
System.Threading.ThreadPool.QueueUserWorkItem (_ =>
{
try
{
Action<object> reportProgress = p =>
{
if (progress != null)
CallJS (progress, p);
};
JsAsyncResult result = work (reportProgress);
if (result == null) return;
switch (result.Kind)
{
case JsAsyncResultKind.Success:
CallJS (success, result.Value);
break;
case JsAsyncResultKind.Failed:
CallJS (failed, result.Value);
break;
case JsAsyncResultKind.None:
default:
break;
}
}
catch (Exception ex)
{
// 框架级异常兜底 → failed
CallJS (jsFailed, ex.Message);
}
});
}
private static void CallJS (object jsFunc, params object [] args)
{
if (jsFunc == null) return;
try
{
object [] invokeArgs = new object [(args?.Length ?? 0) + 1];
invokeArgs [0] = 1;
if (args != null)
for (int i = 0; i < args.Length; i++)
invokeArgs [i + 1] = args [i];
jsFunc.GetType ().InvokeMember (
"call",
System.Reflection.BindingFlags.InvokeMethod,
null,
jsFunc,
invokeArgs
);
}
catch
{
}
}
}
private string BuildJsonText (object obj)
{
return Newtonsoft.Json.JsonConvert.SerializeObject (
obj,
Newtonsoft.Json.Formatting.Indented
);
}
public void AddPackage (string path, int options, object success, object failed, object progress)
{
JsAsyncRunner.Run (
report => {
var hr = PackageManager.AddPackage (
path,
null,
(DeploymentOptions)options,
e => report (e)
);
if (hr == null) return JsAsyncResult.Failed ("Unknown error");
return hr.Succeeded ? JsAsyncResult.Success (hr) : JsAsyncResult.Failed (hr);
},
success,
failed,
progress
);
}
public void GetPackages (object success, object failed)
{
JsAsyncRunner.Run (
report => {
var res = PackageManager.GetPackages ();
var hr = res.Item1;
var jsstr = "";
{
var ret = new
{
result = res.Item1,
list = res.Item2
};
jsstr = BuildJsonText (ret);
}
if (hr == null) return JsAsyncResult.Failed (jsstr);
return hr.Succeeded ? JsAsyncResult.Success (jsstr) : JsAsyncResult.Failed (jsstr);
},
success,
failed,
null
);
}
public void RemovePackage (string packageFullName, object success, object failed, object progress)
{
JsAsyncRunner.Run (
report => {
var hr = PackageManager.RemovePackage (
packageFullName,
e => report (e)
);
if (hr == null) return JsAsyncResult.Failed ("Unknown error");
return hr.Succeeded ? JsAsyncResult.Success (hr) : JsAsyncResult.Failed (hr);
},
success,
failed,
progress
);
}
public void ClearupPackage (string packageName, string userSID, object success, object failed, object progress)
{
JsAsyncRunner.Run (
report => {
var hr = PackageManager.ClearupPackage (
packageName,
userSID,
e => report (e)
);
if (hr == null) return JsAsyncResult.Failed ("Unknown error");
return hr.Succeeded ? JsAsyncResult.Success (hr) : JsAsyncResult.Failed (hr);
},
success,
failed,
progress
);
}
public void RegisterPackage (string path, int options, object success, object failed, object progress)
{
JsAsyncRunner.Run (
report => {
var hr = PackageManager.RegisterPackage (
path,
null,
(DeploymentOptions)options,
e => report (e)
);
if (hr == null) return JsAsyncResult.Failed ("Unknown error");
return hr.Succeeded ? JsAsyncResult.Success (hr) : JsAsyncResult.Failed (hr);
},
success,
failed,
progress
);
}
public void RegisterPackageByFullName (string packageFullName, int options, object success, object failed, object progress)
{
JsAsyncRunner.Run (
report => {
var hr = PackageManager.RegisterPackageByFullName (
packageFullName,
null,
(DeploymentOptions)options,
e => report (e)
);
if (hr == null) return JsAsyncResult.Failed ("Unknown error");
return hr.Succeeded ? JsAsyncResult.Success (hr) : JsAsyncResult.Failed (hr);
},
success,
failed,
progress
);
}
public _I_HResult SetPackageStatus (string packageFullName, int status)
{
return PackageManager.SetPackageStatus (packageFullName, (PackageStatus)status);
}
public void StagePackage (string path, int options, object success, object failed, object progress)
{
JsAsyncRunner.Run (
report => {
var hr = PackageManager.StagePackage (
path,
null,
(DeploymentOptions)options,
e => report (e)
);
if (hr == null) return JsAsyncResult.Failed ("Unknown error");
return hr.Succeeded ? JsAsyncResult.Success (hr) : JsAsyncResult.Failed (hr);
},
success,
failed,
progress
);
}
public void StageUserData (string packageFullName, object success, object failed, object progress)
{
JsAsyncRunner.Run (
report => {
var hr = PackageManager.StageUserData (
packageFullName,
e => report (e)
);
if (hr == null) return JsAsyncResult.Failed ("Unknown error");
return hr.Succeeded ? JsAsyncResult.Success (hr) : JsAsyncResult.Failed (hr);
},
success,
failed,
progress
);
}
public void UpdatePackage (string path, int options, object success, object failed, object progress)
{
JsAsyncRunner.Run (
report => {
var hr = PackageManager.UpdatePackage (
path,
null,
(DeploymentOptions)options,
e => report (e)
);
if (hr == null) return JsAsyncResult.Failed ("Unknown error");
return hr.Succeeded ? JsAsyncResult.Success (hr) : JsAsyncResult.Failed (hr);
},
success,
failed,
progress
);
}
public void FindPackageByIdentity (string packageName, string packagePublisher, object success, object failed)
{
JsAsyncRunner.Run (
report => {
var res = PackageManager.FindPackage (packageName, packagePublisher);
var hr = res.Item1;
var jsstr = "";
{
var ret = new
{
result = res.Item1,
list = res.Item2
};
jsstr = BuildJsonText (ret);
}
if (hr == null) return JsAsyncResult.Failed (jsstr);
return hr.Succeeded ? JsAsyncResult.Success (jsstr) : JsAsyncResult.Failed (jsstr);
},
success,
failed,
null
);
}
public void FindPackageByFamilyName (string packageFamilyName, object success, object failed)
{
JsAsyncRunner.Run (
report => {
var res = PackageManager.FindPackage (packageFamilyName);
var hr = res.Item1;
var jsstr = "";
{
var ret = new
{
result = res.Item1,
list = res.Item2
};
jsstr = BuildJsonText (ret);
}
if (hr == null) return JsAsyncResult.Failed (jsstr);
return hr.Succeeded ? JsAsyncResult.Success (jsstr) : JsAsyncResult.Failed (jsstr);
},
success,
failed,
null
);
}
public void FindPackageByFullName (string packageFullName, object success, object failed)
{
JsAsyncRunner.Run (
report => {
var res = PackageManager.FindPackageByFullName (packageFullName);
var hr = res.Item1;
var jsstr = "";
{
var ret = new
{
result = res.Item1,
list = res.Item2
};
jsstr = BuildJsonText (ret);
}
if (hr == null) return JsAsyncResult.Failed (jsstr);
return hr.Succeeded ? JsAsyncResult.Success (jsstr) : JsAsyncResult.Failed (jsstr);
},
success,
failed,
null
);
}
}
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
public class _I_Package
{
public AppxPackage.PackageReader Reader (string packagePath) { return new AppxPackage.PackageReader (packagePath); }
public _I_PackageManager Manager => new _I_PackageManager ();
}
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
public class _I_Notice
{
public string TemplateXml (string templateName) { return Notice.GetTemplateString (templateName); }
public string SimpleTemplateXml (string text, string imgPath = null) { return Notice.GetSimpleTemplateString (text, imgPath); }
public string SimpleTemplateXml2 (string title, string text = null, string imgPath = null) { return Notice.GetSimpleTemplateString2 (title, text, imgPath); }
public _I_HResult NoticeByXml (string appId, string xmlstr) { return Notice.Create (appId, xmlstr); }
public _I_HResult NoticeSimply (string appId, string text, string imgPath = null) { return Notice.Create (appId, text, imgPath); }
public _I_HResult NoticeSimply2 (string appId, string title, string text = null, string imgPath = null) { return Notice.Create (appId, title, text, imgPath); }
public _I_HResult NoticeSimplyByBase64 (string appId, string text, string imgBase64 = null) { return Notice.CreateWithImgBase64 (appId, text, imgBase64); }
public _I_HResult NoticeSimply2ByBase64 (string appId, string title, string text = null, string imgBase64 = null) { return Notice.CreateWithImgBase64 (appId, title, text, imgBase64); }
}
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
public class _I_BridgeBase
{
protected readonly _I_String str = new _I_String ();
@@ -163,6 +528,10 @@ namespace Bridge
public _I_IEFrame IEFrame => ieframe;
public _I_VisualElements VisualElements => new _I_VisualElements ();
public StringResXmlDoc StringResources => ResXmlStore.StringRes;
public _I_Package Package => new _I_Package ();
public _I_Taskbar Taskbar { get; private set; } = null;
public _I_System System => system;
public _I_Notice Notice => new _I_Notice ();
public string CmdArgs
{
get
@@ -172,11 +541,12 @@ namespace Bridge
);
}
}
public _I_BridgeBase (Form wnd, IScriptBridge isc, IWebBrowserPageScale iwbps)
public _I_BridgeBase (Form wnd, IScriptBridge isc, IWebBrowserPageScale iwbps, ITaskbarProgress itp)
{
window = new _I_Window (isc);
system = new _I_System (wnd);
ieframe = new _I_IEFrame (iwbps);
Taskbar = new _I_Taskbar (itp);
}
}

View File

@@ -67,6 +67,12 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\IEHelper\IEHelper.vcxproj">
<Project>{e4ca78a9-9408-4f5f-add6-730fd501ff8e}</Project>
<Name>IEHelper</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace DataUtils
@@ -51,30 +48,69 @@ namespace DataUtils
}
public sealed class TaskbarProgress: IDisposable
{
private readonly ITaskbarList3 _taskbar;
private readonly IntPtr _hwnd;
private ITaskbarList3 _taskbar3;
public TaskbarProgress (IntPtr hwnd)
{
_hwnd = hwnd;
_taskbar = (ITaskbarList3)new TaskbarList ();
_taskbar.HrInit ();
object obj = new TaskbarList ();
ITaskbarList baseTaskbar = (ITaskbarList)obj;
baseTaskbar.HrInit ();
_taskbar3 = obj as ITaskbarList3;
}
public bool IsSupported
{
get { return _taskbar3 != null; }
}
public void SetState (TBPFLAG state)
{
_taskbar.SetProgressState (_hwnd, state);
if (_taskbar3 != null)
_taskbar3.SetProgressState (_hwnd, state);
}
public void SetValue (ulong completed, ulong total)
{
_taskbar.SetProgressValue (_hwnd, completed, total);
if (_taskbar3 != null)
_taskbar3.SetProgressValue (_hwnd, completed, total);
}
public void Clear ()
{
_taskbar.SetProgressState (_hwnd, TBPFLAG.TBPF_NOPROGRESS);
if (_taskbar3 != null)
_taskbar3.SetProgressState (_hwnd, TBPFLAG.TBPF_NOPROGRESS);
}
public void Dispose ()
{
Clear ();
Marshal.ReleaseComObject (_taskbar);
if (_taskbar3 != null)
{
Marshal.ReleaseComObject (_taskbar3);
_taskbar3 = null;
}
}
~TaskbarProgress () { Dispose (); }
public ITaskbarList3 Instance => _taskbar3;
}
[ComImport]
[Guid ("56FDF342-FD6D-11d0-958A-006097C9A090")]
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
public interface ITaskbarList
{
void HrInit ();
void AddTab (IntPtr hwnd);
void DeleteTab (IntPtr hwnd);
void ActivateTab (IntPtr hwnd);
void SetActiveAlt (IntPtr hwnd);
}
public interface ITaskbarProgress
{
double ProgressValue { set; }
TBPFLAG ProgressStatus { set; }
}
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
public class _I_Taskbar
{
private ITaskbarProgress taskbar = null;
public double Progress { set { if (taskbar == null) return; taskbar.ProgressValue = value; } }
public int Status { set { if (taskbar == null) return; taskbar.ProgressStatus = (TBPFLAG)value; } }
public _I_Taskbar (ITaskbarProgress tp) { taskbar = tp; }
}
}

View File

@@ -181,5 +181,9 @@ namespace DataUtils
}
public static bool NNoEmpty (this string l) => !((l ?? "")?.NEmpty () ?? true);
public static string NNormalize (this string l) => (l ?? "")?.Trim ()?.ToLower () ?? "";
public interface IJsonBuild
{
object BuildJSON ();
}
}
}

View File

@@ -8,7 +8,7 @@ namespace DataUtils
/// bits 48..63 = major, 32..47 = minor, 16..31 = build, 0..15 = revision.
/// </summary>
[ComVisible (true)]
public class Version: IComparable<Version>, IEquatable<Version>
public class Version: IComparable<Version>, IEquatable<Version>, Utilities.IJsonBuild
{
// Backing fields
private ushort major;
@@ -70,12 +70,13 @@ namespace DataUtils
// cast to ulong before shifting
return (((ulong)major) << 48) | (((ulong)minor) << 32) | (((ulong)build) << 16) | ((ulong)revision);
}
public void FromUInt64 (ulong value)
public Version FromUInt64 (ulong value)
{
major = (ushort)((value >> 48) & 0xFFFFUL);
minor = (ushort)((value >> 32) & 0xFFFFUL);
build = (ushort)((value >> 16) & 0xFFFFUL);
revision = (ushort)(value & 0xFFFFUL);
return this;
}
public ulong Data { get { return ToUInt64 (); } set { FromUInt64 (value); } }
public override string ToString ()
@@ -242,6 +243,16 @@ namespace DataUtils
if (v == null) return 0UL;
return v.ToUInt64 ();
}
public object BuildJSON ()
{
return new
{
major = Major,
minor = Minor,
build = Build,
revision = Revision
};
}
}
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]

View File

@@ -22,12 +22,13 @@ namespace DataUtils
void ExecWB (
OLECMDID cmdID,
OLECMDEXECOPT cmdexecopt,
ref object pvaIn,
ref object pvaOut
[In, Optional] object pvaIn,
[Out, Optional] object pvaOut
);
}
public static class WebBrowserHelper
{
static Guid CGID_MSHTML = new Guid ("DE4BA900-59CA-11CF-9592-444553540000");
public static IWebBrowser2 GetWebBrowser2 (WebBrowser browser)
{
return browser.ActiveXInstance as IWebBrowser2;
@@ -37,4 +38,20 @@ namespace DataUtils
{
int PageScale { get; set; }
}
[ComImport]
[Guid ("B722BCCB-4E68-101B-A2BC-00AA00404770")]
[InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
public interface IOleCommandTarget
{
[PreserveSig]
int Exec (
ref Guid pguidCmdGroup,
uint nCmdID,
uint nCmdexecopt,
ref object pvaIn,
ref object pvaOut
);
}
}

Binary file not shown.

38
IEHelper/AssemblyInfo.cpp Normal file
View File

@@ -0,0 +1,38 @@
#include "stdafx.h"
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
//
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
//
[assembly:AssemblyTitleAttribute(L"IEHelper")];
[assembly:AssemblyDescriptionAttribute(L"")];
[assembly:AssemblyConfigurationAttribute(L"")];
[assembly:AssemblyCompanyAttribute(L"")];
[assembly:AssemblyProductAttribute(L"IEHelper")];
[assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2026")];
[assembly:AssemblyTrademarkAttribute(L"")];
[assembly:AssemblyCultureAttribute(L"")];
//
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 您可以指定所有值,也可以使用“修订号”和“生成号”的默认值,
// 方法是按如下所示使用“*”: :
[assembly:AssemblyVersionAttribute("1.0.*")];
[assembly:ComVisible(false)];
[assembly:CLSCompliantAttribute(true)];

43
IEHelper/IEHelper.cpp Normal file
View File

@@ -0,0 +1,43 @@
// ÕâÊÇÖ÷ DLL Îļþ¡£
#include "stdafx.h"
#include "IEHelper.h"
using namespace System::Runtime::InteropServices;
HRESULT GetWebBrowser2Interface (System::Windows::Forms::WebBrowser ^fwb, IWebBrowser2 **output)
{
if (fwb == nullptr || output == nullptr) return E_INVALIDARG;
*output = nullptr;
Object ^activeX = fwb->ActiveXInstance;
if (activeX == nullptr) return E_FAIL;
IntPtr pUnk = Marshal::GetIUnknownForObject (activeX);
if (pUnk == IntPtr::Zero) return E_FAIL;
HRESULT hr = ((IUnknown *)pUnk.ToPointer ())->QueryInterface (IID_IWebBrowser2, (void **)output);
Marshal::Release (pUnk);
return hr;
}
int IEHelper::WebBrowserHelper::GetPageScale (IEWebView ^webui)
{
CComPtr <IWebBrowser2> web2;
HRESULT hr = GetWebBrowser2Interface (webui, &web2);
if (FAILED (hr)) return 0;
VARIANT v;
VariantInit (&v);
hr = web2->ExecWB (OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DODEFAULT, nullptr, &v);
if (FAILED (hr) || v.vt != VT_I4) return 0;
int val = v.lVal;
VariantClear (&v);
return val;
}
void IEHelper::WebBrowserHelper::SetPageScale (IEWebView ^webui, int value)
{
CComPtr <IWebBrowser2> web2;
HRESULT hr = GetWebBrowser2Interface (webui, &web2);
if (FAILED (hr)) return;
VARIANT v;
VariantInit (&v);
v.vt = VT_I4;
v.lVal = value;
web2->ExecWB (OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, &v, nullptr);
}

14
IEHelper/IEHelper.h Normal file
View File

@@ -0,0 +1,14 @@
// IEHelper.h
#pragma once
using namespace System;
using IEWebView = System::Windows::Forms::WebBrowser;
namespace IEHelper {
public ref class WebBrowserHelper
{
public:
static int GetPageScale (IEWebView ^webui);
static void SetPageScale (IEWebView ^webui, int zoom);
};
}

162
IEHelper/IEHelper.vcxproj Normal file
View File

@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}</ProjectGuid>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<Keyword>ManagedCProj</Keyword>
<RootNamespace>IEHelper</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CLRSupport>true</CLRSupport>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<Link>
<AdditionalDependencies />
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="IEHelper.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Stdafx.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AssemblyInfo.cpp" />
<ClCompile Include="IEHelper.cpp" />
<ClCompile Include="Stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="app.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="app.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="IEHelper.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Stdafx.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="IEHelper.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="AssemblyInfo.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="Stdafx.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="app.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Image Include="app.ico">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
</Project>

38
IEHelper/ReadMe.txt Normal file
View File

@@ -0,0 +1,38 @@
========================================================================
DYNAMIC LINK LIBRARY : IEHelper Project Overview
========================================================================
AppWizard has created this IEHelper DLL for you.
This file contains a summary of what you will find in each of the files that
make up your IEHelper application.
IEHelper.vcxproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
IEHelper.vcxproj.filters
This is the filters file for VC++ projects generated using an Application Wizard.
It contains information about the association between the files in your project
and the filters. This association is used in the IDE to show grouping of files with
similar extensions under a specific node (for e.g. ".cpp" files are associated with the
"Source Files" filter).
IEHelper.cpp
This is the main DLL source file.
IEHelper.h
This file contains a class declaration.
AssemblyInfo.cpp
Contains custom attributes for modifying assembly metadata.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.
/////////////////////////////////////////////////////////////////////////////

5
IEHelper/Stdafx.cpp Normal file
View File

@@ -0,0 +1,5 @@
// stdafx.cpp : 只包括标准包含文件的源文件
// IEHelper.pch 将作为预编译头
// stdafx.obj 将包含预编译类型信息
#include "stdafx.h"

9
IEHelper/Stdafx.h Normal file
View File

@@ -0,0 +1,9 @@
// stdafx.h : 标准系统包含文件的包含文件,
// 或是经常使用但不常更改的
// 特定于项目的包含文件
#pragma once
#include <Windows.h>
#include <atlbase.h>
#include <ExDisp.h>

BIN
IEHelper/app.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
IEHelper/app.rc Normal file

Binary file not shown.

3
IEHelper/resource.h Normal file
View File

@@ -0,0 +1,3 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by app.rc

63
LICENSE.Newtonsoft.Json Normal file
View File

@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="/Content/Site.css" />
<title>&#39;MIT&#39; reference</title>
</head>
<body>
<div id="main-content">
<h1>MIT License</h1>
<h2>SPDX identifier</h2>
<div id="license-expression">MIT</div>
<h2>License text</h2>
<div class="optional-license-text">
<p>MIT License</p>
</div>
<div class="replaceable-license-text">
<p>Copyright (c) &lt;year&gt; &lt;copyright holders&gt;
</p>
</div>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of <var class="replaceable-license-text"> this software and
associated documentation files</var> (the &quot;Software&quot;), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:</p>
<p>The above copyright notice and this permission notice
<var class="optional-license-text"> (including the next paragraph)</var>
shall be included in all copies or substantial
portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL <var class="replaceable-license-text"> THE AUTHORS OR COPYRIGHT HOLDERS</var> BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<h2>SPDX web page</h2>
<ul>
<li><a href="https://spdx.org/licenses/MIT.html">https://spdx.org/licenses/MIT.html</a></li>
</ul>
<h2>Notice</h2>
<p>This license content is provided by the <a href="https://spdx.dev/">SPDX project</a>. For more information about <b>licenses.nuget.org</b>, see <a href="https://aka.ms/licenses.nuget.org">our documentation</a>.
<p><i>Data pulled from <a href="https://github.com/spdx/license-list-data">spdx/license-list-data</a> on November 6, 2024.</i></p>
</div>
</body>
</html>

115
Manager/Manager.csproj Normal file
View File

@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DC074727-72E4-43C5-BAAF-E0D548104797}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Manager</RootNamespace>
<AssemblyName>Manager</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ManagerShell.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ManagerShell.Designer.cs">
<DependentUpon>ManagerShell.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="ManagerShell.resx">
<DependentUpon>ManagerShell.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AppxPackage\AppxPackage.csproj">
<Project>{bd681a4f-eb60-4bb8-90b5-65968fc7da59}</Project>
<Name>AppxPackage</Name>
</ProjectReference>
<ProjectReference Include="..\Bridge\Bridge.csproj">
<Project>{3c2f5446-33f0-41d5-813a-64a94aa474af}</Project>
<Name>Bridge</Name>
</ProjectReference>
<ProjectReference Include="..\DataUtils\DataUtils.csproj">
<Project>{ffd3fd52-37a8-4f43-883c-de8d996cb0e0}</Project>
<Name>DataUtils</Name>
</ProjectReference>
<ProjectReference Include="..\PriFileFormat\PriFile.csproj">
<Project>{ef4012d4-ef08-499c-b803-177739350b2d}</Project>
<Name>PriFile</Name>
</ProjectReference>
<ProjectReference Include="..\PrivateInit\PrivateInit.csproj">
<Project>{8e708d9a-6325-4aa9-b5a5-d1b5eca8eef7}</Project>
<Name>PrivateInit</Name>
</ProjectReference>
<ProjectReference Include="..\WAShell\WAShell.csproj">
<Project>{4ec16578-efbf-41e6-8d7f-976e3646dd1d}</Project>
<Name>WAShell</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

50
Manager/ManagerShell.Designer.cs generated Normal file
View File

@@ -0,0 +1,50 @@
namespace Manager
{
partial class ManagerShell
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose (bool disposing)
{
if (disposing && (components != null))
{
components.Dispose ();
}
base.Dispose (disposing);
}
#region Windows
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent ()
{
this.SuspendLayout();
//
// ManagerShell
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(661, 416);
this.Location = new System.Drawing.Point(0, 0);
this.Name = "ManagerShell";
this.PageScale = 125;
this.Text = "Form1";
this.Load += new System.EventHandler(this.ManagerShell_Load);
this.ResumeLayout(false);
}
#endregion
}
}

25
Manager/ManagerShell.cs Normal file
View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Manager
{
public partial class ManagerShell: WAShell.WebAppForm
{
public ManagerShell ()
{
InitializeComponent ();
SplashScreen.SplashBackgroundColor = Color.Honeydew;
}
private void ManagerShell_Load (object sender, EventArgs e)
{
var root = Path.GetDirectoryName (DataUtils.Utilities.GetCurrentProgramPath ());
WebUI.Navigate (Path.Combine (root, "html\\manager.html"));
}
}
}

120
Manager/ManagerShell.resx Normal file
View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

22
Manager/Program.cs Normal file
View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace Manager
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main ()
{
DataUtils.BrowserEmulation.SetWebBrowserEmulation ();
Application.EnableVisualStyles ();
Application.SetCompatibleTextRenderingDefault (false);
Application.Run (new ManagerShell ());
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle ("Manager")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("")]
[assembly: AssemblyProduct ("Manager")]
[assembly: AssemblyCopyright ("Copyright © 2026")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible (false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid ("dc074727-72e4-43c5-baaf-e0d548104797")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion ("1.0.0.0")]
[assembly: AssemblyFileVersion ("1.0.0.0")]

71
Manager/Properties/Resources.Designer.cs generated Normal file
View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Manager.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute ("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute ()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute ()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute ("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources ()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute (global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager ("Manager.Properties.Resources", typeof (Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 覆盖当前线程的 CurrentUICulture 属性
/// 使用此强类型的资源类的资源查找。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute (global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

30
Manager/Properties/Settings.Designer.cs generated Normal file
View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Manager.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute ()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute ("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings: global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized (new Settings ())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

75
Manager/app.manifest Normal file
View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。n
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
元素。
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素Windows 将
自动选择最兼容的环境。 -->
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<!-- 指示该应用程序可以感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI无需
选择加入。选择加入此设置的 Windows 窗体应用程序(目标设定为 .NET Framework 4.6 )还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。-->
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C5587B6E-19C4-4484-AA97-5C20FBB07E43}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ModernNotice</RootNamespace>
<AssemblyName>ModernNotice</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Notice.cs" />
<Compile Include="NoticeNative.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DataUtils\DataUtils.csproj">
<Project>{ffd3fd52-37a8-4f43-883c-de8d996cb0e0}</Project>
<Name>DataUtils</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

120
ModernNotice/Notice.cs Normal file
View File

@@ -0,0 +1,120 @@
using System.Xml;
using System.Runtime.InteropServices;
using HResult = DataUtils._I_HResult;
using System;
namespace ModernNotice
{
public static class Notice
{
private static XmlDocument XmlStringToDom (string xmlContent)
{
var ret = new XmlDocument ();
ret.LoadXml (xmlContent);
return ret;
}
private static string XmlDomToString (XmlDocument xmlDom) { return xmlDom.OuterXml; }
private static HResult BuildHResult (int hr, IntPtr err, IntPtr msg) { return new HResult (hr, Marshal.PtrToStringUni (err), Marshal.PtrToStringUni (msg)); }
private static HResult BuildHResult (HRESULT hr, IntPtr err, IntPtr msg) { return BuildHResult (hr.Value, err, msg); }
private static HResult BuildHResult (int hr, IntPtr msg) { return new HResult (hr, "", Marshal.PtrToStringUni (msg)); }
private static HResult BuildHResult (HRESULT hr, IntPtr msg) { return BuildHResult (hr.Value, msg); }
private static HResult BuildHResult (int hr) { return new HResult (hr); }
private static HResult BuildHResult (HRESULT hr) { return BuildHResult (hr.Value); }
public static string GetTemplateString (string templateName)
{
var ptr = Native.GetToastNoticeXml (templateName);
try { var ret = Marshal.PtrToStringUni (ptr) ?? ""; return ret; }
finally { Native.NoticeApiFreeString (ptr); }
}
public static XmlDocument GetTemplate (string templateName) { return XmlStringToDom (GetTemplateString (templateName)); }
public static string GetSimpleTemplateString (string content, string imagePath)
{
var ptr = Native.GenerateSimpleToastNoticeXml (content, imagePath);
try { var ret = Marshal.PtrToStringUni (ptr) ?? ""; return ret; }
finally { Native.NoticeApiFreeString (ptr); }
}
public static XmlDocument GetSimpleTemplate (string content, string imagePath = null) { return XmlStringToDom (GetSimpleTemplateString (content, imagePath)); }
public static string GetSimpleTemplateString2 (string title, string content = null, string imagePath = null)
{
var ptr = Native.GenerateSimpleToastNoticeXml2 (title, content, imagePath);
try { var ret = Marshal.PtrToStringUni (ptr) ?? ""; return ret; }
finally { Native.NoticeApiFreeString (ptr); }
}
public static XmlDocument GetSimpleTemplate2 (string title, string content = null, string imagePath = null) { return XmlStringToDom (GetSimpleTemplateString2 (title, content, imagePath)); }
public static HResult Create (string appUserId, XmlDocument xml)
{
IntPtr dt = IntPtr.Zero;
try
{
var hr = Native.CreateToastNoticeFromXmlDocument (appUserId, XmlDomToString (xml), null, IntPtr.Zero, out dt);
return BuildHResult (hr, dt);
}
finally
{
if (dt != IntPtr.Zero) Native.NoticeApiFreeString (dt);
}
}
public static HResult Create (string appUserId, string content, string imagePath = null)
{
var xml = GetSimpleTemplate (content, imagePath);
return Create (appUserId, xml);
}
public static HResult Create (string appUserId, string title, string content, string imagePath = null)
{
var xml = GetSimpleTemplate2 (title, content, imagePath);
return Create (appUserId, xml);
}
public static HResult Create (string appUserId, string content, IntPtr img)
{
IntPtr dt = IntPtr.Zero;
try
{
var hr = Native.CreateToastNoticeWithIStream (appUserId, content, img, null, IntPtr.Zero, out dt);
return BuildHResult (hr, dt);
}
finally
{
if (dt != IntPtr.Zero) Native.NoticeApiFreeString (dt);
}
}
public static HResult Create (string appUserId, string title, string content, IntPtr img)
{
IntPtr dt = IntPtr.Zero;
try
{
var hr = Native.CreateToastNoticeWithIStream2 (appUserId, title, content, img, null, IntPtr.Zero, out dt);
return BuildHResult (hr, dt);
}
finally
{
if (dt != IntPtr.Zero) Native.NoticeApiFreeString (dt);
}
}
public static HResult CreateWithImgBase64 (string appUserId, string content, string imageBase64)
{
IntPtr dt = IntPtr.Zero;
try
{
var hr = Native.CreateToastNoticeWithImgBase64 (appUserId, content, imageBase64, null, IntPtr.Zero, out dt);
return BuildHResult (hr, dt);
}
finally
{
if (dt != IntPtr.Zero) Native.NoticeApiFreeString (dt);
}
}
public static HResult CreateWithImgBase64 (string appUserId, string title, string content, string imageBase64)
{
IntPtr dt = IntPtr.Zero;
try
{
var hr = Native.CreateToastNotice2WithImgBase64 (appUserId, title, content, imageBase64, null, IntPtr.Zero, out dt);
return BuildHResult (hr, dt);
}
finally
{
if (dt != IntPtr.Zero) Native.NoticeApiFreeString (dt);
}
}
}
}

View File

@@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace ModernNotice
{
// HRESULT = int
[StructLayout (LayoutKind.Sequential)]
public struct HRESULT
{
public int Value;
}
// Callback delegate
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
public delegate void NOTICE_ACTIVECALLBACK (IntPtr pCustom);
public static class Native
{
private const string DLL = "notice.dll"; // 改成你的 dll 名称
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetToastNoticeXml (string lpTemplateName);
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GenerateSimpleToastNoticeXml (string lpText, string lpImagePath);
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GenerateSimpleToastNoticeXml2 (string lpTitle, string lpText, string lpImagePath);
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int CreateToastNoticeFromXmlDocument (
string lpIdName,
string lpXmlString,
NOTICE_ACTIVECALLBACK pfCallback,
IntPtr pCustom,
out IntPtr lpExceptMsg
);
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int CreateToastNotice (
string lpIdName,
string lpText,
string lpImgPath,
NOTICE_ACTIVECALLBACK pfCallback,
IntPtr pCustom,
out IntPtr lpExceptMsg
);
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int CreateToastNotice2 (
string lpIdName,
string lpTitle,
string lpText,
string lpImgPath,
NOTICE_ACTIVECALLBACK pfCallback,
IntPtr pCustom,
out IntPtr lpExceptMsg
);
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int CreateToastNoticeWithIStream2 (
string lpIdName,
string lpTitle,
string lpText,
IntPtr pIImgStream,
NOTICE_ACTIVECALLBACK pfCallback,
IntPtr pCustom,
out IntPtr lpExceptMsg
);
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int CreateToastNoticeWithIStream (
string lpIdName,
string lpText,
IntPtr pIImgStream,
NOTICE_ACTIVECALLBACK pfCallback,
IntPtr pCustom,
out IntPtr lpExceptMsg
);
[DllImport (DLL, CallingConvention = CallingConvention.Cdecl)]
public static extern int NoticeGetLastHResult ();
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr NoticeGetLastDetailMessage ();
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int CreateShortcutWithAppIdW (
string pszShortcutPath,
string pszTargetPath,
string pszAppId,
out IntPtr lpException
);
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern void NoticeApiFreeString (IntPtr lpstr);
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int CreateToastNoticeWithImgBase64 (
string lpIdName,
string lpText,
string lpImgBase64,
NOTICE_ACTIVECALLBACK pfCallback,
IntPtr pCustom,
out IntPtr lpExceptMsg
);
[DllImport (DLL, CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
public static extern int CreateToastNotice2WithImgBase64 (
string lpIdName,
string lpTitle,
string lpText,
string lpImgBase64,
NOTICE_ACTIVECALLBACK pfCallback,
IntPtr pCustom,
out IntPtr lpExceptMsg
);
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ModernNotice")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ModernNotice")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//将 ComVisible 设置为 false 将使此程序集中的类型
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible (true)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("c5587b6e-19c4-4484-aa97-5c20fbb07e43")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading;
namespace Update
{
@@ -47,18 +47,36 @@ namespace Update
[STAThread]
static void Main (string [] args)
{
Process p = new Process ();
p.StartInfo.FileName = Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "settings.exe");
var arguments = new List<string>
bool createdNew = false;
Mutex mutex = new Mutex (true, "WindowsModern.PracticalToolsProject!Settings.Update", out createdNew);
if (!createdNew)
{
"appinstaller",
"update"
};
arguments.AddRange (args);
p.StartInfo.Arguments = string.Join (" ", arguments.Select (EscapeArgument));
p.Start ();
p.WaitForExit ();
int exitCode = p.ExitCode;
return;
}
try
{
Process p = new Process ();
p.StartInfo.FileName = Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "settings.exe");
List<string> arguments = new List<string> ();
arguments.Add ("appinstaller");
arguments.Add ("update");
arguments.AddRange (args);
StringBuilder argBuilder = new StringBuilder ();
foreach (string a in arguments)
{
if (argBuilder.Length > 0)
argBuilder.Append (" ");
argBuilder.Append (EscapeArgument (a));
}
p.StartInfo.Arguments = argBuilder.ToString ();
p.Start ();
p.WaitForExit ();
int exitCode = p.ExitCode;
}
finally
{
mutex.ReleaseMutex ();
}
}
}
}

View File

@@ -32,6 +32,7 @@ namespace WAShell
if (ReferenceEquals (_host, value)) return;
DetachHostEvents (_host);
_host = value;
this.Owner = _host as Form;
AttachHostEvents (_host);
if (this.Visible)
{
@@ -44,19 +45,27 @@ namespace WAShell
if (host == null) return;
host.Resize += Host_Changed;
host.LocationChanged += Host_Changed;
host.Disposed += Host_Disposed;
}
private void DetachHostEvents (Control host)
{
if (host == null) return;
host.Resize -= Host_Changed;
host.LocationChanged -= Host_Changed;
host.Disposed -= Host_Disposed;
}
private void Host_Changed (object sender, EventArgs e)
{
if (!this.IsHandleCreated) return;
if (this.IsDisposed || !this.IsHandleCreated) return;
if (this.Owner == null || this.Owner.IsDisposed) return;
ResizeSplashScreen ();
}
private void Host_Disposed (object sender, EventArgs e)
{
DetachHostEvents (_host);
_host = null;
if (!this.IsDisposed) this.Hide (); // 或 Hide()
}
public SplashForm ()
{
InitializeComponent ();
@@ -80,7 +89,7 @@ namespace WAShell
splashImage = value;
if (picbox != null && picbox.IsHandleCreated)
{
splashImage = picbox.Image;
picbox.Image = splashImage;
}
}
}
@@ -98,15 +107,14 @@ namespace WAShell
{
ResizeSplashScreen ();
}
private void ResizeSplashScreen ()
public void ResizeSplashScreen ()
{
Control owner = this.Owner;
if (owner == null) owner = this.Parent;
if (owner == null) return;
owner.Update ();
var pt = owner.PointToScreen (owner.ClientRectangle.Location);
Location = pt;
Size = owner.ClientSize;
if (this.IsDisposed || !this.IsHandleCreated) return;
Control owner = this.Owner ?? this.Parent;
if (owner == null || owner.IsDisposed || !owner.IsHandleCreated) return;
var pt = owner.PointToScreen (Point.Empty);
this.Location = pt;
this.Size = owner.ClientSize;
ResizeSplashImage ();
}
private void ResizeSplashImage ()
@@ -213,13 +221,13 @@ namespace WAShell
{
DetachHostEvents (_host);
_host = null;
base.OnFormClosed (e);
// base.OnFormClosed (e);
}
catch (Exception) { }
}
private void SplashForm_Shown (object sender, EventArgs e)
{
base.OnShown (e);
//base.OnShown (e);
this.Opacity = 1.0;
this.Visible = true;
this.Enabled = true;

View File

@@ -68,6 +68,10 @@
<Project>{ffd3fd52-37a8-4f43-883c-de8d996cb0e0}</Project>
<Name>DataUtils</Name>
</ProjectReference>
<ProjectReference Include="..\IEHelper\IEHelper.vcxproj">
<Project>{e4ca78a9-9408-4f5f-add6-730fd501ff8e}</Project>
<Name>IEHelper</Name>
</ProjectReference>
<ProjectReference Include="..\PrivateInit\PrivateInit.csproj">
<Project>{8e708d9a-6325-4aa9-b5a5-d1b5eca8eef7}</Project>
<Name>PrivateInit</Name>

View File

@@ -39,6 +39,7 @@
this.webui.Name = "webui";
this.webui.Size = new System.Drawing.Size(661, 416);
this.webui.TabIndex = 0;
this.webui.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.webui_DocumentCompleted);
//
// WebAppForm
//
@@ -49,6 +50,8 @@
this.Controls.Add(this.webui);
this.Name = "WebAppForm";
this.Text = "Main Web App Form";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.WebAppForm_FormClosing);
this.Load += new System.EventHandler(this.WebAppForm_Load);
this.ResumeLayout(false);
}

View File

@@ -12,56 +12,90 @@ namespace WAShell
{
[ComVisible (true)]
[ClassInterface (ClassInterfaceType.AutoDual)]
public partial class WebAppForm: Form, IScriptBridge, IWebBrowserPageScale
public partial class WebAppForm: Form, IScriptBridge, IWebBrowserPageScale, ITaskbarProgress
{
SplashForm splash;
ITaskbarList3 taskbar = null;
SplashForm splash = new SplashForm ();
TaskbarProgress taskbar = null;
public WebBrowser WebUI => webui;
public SplashForm SplashScreen => splash;
public object PublicObjectForScripting { get { return webui?.ObjectForScripting; } set { webui.ObjectForScripting = null; webui.ObjectForScripting = value; } }
protected Bridge._I_BridgeBase NowObject { get { return webui?.ObjectForScripting as Bridge._I_BridgeBase; } }
public WebAppForm ()
{
splash.Host = this;
InitializeComponent ();
webui.ObjectForScripting = new Bridge._I_BridgeBase (this, this, this, this);
taskbar = new TaskbarProgress (Handle);
}
public int PageScale
public virtual int PageScale
{
get { return IEHelper.WebBrowserHelper.GetPageScale (webui); }
set { IEHelper.WebBrowserHelper.SetPageScale (webui, value); }
}
public double ProgressValue
{
get
{
var web2 = WebBrowserHelper.GetWebBrowser2 (webui);
if (web2 == null) return 0;
object inArg = null;
object outArg = null;
try
{
web2.ExecWB (
OLECMDID.OLECMDID_OPTICAL_ZOOM,
OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT,
ref inArg,
ref outArg
);
if (outArg is int) return (int)outArg;
}
catch { }
return 0;
}
set
{
var web2 = WebBrowserHelper.GetWebBrowser2 (webui);
if (web2 == null) return;
object inArg = value;
object outArg = null;
try
{
web2.ExecWB (
OLECMDID.OLECMDID_OPTICAL_ZOOM,
OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER,
ref inArg,
ref outArg
);
}
catch { }
if (taskbar == null) return;
double total = 1000000;
taskbar.SetValue ((ulong)(value * total), (ulong)total);
}
}
public object CallEvent (string funcName, object e)
public TBPFLAG ProgressStatus { set { taskbar.SetState (value); } }
public virtual object CallEvent (string funcName, object e)
{
return null;
}
private void WebAppForm_Load (object sender, EventArgs e)
{
// splash.SplashBackgroundColor = Color.Green;
splash.ResizeSplashScreen ();
splash.Show ();
splash.Update ();
// splash.FadeOut ();
}
private bool issetdpi = false;
protected virtual void webui_DocumentCompleted (object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (!issetdpi)
{
issetdpi = true;
ExecScript ("Bridge.Frame.scale = Bridge.Frame.scale * Bridge.UI.dpi");
}
ExecScript ("Windows.UI.DPI.mode = 1");
if (e.Url.ToString () == webui.Url.ToString ())
{
splash.FadeOut ();
}
}
protected object CallScriptFunction (string funcName, params object [] args) { return webui.Document.InvokeScript (funcName, args); }
protected object CallScriptFunction (string funcName) { return webui.Document.InvokeScript (funcName); }
public object InvokeCallScript (string funcName, params object [] args)
{
if (this.InvokeRequired)
{
return this.Invoke (
new Func<string, object [], object> (CallScriptFunction),
funcName, args
);
}
else return CallScriptFunction (funcName, args);
}
public object InvokeCallScript (string funcName)
{
if (this.InvokeRequired)
{
return this.Invoke (
new Func<string, object> (CallScriptFunction),
funcName
);
}
else return CallScriptFunction (funcName);
}
public object ExecScript (params object [] cmdline) { return InvokeCallScript ("eval", cmdline); }
private void WebAppForm_FormClosing (object sender, FormClosingEventArgs e)
{
webui.ObjectForScripting = null;
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1172,6 +1172,444 @@
<CRC>0</CRC>
<StoreOnly>0</StoreOnly>
</FileData>
<FileData>
<FldRef>0</FldRef>
<FullName>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release\AppxPackage.dll</FullName>
<FileName>AppxPackage.dll</FileName>
<Source>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release</Source>
<Ext>dll</Ext>
<RTSource>档案</RTSource>
<Desc/>
<Recurse>1</Recurse>
<MatchMode>0</MatchMode>
<Dest>%AppFolder%</Dest>
<Overwrite>1</Overwrite>
<Backup>0</Backup>
<Protect>0</Protect>
<InstallOrder>1000</InstallOrder>
<SCStartRoot>0</SCStartRoot>
<SCStartProgs>0</SCStartProgs>
<SCAppFld>0</SCAppFld>
<SCStartup>0</SCStartup>
<SCDesk>0</SCDesk>
<SCQLaunch>0</SCQLaunch>
<SCStartPinOption>0</SCStartPinOption>
<SCCust>0</SCCust>
<CustSCPath/>
<SCDesc/>
<SCComment/>
<SCArgs/>
<SCWork/>
<UseExtIco>0</UseExtIco>
<IcoFN/>
<IcoIdx>0</IcoIdx>
<IcoShowMd>0</IcoShowMd>
<IcoHK>0</IcoHK>
<RegTTF>0</RegTTF>
<TTFName/>
<RegOCX>0</RegOCX>
<RegTLB>0</RegTLB>
<SupInUse>0</SupInUse>
<Compress>1</Compress>
<UseOrigAttr>1</UseOrigAttr>
<Attr>0</Attr>
<NoCRC>0</NoCRC>
<NoRemove>0</NoRemove>
<Shared>0</Shared>
<OSCond>
<OS>32768</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
</OSCond>
<RTCond/>
<BuildConfigs>
<Cfg>All</Cfg>
</BuildConfigs>
<Package>None</Package>
<Packages/>
<Notes/>
<CompSize>0</CompSize>
<CRC>0</CRC>
<StoreOnly>0</StoreOnly>
</FileData>
<FileData>
<FldRef>0</FldRef>
<FullName>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release\Bridge.dll</FullName>
<FileName>Bridge.dll</FileName>
<Source>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release</Source>
<Ext>dll</Ext>
<RTSource>档案</RTSource>
<Desc/>
<Recurse>1</Recurse>
<MatchMode>0</MatchMode>
<Dest>%AppFolder%</Dest>
<Overwrite>1</Overwrite>
<Backup>0</Backup>
<Protect>0</Protect>
<InstallOrder>1000</InstallOrder>
<SCStartRoot>0</SCStartRoot>
<SCStartProgs>0</SCStartProgs>
<SCAppFld>0</SCAppFld>
<SCStartup>0</SCStartup>
<SCDesk>0</SCDesk>
<SCQLaunch>0</SCQLaunch>
<SCStartPinOption>0</SCStartPinOption>
<SCCust>0</SCCust>
<CustSCPath/>
<SCDesc/>
<SCComment/>
<SCArgs/>
<SCWork/>
<UseExtIco>0</UseExtIco>
<IcoFN/>
<IcoIdx>0</IcoIdx>
<IcoShowMd>0</IcoShowMd>
<IcoHK>0</IcoHK>
<RegTTF>0</RegTTF>
<TTFName/>
<RegOCX>0</RegOCX>
<RegTLB>0</RegTLB>
<SupInUse>0</SupInUse>
<Compress>1</Compress>
<UseOrigAttr>1</UseOrigAttr>
<Attr>0</Attr>
<NoCRC>0</NoCRC>
<NoRemove>0</NoRemove>
<Shared>0</Shared>
<OSCond>
<OS>32768</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
</OSCond>
<RTCond/>
<BuildConfigs>
<Cfg>All</Cfg>
</BuildConfigs>
<Package>None</Package>
<Packages/>
<Notes/>
<CompSize>0</CompSize>
<CRC>0</CRC>
<StoreOnly>0</StoreOnly>
</FileData>
<FileData>
<FldRef>0</FldRef>
<FullName>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release\DataUtils.dll</FullName>
<FileName>DataUtils.dll</FileName>
<Source>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release</Source>
<Ext>dll</Ext>
<RTSource>档案</RTSource>
<Desc/>
<Recurse>1</Recurse>
<MatchMode>0</MatchMode>
<Dest>%AppFolder%</Dest>
<Overwrite>1</Overwrite>
<Backup>0</Backup>
<Protect>0</Protect>
<InstallOrder>1000</InstallOrder>
<SCStartRoot>0</SCStartRoot>
<SCStartProgs>0</SCStartProgs>
<SCAppFld>0</SCAppFld>
<SCStartup>0</SCStartup>
<SCDesk>0</SCDesk>
<SCQLaunch>0</SCQLaunch>
<SCStartPinOption>0</SCStartPinOption>
<SCCust>0</SCCust>
<CustSCPath/>
<SCDesc/>
<SCComment/>
<SCArgs/>
<SCWork/>
<UseExtIco>0</UseExtIco>
<IcoFN/>
<IcoIdx>0</IcoIdx>
<IcoShowMd>0</IcoShowMd>
<IcoHK>0</IcoHK>
<RegTTF>0</RegTTF>
<TTFName/>
<RegOCX>0</RegOCX>
<RegTLB>0</RegTLB>
<SupInUse>0</SupInUse>
<Compress>1</Compress>
<UseOrigAttr>1</UseOrigAttr>
<Attr>0</Attr>
<NoCRC>0</NoCRC>
<NoRemove>0</NoRemove>
<Shared>0</Shared>
<OSCond>
<OS>32768</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
</OSCond>
<RTCond/>
<BuildConfigs>
<Cfg>All</Cfg>
</BuildConfigs>
<Package>None</Package>
<Packages/>
<Notes/>
<CompSize>0</CompSize>
<CRC>0</CRC>
<StoreOnly>0</StoreOnly>
</FileData>
<FileData>
<FldRef>0</FldRef>
<FullName>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release\Newtonsoft.Json.dll</FullName>
<FileName>Newtonsoft.Json.dll</FileName>
<Source>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release</Source>
<Ext>dll</Ext>
<RTSource>档案</RTSource>
<Desc/>
<Recurse>1</Recurse>
<MatchMode>0</MatchMode>
<Dest>%AppFolder%</Dest>
<Overwrite>1</Overwrite>
<Backup>0</Backup>
<Protect>0</Protect>
<InstallOrder>1000</InstallOrder>
<SCStartRoot>0</SCStartRoot>
<SCStartProgs>0</SCStartProgs>
<SCAppFld>0</SCAppFld>
<SCStartup>0</SCStartup>
<SCDesk>0</SCDesk>
<SCQLaunch>0</SCQLaunch>
<SCStartPinOption>0</SCStartPinOption>
<SCCust>0</SCCust>
<CustSCPath/>
<SCDesc/>
<SCComment/>
<SCArgs/>
<SCWork/>
<UseExtIco>0</UseExtIco>
<IcoFN/>
<IcoIdx>0</IcoIdx>
<IcoShowMd>0</IcoShowMd>
<IcoHK>0</IcoHK>
<RegTTF>0</RegTTF>
<TTFName/>
<RegOCX>0</RegOCX>
<RegTLB>0</RegTLB>
<SupInUse>0</SupInUse>
<Compress>1</Compress>
<UseOrigAttr>1</UseOrigAttr>
<Attr>0</Attr>
<NoCRC>0</NoCRC>
<NoRemove>0</NoRemove>
<Shared>0</Shared>
<OSCond>
<OS>32768</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
</OSCond>
<RTCond/>
<BuildConfigs>
<Cfg>All</Cfg>
</BuildConfigs>
<Package>None</Package>
<Packages/>
<Notes/>
<CompSize>0</CompSize>
<CRC>0</CRC>
<StoreOnly>0</StoreOnly>
</FileData>
<FileData>
<FldRef>0</FldRef>
<FullName>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release\PrivateInit.dll</FullName>
<FileName>PrivateInit.dll</FileName>
<Source>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release</Source>
<Ext>dll</Ext>
<RTSource>档案</RTSource>
<Desc/>
<Recurse>1</Recurse>
<MatchMode>0</MatchMode>
<Dest>%AppFolder%</Dest>
<Overwrite>1</Overwrite>
<Backup>0</Backup>
<Protect>0</Protect>
<InstallOrder>1000</InstallOrder>
<SCStartRoot>0</SCStartRoot>
<SCStartProgs>0</SCStartProgs>
<SCAppFld>0</SCAppFld>
<SCStartup>0</SCStartup>
<SCDesk>0</SCDesk>
<SCQLaunch>0</SCQLaunch>
<SCStartPinOption>0</SCStartPinOption>
<SCCust>0</SCCust>
<CustSCPath/>
<SCDesc/>
<SCComment/>
<SCArgs/>
<SCWork/>
<UseExtIco>0</UseExtIco>
<IcoFN/>
<IcoIdx>0</IcoIdx>
<IcoShowMd>0</IcoShowMd>
<IcoHK>0</IcoHK>
<RegTTF>0</RegTTF>
<TTFName/>
<RegOCX>0</RegOCX>
<RegTLB>0</RegTLB>
<SupInUse>0</SupInUse>
<Compress>1</Compress>
<UseOrigAttr>1</UseOrigAttr>
<Attr>0</Attr>
<NoCRC>0</NoCRC>
<NoRemove>0</NoRemove>
<Shared>0</Shared>
<OSCond>
<OS>32768</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
</OSCond>
<RTCond/>
<BuildConfigs>
<Cfg>All</Cfg>
</BuildConfigs>
<Package>None</Package>
<Packages/>
<Notes/>
<CompSize>0</CompSize>
<CRC>0</CRC>
<StoreOnly>0</StoreOnly>
</FileData>
<FileData>
<FldRef>0</FldRef>
<FullName>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release\WAShell.dll</FullName>
<FileName>WAShell.dll</FileName>
<Source>E:\Profiles\Bruce\Documents\Visual Studio 2015\Projects\AppInstallerReset\Release</Source>
<Ext>dll</Ext>
<RTSource>档案</RTSource>
<Desc/>
<Recurse>1</Recurse>
<MatchMode>0</MatchMode>
<Dest>%AppFolder%</Dest>
<Overwrite>1</Overwrite>
<Backup>0</Backup>
<Protect>0</Protect>
<InstallOrder>1000</InstallOrder>
<SCStartRoot>0</SCStartRoot>
<SCStartProgs>0</SCStartProgs>
<SCAppFld>0</SCAppFld>
<SCStartup>0</SCStartup>
<SCDesk>0</SCDesk>
<SCQLaunch>0</SCQLaunch>
<SCStartPinOption>0</SCStartPinOption>
<SCCust>0</SCCust>
<CustSCPath/>
<SCDesc/>
<SCComment/>
<SCArgs/>
<SCWork/>
<UseExtIco>0</UseExtIco>
<IcoFN/>
<IcoIdx>0</IcoIdx>
<IcoShowMd>0</IcoShowMd>
<IcoHK>0</IcoHK>
<RegTTF>0</RegTTF>
<TTFName/>
<RegOCX>0</RegOCX>
<RegTLB>0</RegTLB>
<SupInUse>0</SupInUse>
<Compress>1</Compress>
<UseOrigAttr>1</UseOrigAttr>
<Attr>0</Attr>
<NoCRC>0</NoCRC>
<NoRemove>0</NoRemove>
<Shared>0</Shared>
<OSCond>
<OS>32768</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
<OS>65535</OS>
</OSCond>
<RTCond/>
<BuildConfigs>
<Cfg>All</Cfg>
</BuildConfigs>
<Package>None</Package>
<Packages/>
<Notes/>
<CompSize>0</CompSize>
<CRC>0</CRC>
<StoreOnly>0</StoreOnly>
</FileData>
</ArchiveFiles>
<ExternalFiles/>
<BeforeInstallingScreens>
@@ -2479,6 +2917,7 @@ text-align: center;
&lt;li&gt;WinJS (MIT License) - &lt;a href="https://github.com/winjs/winjs" target="_blank"&gt;https://github.com/winjs/winjs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;markdown.js (MIT License) - &lt;a href="https://github.com/evilstreak/markdown-js" target="_blank"&gt;https://github.com/evilstreak/markdown-js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;CodeMirror (MIT License) - &lt;a href="https://codemirror.net/" target="_blank"&gt;https://codemirror.net/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Json.NET (MIT License) - &lt;a href="https://www.newtonsoft.com/json" target="_blank"&gt;https://www.newtonsoft.com/json&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;4. Disclaimer&lt;/h2&gt;
@@ -2594,6 +3033,7 @@ text-align: center;
&lt;li&gt;WinJS (MIT License) - &lt;a href="https://github.com/winjs/winjs" target="_blank"&gt;https://github.com/winjs/winjs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;markdown.js (MIT License) - &lt;a href="https://github.com/evilstreak/markdown-js" target="_blank"&gt;https://github.com/evilstreak/markdown-js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;CodeMirror (MIT License) - &lt;a href="https://codemirror.net/" target="_blank"&gt;https://codemirror.net/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Json.NET (MIT License) - &lt;a href="https://www.newtonsoft.com/json" target="_blank"&gt;https://www.newtonsoft.com/json&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;四、免责声明&lt;/h2&gt;
@@ -6615,7 +7055,7 @@ g_HandleSystemReboot();
</SessionVar>
<SessionVar>
<Name>%ProductVer%</Name>
<Value>0.2.2.2</Value>
<Value>0.2.2.3</Value>
<Type>1</Type>
</SessionVar>
<SessionVar>

View File

@@ -364,6 +364,7 @@ class package_reader
prifilebundle pribundlereader;
std::vector <IStream *> prifilestreams;
#endif
void initpri ()
{
#ifdef _PRI_READER_CLI_HEADER_
@@ -404,16 +405,21 @@ class package_reader
case 0b10: {
if (hlpri) pribundlereader.set (1, (IStream *)hlpri);
if (hspri) pribundlereader.set (2, (IStream *)hspri);
if (hlpri) prifilestreams.push_back ((IStream *)hlpri);
if (hspri) prifilestreams.push_back ((IStream *)hspri);
HANDLE hd = GetAppxBundleApplicationPackageFile (hReader);
destruct relthd ([&hd] () {
if (hd) DestroyAppxFileStream (hd);
});
HANDLE hdpri = GetPriFileFromPayloadPackage (hd);
if (hd) pribundlereader.set (3, (IStream *)hd);
if (hd) prifilestreams.push_back ((IStream *)hdpri);
} break;
case 0b11: {
if (ls) pribundlereader.set (1, (IStream *)hlpri);
if (ss) pribundlereader.set (2, (IStream *)hspri);
if (ls && hlpri) prifilestreams.push_back ((IStream *)hlpri);
if (ss && hspri) prifilestreams.push_back ((IStream *)hspri);
} break;
default:
case 0b00: {

View File

@@ -56,7 +56,7 @@ struct iconhandle
LPCWSTR g_lpAppId = L"WindowsModern.PracticalToolsProject!Settings";
LPCWSTR g_idInVe = L"Settings";
LPCWSTR g_wndclass = L"Win32_WebUI_WindowsModern";
LPCWSTR g_wndclass = L"Win32_WebUI_WindowsModern_Settings";
iconhandle g_hIconMain (LoadRCIcon (IDI_ICON_MAIN));
initfile g_initfile (CombinePath (GetProgramRootDirectoryW (), L"config.ini"));
vemanifest g_vemani (

View File

@@ -0,0 +1,13 @@
@font-face {
font-family: "segxmvr";
src: url('segxmvr.woff') format('woff'), url('segxmvr.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "Segoe Xbox Symbol";
src: url('segxsym.woff') format('woff'), url('segxsym.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -92,12 +92,14 @@
Object.defineProperty(global.Bridge.UI, "darkmode", {
get: function() { return ext.System.UI.DarkMode; }
});
Object.defineProperty(global.Bridge.UI.Splash, "backcolor", {
get: function() { return ext.System.UI.SplashBackgroundColor; },
});
Object.defineProperty(global.Bridge.UI.Splash, "imageurl", {
get: function() { return ext.System.UI.SplashImage; },
});
try {
Object.defineProperty(global.Bridge.UI.Splash, "backcolor", {
get: function() { return ext.System.UI.SplashBackgroundColor; },
});
} catch (e) {}
try {
Object.defineProperty(global.Bridge.UI.Splash, "imageurl", {
get: function() { return ext.System.UI.SplashImage; },
});
} catch (e) {}
})(this);

View File

@@ -336,7 +336,7 @@
var version = content.querySelector(".id.version");
version.textContent = stringifyVersion(pkginfo.identity.realver);
var arch = content.querySelector(".id.arch");
console.log(pkginfo.identity.architecture);
//console.log(pkginfo, JSON.stringify(pkginfo));
if (pkginfo.type === 1) {
switch (pkginfo.identity.architecture) {
case 1:

View File

@@ -36,10 +36,10 @@
for (var i = 0; i < nodes.length; i++) {
if (nodes[i].hasAttribute('data-res-byname')) {
var resName = nodes[i].getAttribute('data-res-byname');
nodes[i].textContent = Bridge.Resources.byname(resName);
try { nodes[i].textContent = Bridge.Resources.byname(resName); } catch (e) {}
} else if (nodes[i].hasAttribute('data-res-byid')) {
var resId = parseInt(nodes[i].getAttribute('data-res-byid'), 10);
nodes[i].textContent = Bridge.Resources.byid(resId);
try { nodes[i].textContent = Bridge.Resources.byid(resId); } catch (e) {}
} else if (nodes[i].hasAttribute('data-res-fromfile')) {
try {
var obj = eval(nodes[i].getAttribute('data-res-fromfile'));

93
shared/html/manager.html Normal file
View File

@@ -0,0 +1,93 @@
<!DOCTYPE html>
<html>
<head>
<title>Package Manager</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<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" 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>
<script type="text/javascript" src="js/dpimodes.js"></script>
<script type="text/javascript" src="js/resources.js"></script>
<script type="text/javascript" src="js/animation.js"></script>
<link rel="stylesheet" href="fonts/fonts.css">
<link rel="stylesheet" href="fonts/segx.css">
<link rel="stylesheet" href="manager/page.css">
<link rel="stylesheet" href="manager/appitem.css">
<script type="text/javascript" src="js/event.js"></script>
<script type="text/javascript" src="js/tileback.js"></script>
<script type="text/javascript" src="js/load.js"></script>
<link rel="stylesheet" type="text/css" href="libs/msgbox/msgbox.css">
<script type="text/javascript" src="libs/msgbox/msgbox.js"></script>
<script type="text/javascript" src="js/init.js"></script>
</head>
<body>
<div id="settingpage" class="pagecontainer full">
<div class="page full guide fold">
<main class="main padding">
<div id="page-manager">
<h2>应用</h2>
<p>在这里,可以对安装的 Windows 商店应用进行管理。</p>
<h3>安装的应用</h3>
<template id="appitem-template">
</template>
<div class="appitem selected">
<div role="img">
<img width="24" height="24" src="images/applogo.default.png" />
</div>
<div role="divide"></div>
<div role="excepticon">
<div role="title" class="win-type-x-small"><span>App Name</span></div>
<div role="control"><button>卸载</button></div>
</div>
</div>
<ul>
<li></li>
</ul>
</div>
</main>
<aside class="win-ui-dark">
<nav class="container">
<ul class="list top">
<li class="title">
<div role="img">&#58344;</div>
<div role="placeholder"></div>
<span class="win-type-base">应用管理</span>
</li>
<script>
(function($) {
var foldBtn = document.querySelector(".page aside nav ul li.title");
var page = document.querySelector(".pagecontainer .page");
Windows.UI.Event.Util.addEvent(foldBtn, "dblclick", function() {
page.classList.toggle("fold");
});
})(this);
</script>
</ul>
<hr>
<ul class="list">
<li>
<div role="img">&#57587;</div>
<span class="win-type-base">管理</span>
</li>
<li>
<div role="img">&#57587;</div>
<span class="win-type-base">Manager</span>
</li>
</ul>
</nav>
</aside>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,118 @@
.appitem {
padding: 10px;
box-sizing: border-box;
height: 60px;
width: 450px;
max-width: 100%;
display: -ms-flexbox;
/* IE10 */
display: flex;
-ms-flex-direction: row;
/* IE10 */
flex-direction: row;
-ms-flex-wrap: nowrap;
/* IE10 */
flex-wrap: nowrap;
-ms-flex-line-pack: start;
/* IE10 -> align-content */
align-content: flex-start;
-ms-flex-pack: start;
/* IE10 -> justify-content */
justify-content: flex-start;
transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
}
.appitem:hover {
background-color: rgba(242, 242, 242, 1);
}
.appitem:active {
transform: scale(0.9695);
-ms-transform: scale(0.9695);
}
.appitem div[role=img] {
width: 40px;
height: 40px;
background-color: #464646;
display: -ms-flexbox;
/* IE10 */
display: flex;
-ms-flex-direction: row;
/* IE10 */
flex-direction: row;
-ms-flex-wrap: nowrap;
/* IE10 */
flex-wrap: nowrap;
-ms-flex-pack: center;
/* IE10 -> justify-content */
justify-content: center;
-ms-flex-align: center;
/* IE10 -> align-items */
align-items: center;
-ms-flex-line-pack: center;
/* IE10 -> align-content */
align-content: center;
}
.appitem div[role=divide] {
width: 10px;
min-width: 10px;
height: 100%;
}
.appitem div[role=excepticon] div[role=title] {
font-weight: normal;
flex: 1;
-ms-flex: 1;
}
.appitem div[role=excepticon] {
-ms-flex: 1;
flex: 1;
display: -ms-flexbox;
/* IE10 */
display: flex;
-ms-flex-direction: column;
/* IE10 */
flex-direction: column;
-ms-flex-wrap: nowrap;
/* IE10 */
flex-wrap: nowrap;
-ms-flex-line-pack: start;
/* IE10 -> align-content */
align-content: flex-start;
-ms-flex-pack: start;
/* IE10 -> justify-content */
justify-content: flex-start;
}
.appitem div[role=excepticon] div[role=control] {
display: none;
/* IE10 */
display: flex;
-ms-flex-direction: row-reverse;
/* IE10 */
flex-direction: row-reverse;
-ms-flex-wrap: wrap;
/* IE10 */
flex-wrap: wrap;
-ms-flex-line-pack: end;
/* IE10 -> align-content */
align-content: flex-end;
-ms-flex-pack: start;
/* IE10 -> justify-content */
justify-content: flex-start;
-ms-flex-align: center;
/* IE10 -> align-items */
align-items: center;
}
.appitem.selected {
height: 119px;
}
.appitem.selected div[role=excepticon] div[role=control] {
display: flex;
display: -ms-flexbox;
}

View File

@@ -0,0 +1,318 @@
body {
margin: 0;
width: 100%;
height: 100%;
-ms-overflow-style: -ms-autohiding-scrollbar;
user-select: none;
-ms-user-select: none;
}
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,
.win-type-x-large,
.win-type-xx-large,
.font-fixed {
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;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow-x: hidden;
overflow-y: hidden;
box-sizing: border-box;
margin: 0px;
padding: 0px;
border: 0px;
/* background-color: #f3f3f3; */
background-color: white;
}
.pagecontainer.full {
padding: 0px;
top: 0;
left: 0;
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
}
.pagecontainer>.page {
position: relative;
overflow-x: hidden;
overflow-y: hidden;
box-sizing: border-box;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
}
.page>aside {
overflow-y: auto;
overflow-x: hidden;
-ms-overflow-style: -ms-autohiding-scrollbar;
transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
background-color: rgba(34, 34, 34, 1);
position: absolute;
left: 0;
top: 0;
bottom: 0;
box-sizing: border-box;
width: 300px;
}
.page.fold>aside {
width: 90px;
}
.page>main {
overflow-x: hidden;
overflow-y: auto;
-ms-overflow-style: -ms-autohiding-scrollbar;
transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
position: absolute;
right: 0;
top: 0;
bottom: 0;
box-sizing: border-box;
left: 300px;
}
.page.fold>main {
left: 90px;
}
.page>aside hr {
margin-top: 9px;
margin-bottom: 9px;
width: calc(100% - 35px * 2);
border-color: rgba(100, 100, 100, 1);
}
.page.fold>aside hr {
width: calc(100% - 10px * 2);
}
aside>nav {
padding-top: 40px;
box-sizing: border-box;
}
aside>nav ul {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
aside>nav ul li {
width: 100%;
height: 50px;
box-sizing: border-box;
transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
font-size: 13pt;
padding: 0 35px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: flex-start;
align-items: center;
display: -ms-flexbox;
-ms-flex-direction: row;
-ms-flex-pack: start;
-ms-flex-align: center;
}
.page.fold>aside>nav ul li {
padding: 0;
}
aside>nav ul li div[role=img] {
height: 100%;
text-align: center;
font-family: 'Segoe UI Symbol', Symbols, 'Segoe Xbox Symbol', segxmvr, 'Segoe MDL2 Assets', 'Segoe Fluent Icons';
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
justify-content: center;
align-items: center;
display: -ms-flexbox;
-ms-flex-direction: row;
-ms-flex-wrap: none;
-ms-flex-pack: center;
-ms-flex-align: center;
-ms-flex-line-pack: center;
text-align: center;
}
.page.fold>aside>nav ul li div[role=img] {
min-width: 90px;
width: 90px;
}
.page.fold>aside>nav ul li span {
display: none;
opacity: 0;
}
.page>aside>nav ul li span {
display: block;
opacity: 1;
text-overflow: ellipsis;
transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
white-space: nowrap;
/* 不换行 */
overflow-x: hidden;
/* 超出隐藏 */
overflow-y: hidden;
}
.page>aside>nav ul li div[role=img] {
font-size: 15pt;
margin-right: 5px;
}
.page>aside>nav ul li.title div[role=img] {
font-size: 13pt;
margin: 0;
}
.page>aside>nav ul li.title {
display: -ms-flexbox;
display: flex;
-ms-flex-direction: row-reverse;
flex-direction: row-reverse;
-ms-flex-wrap: nowrap;
-ms-flex-pack: start;
/* justify-content: flex-start */
-ms-flex-align: center;
/* align-items: center */
align-content: center;
}
.page>aside>nav ul li.title span,
.page>aside>nav ul li.title div[role=placeholder] {
flex: 1;
-ms-flex: 1;
}
.page.fold>aside>nav ul li.title div[role=placeholder] {
display: none;
}
.page>aside>nav ul li:hover {
background-color: rgba(58, 58, 58, 1);
position: relative;
}
.page.fold>aside>nav ul li:hover {
width: 300px;
padding: 0 30px;
}
.page.fold>aside>nav ul li:hover div[role=img] {
min-width: 0;
width: auto;
}
.page.fold>aside>nav ul li:hover span {
display: block;
opacity: 1;
padding: 0 30px;
}
.page.fold>aside>nav ul li.title:hover {
width: 90px;
padding: 0;
}
.page.fold>aside>nav ul li.title:hover div[role=img] {
min-width: 0;
width: 90px;
}
.page.fold>aside>nav ul li.title:hover span {
display: none;
opacity: 0;
}
.page>aside>nav ul li:active {
background-color: rgba(100, 100, 100, 1);
}
.page.fold aside,
.page.fold aside>nav,
.page.fold aside>nav ul,
.page.fold aside>nav ul li {
overflow-x: visible;
overflow-y: visible;
}
.main.padding {
padding: 44px 60px;
}
.section {
width: 100%;
height: 100%;
box-sizing: border-box;
overflow-x: hidden;
overflow-y: auto;
-ms-overflow-style: -ms-autohiding-scrollbar;
position: absolute;
top: 0px;
left: 0px;
background-color: white;
}
.section.padding {
padding: 44px 60px;
}
.section.padding .bottom-compensate {
padding-bottom: 44px;
}

View File

@@ -86,6 +86,7 @@
<li><a href="https://github.com/winjs/winjs" target="_blank">WinJS</a></li>
<li><a href="https://github.com/evilstreak/markdown-js" target="_blank">markdown.js</a></li>
<li><a href="https://codemirror.net/" target="_blank">CodeMirror</a></li>
<li><a href="https://www.newtonsoft.com/json" target="_blank">Newtonsoft.Json</a></li>
</ul>
<script>
(function() {

View File

@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="/Content/Site.css" />
<title>&#39;MIT&#39; reference</title>
</head>
<body>
<div id="main-content">
<h1>MIT License</h1>
<h2>SPDX identifier</h2>
<div id="license-expression">MIT</div>
<h2>License text</h2>
<div class="optional-license-text">
<p>MIT License</p>
</div>
<div class="replaceable-license-text">
<p>Copyright (c) &lt;year&gt; &lt;copyright holders&gt;
</p>
</div>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of <var class="replaceable-license-text"> this software and
associated documentation files</var> (the &quot;Software&quot;), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:</p>
<p>The above copyright notice and this permission notice
<var class="optional-license-text"> (including the next paragraph)</var>
shall be included in all copies or substantial
portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL <var class="replaceable-license-text"> THE AUTHORS OR COPYRIGHT HOLDERS</var> BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<h2>SPDX web page</h2>
<ul>
<li><a href="https://spdx.org/licenses/MIT.html">https://spdx.org/licenses/MIT.html</a></li>
</ul>
<h2>Notice</h2>
<p>This license content is provided by the <a href="https://spdx.dev/">SPDX project</a>. For more information about <b>licenses.nuget.org</b>, see <a href="https://aka.ms/licenses.nuget.org">our documentation</a>.
<p><i>Data pulled from <a href="https://github.com/spdx/license-list-data">spdx/license-list-data</a> on November 6, 2024.</i></p>
</div>
</body>
</html>

View File

@@ -76,6 +76,7 @@ text-align: center;
<li>WinJS (MIT License) - <a href="https://github.com/winjs/winjs" target="_blank">https://github.com/winjs/winjs</a></li>
<li>markdown.js (MIT License) - <a href="https://github.com/evilstreak/markdown-js" target="_blank">https://github.com/evilstreak/markdown-js</a></li>
<li>CodeMirror (MIT License) - <a href="https://codemirror.net/" target="_blank">https://codemirror.net/</a></li>
<li>Json.NET (MIT License) - <a href="https://www.newtonsoft.com/json" target="_blank">https://www.newtonsoft.com/json</a></li>
</ul>
<h2>四、免责声明</h2>

View File

@@ -78,6 +78,7 @@ text-align: center;
<li>WinJS (MIT License) - <a href="https://github.com/winjs/winjs" target="_blank">https://github.com/winjs/winjs</a></li>
<li>markdown.js (MIT License) - <a href="https://github.com/evilstreak/markdown-js" target="_blank">https://github.com/evilstreak/markdown-js</a></li>
<li>CodeMirror (MIT License) - <a href="https://codemirror.net/" target="_blank">https://codemirror.net/</a></li>
<li>Json.NET (MIT License) - <a href="https://www.newtonsoft.com/json" target="_blank">https://www.newtonsoft.com/json</a></li>
</ul>
<h2>4. Disclaimer</h2>

View File

@@ -1 +1 @@
0.2.2.2
0.2.2.3