Upgrade to v2.3
修复手动模式密钥不正确时依然可以进行下一步的BUG 修改赞助地址到官网域名下 增加备用镜像服务器地址 优化错误代码-4的提示友好性(增加详细错误信息和解决方案) 增加检查更新功能 增加多语言支持(现已支持简体中文和英文) 增加根据语言环境自动调节本地化字体(需要在本地化文件里增加字体名称) 优化启动速度 界面代码和相关流程代码重构 Google Translate : Fix issue.(You can still proceed to the next step when key is Incorrect in manual mode.) Modify the sponsored address to the official website. Increase the alternate mirror server address. Optimize the error tips of error code-4 to more friendly (add detailed error information and solutions) Added Module of check updates. Added multi-language support. (Simplified Chinese and English are now supported) Increase the automatic adjustment of localized fonts according to the locale (requires adding font names to localized files) Optimize startup speed. UI code and related process code refactoring.
This commit is contained in:
parent
73d16ffb7a
commit
ef90cafac2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,7 @@
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Pink.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
|
||||
<ResourceDictionary Source="Lang/en.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>CMWTAT_DIGITAL</RootNamespace>
|
||||
<AssemblyName>CMWTAT_DIGITAL</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
@ -99,7 +99,11 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Lang\zh-cn.xaml">
|
||||
<Page Include="Lang\en.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Lang\zh.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<StartArguments>--hide -a</StartArguments>
|
||||
<StartArguments>
|
||||
</StartArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PublishUrlHistory>publish\</PublishUrlHistory>
|
||||
|
203
CMWTAT_DIGITAL/Lang/en.xaml
Normal file
203
CMWTAT_DIGITAL/Lang/en.xaml
Normal file
@ -0,0 +1,203 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--FontFamily Dictionary-->
|
||||
|
||||
<FontFamily x:Key="Font">
|
||||
Roboto
|
||||
</FontFamily>
|
||||
|
||||
<!--String Dictionary-->
|
||||
|
||||
<sys:String x:Key="OK">
|
||||
OK
|
||||
</sys:String>
|
||||
<sys:String x:Key="Cancel">
|
||||
Cancel
|
||||
</sys:String>
|
||||
<sys:String x:Key="Refuse">
|
||||
Refuse
|
||||
</sys:String>
|
||||
<sys:String x:Key="DonateBtn">
|
||||
Thanks developer and donate a dinner
|
||||
</sys:String>
|
||||
<sys:String x:Key="Exit">
|
||||
Exit
|
||||
</sys:String>
|
||||
<sys:String x:Key="UpdateNow">
|
||||
Update Now
|
||||
</sys:String>
|
||||
<sys:String x:Key="Ignore">
|
||||
Ignore
|
||||
</sys:String>
|
||||
<sys:String x:Key="TitleName">
|
||||
CMWTAT Digital Edition
|
||||
</sys:String>
|
||||
<sys:String x:Key="AppName">
|
||||
CMWTAT Digital Edition V2
|
||||
</sys:String>
|
||||
<sys:String x:Key="UpdateTitle">
|
||||
A new version available!
|
||||
</sys:String>
|
||||
<sys:String x:Key="CurrentVersion">
|
||||
Current Version
|
||||
</sys:String>
|
||||
<sys:String x:Key="LatestVersion">
|
||||
Latest Version
|
||||
</sys:String>
|
||||
<sys:String x:Key="Auto_Mode">
|
||||
Auto Mode
|
||||
</sys:String>
|
||||
<sys:String x:Key="Manual_Mode">
|
||||
Manual Mode
|
||||
</sys:String>
|
||||
<sys:String x:Key="Activate_Button">
|
||||
Activate
|
||||
</sys:String>
|
||||
<sys:String x:Key="Convert_versions">
|
||||
Convert versions (Install Key without Activate)
|
||||
</sys:String>
|
||||
<sys:String x:Key="test">
|
||||
Test Text
|
||||
</sys:String>
|
||||
<sys:String x:Key="Loading">
|
||||
Loading
|
||||
</sys:String>
|
||||
<sys:String x:Key="Activating">
|
||||
Activating
|
||||
</sys:String>
|
||||
<sys:String x:Key="Complete">
|
||||
Complete
|
||||
</sys:String>
|
||||
<sys:String x:Key="notifyIconTitle">
|
||||
CloudMoe Windows 10 Activation Toolkit V2
|
||||
</sys:String>
|
||||
<sys:String x:Key="Running">
|
||||
Running.
|
||||
</sys:String>
|
||||
<sys:String x:Key="Experimental">
|
||||
Experimental
|
||||
</sys:String>
|
||||
<sys:String x:Key="Attention">
|
||||
Attention
|
||||
</sys:String>
|
||||
<sys:String x:Key="System_Edition">
|
||||
System edition
|
||||
</sys:String>
|
||||
<sys:String x:Key="May_be_not_be_supported">
|
||||
Unable to correctly identify your operating system edition in support list, may be not be supported.
|
||||
</sys:String>
|
||||
<sys:String x:Key="Only_find_experimental">
|
||||
Only find experimental options that can be used with this operating system edition, little hope of activation success.
|
||||
</sys:String>
|
||||
<sys:String x:Key="notify_May_be_not_be_supported_try">
|
||||
Your system edition may not be supported, program will exit. you can try add --expact or -e to startup.
|
||||
</sys:String>
|
||||
<sys:String x:Key="notify_May_be_not_be_supported_exit">
|
||||
Your system edition may not be supported, program will exit.
|
||||
</sys:String>
|
||||
<sys:String x:Key="notify_Disconnect_to_server_exit">
|
||||
Unable to connect to server, Please check the network and try to try again later, program will exit.
|
||||
</sys:String>
|
||||
<sys:String x:Key="Disconnect_to_server_exit">
|
||||
Unable to connect to server, Please check the network and try to try again later, program will exit.
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunInstall_Converting">
|
||||
Converting
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Activating">
|
||||
Activating
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunInstall_Getting_Key">
|
||||
Getting Key via Internet
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Getting_Key">
|
||||
Getting Key via Internet
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunInstall_Uninstalling_old_Key">
|
||||
Uninstalling old Key
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Uninstalling_old_Key">
|
||||
Uninstalling old Key
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Uninstalling_old_Key_Exp">
|
||||
Uninstalling old Key (Experimental)
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunInstall_Installing_Key">
|
||||
Installing Key
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Installing_Key">
|
||||
Installing Key
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Getting_edition_code_Exp">
|
||||
Getting edition code (Experimental)
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Prepare_for_the_next_step_Exp">
|
||||
Prepare for the next step (Experimental)
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Writing_old_OS">
|
||||
Writing feature of old Windows version
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Getting_free_upgrade_permissions">
|
||||
Getting free upgrade permissions
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Cleaning_changes">
|
||||
Cleaning changes
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Getting_digital_license">
|
||||
Getting digital license
|
||||
</sys:String>
|
||||
<sys:String x:Key="CompleteTitle">
|
||||
Complete
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorTitle">
|
||||
Error
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorCode">
|
||||
Code:
|
||||
</sys:String>
|
||||
<sys:String x:Key="SysMsg">
|
||||
System return:
|
||||
</sys:String>
|
||||
|
||||
<!--
|
||||
Attention:
|
||||
DO NOT USE ANY Indentation in Preserve Mode, Please!
|
||||
-->
|
||||
|
||||
<sys:String x:Key="HelpText" xml:space="preserve">
|
||||
This application now supports the use of console args to startup! -a	--auto		Auto activate. -h	--hide		Run with hide mode (Only be worked with -auto). -e	--expact		Experimental activation. -?	--help		Show this help Dialog.
|
||||
</sys:String>
|
||||
<sys:String x:Key="DonateTextConverted" xml:space="preserve">
|
||||
Congratulation! Windows 10 has been successful converted.
|
||||
</sys:String>
|
||||
<sys:String x:Key="DonateTextActivated" xml:space="preserve">
|
||||
Congratulation! Windows 10 has been successful activated.
|
||||
</sys:String>
|
||||
<sys:String x:Key="UpdateText" xml:space="preserve">
|
||||
We found a new version for CloudMoe Windows 10 Activation Toolkit Digital Edition. Please update to the latest version to make sure it works.
|
||||
</sys:String>
|
||||
<sys:String x:Key="UpdateMustText" xml:space="preserve">
|
||||
We found a new version for CloudMoe Windows 10 Activation Toolkit Digital Edition. And because your version is too old, so you MUST update to the latest version to make sure it works.
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-0" xml:space="preserve">
|
||||
Activate Windows 10 requires a network to gets the product key :)
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-1" xml:space="preserve">
|
||||
Cannot to uninstall old key. :(
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-1.1" xml:space="preserve">
|
||||
Cannot to install key, may be you choose or enter a incorrect version. :(
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-1.2" xml:space="preserve">
|
||||
Cannot to get edition code. :(
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-2" xml:space="preserve">
|
||||
Cannot to install key, may be you choose or enter a incorrect version. :(
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-3" xml:space="preserve">
|
||||
Time out, may be you choose or enter a incorrect version. :(
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-4" xml:space="preserve">
|
||||
Activation Failed. :( Maybe: 1.This edition/version of Windows does not support digital license activation. 2. Unable to connect to Microsoft Windows Activation Server. 3. Other unexpected problems. You can try to wait a minute or try again later.
|
||||
</sys:String>
|
||||
</ResourceDictionary>
|
203
CMWTAT_DIGITAL/Lang/zh.xaml
Normal file
203
CMWTAT_DIGITAL/Lang/zh.xaml
Normal file
@ -0,0 +1,203 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<!--FontFamily Dictionary-->
|
||||
|
||||
<FontFamily x:Key="Font">
|
||||
Microsoft YaHei UI
|
||||
</FontFamily>
|
||||
|
||||
<!--String Dictionary-->
|
||||
|
||||
<sys:String x:Key="OK">
|
||||
好
|
||||
</sys:String>
|
||||
<sys:String x:Key="Cancel">
|
||||
取消
|
||||
</sys:String>
|
||||
<sys:String x:Key="Refuse">
|
||||
丑拒
|
||||
</sys:String>
|
||||
<sys:String x:Key="DonateBtn">
|
||||
请顿晚饭,感谢作者
|
||||
</sys:String>
|
||||
<sys:String x:Key="Exit">
|
||||
退出
|
||||
</sys:String>
|
||||
<sys:String x:Key="UpdateNow">
|
||||
立即更新
|
||||
</sys:String>
|
||||
<sys:String x:Key="Ignore">
|
||||
忽略
|
||||
</sys:String>
|
||||
<sys:String x:Key="TitleName">
|
||||
云萌 Windows 10 数字权利激活工具
|
||||
</sys:String>
|
||||
<sys:String x:Key="AppName">
|
||||
CMWTAT Digital Edition V2
|
||||
</sys:String>
|
||||
<sys:String x:Key="UpdateTitle">
|
||||
新版本可用!
|
||||
</sys:String>
|
||||
<sys:String x:Key="CurrentVersion">
|
||||
当前版本
|
||||
</sys:String>
|
||||
<sys:String x:Key="LatestVersion">
|
||||
最新版本
|
||||
</sys:String>
|
||||
<sys:String x:Key="Auto_Mode">
|
||||
自动模式
|
||||
</sys:String>
|
||||
<sys:String x:Key="Manual_Mode">
|
||||
手动模式
|
||||
</sys:String>
|
||||
<sys:String x:Key="Activate_Button">
|
||||
激活
|
||||
</sys:String>
|
||||
<sys:String x:Key="Convert_versions">
|
||||
版本无缝转换 (安装产品密钥而不激活)
|
||||
</sys:String>
|
||||
<sys:String x:Key="test">
|
||||
测试文本
|
||||
</sys:String>
|
||||
<sys:String x:Key="Loading">
|
||||
载入中
|
||||
</sys:String>
|
||||
<sys:String x:Key="Activating">
|
||||
激活中
|
||||
</sys:String>
|
||||
<sys:String x:Key="Complete">
|
||||
完成
|
||||
</sys:String>
|
||||
<sys:String x:Key="notifyIconTitle">
|
||||
云萌 Windows 10 激活工具 V2
|
||||
</sys:String>
|
||||
<sys:String x:Key="Running">
|
||||
运行中。
|
||||
</sys:String>
|
||||
<sys:String x:Key="Experimental">
|
||||
实验性
|
||||
</sys:String>
|
||||
<sys:String x:Key="Attention">
|
||||
注意
|
||||
</sys:String>
|
||||
<sys:String x:Key="System_Edition">
|
||||
系统版本
|
||||
</sys:String>
|
||||
<sys:String x:Key="May_be_not_be_supported">
|
||||
无法在支持列表里识别您的操作系统版本,可能不受支持。
|
||||
</sys:String>
|
||||
<sys:String x:Key="Only_find_experimental">
|
||||
只找到用于此版本系统的实验性选项,成功概率极低。
|
||||
</sys:String>
|
||||
<sys:String x:Key="notify_May_be_not_be_supported_try">
|
||||
你的系统版本可能不受支持,程序即将退出。不过你可以尝试添加 --expact 或者 -e 参数来启动。
|
||||
</sys:String>
|
||||
<sys:String x:Key="notify_May_be_not_be_supported_exit">
|
||||
你的系统版本可能不受支持,程序即将退出。
|
||||
</sys:String>
|
||||
<sys:String x:Key="notify_Disconnect_to_server_exit">
|
||||
无法连接服务器,请检查网络并尝试稍后重试,程序即将退出。
|
||||
</sys:String>
|
||||
<sys:String x:Key="Disconnect_to_server_exit">
|
||||
无法连接服务器,请检查网络并尝试稍后重试,程序即将退出。
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunInstall_Converting">
|
||||
转换中
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Activating">
|
||||
激活中
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunInstall_Getting_Key">
|
||||
正在通过网络获取产品密钥
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Getting_Key">
|
||||
正在通过网络获取产品密钥
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunInstall_Uninstalling_old_Key">
|
||||
正在卸载旧的产品密钥
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Uninstalling_old_Key">
|
||||
正在卸载旧的产品密钥
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Uninstalling_old_Key_Exp">
|
||||
正在卸载旧的产品密钥(实验性)
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunInstall_Installing_Key">
|
||||
正在安装产品密钥
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Installing_Key">
|
||||
正在安装产品密钥
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Getting_edition_code_Exp">
|
||||
正在获取版本代号(实验性)
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Prepare_for_the_next_step_Exp">
|
||||
正在准备下一步(实验性)
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Writing_old_OS">
|
||||
正在写入旧系统残留特征
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Getting_free_upgrade_permissions">
|
||||
正在获取免费升级许可
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Cleaning_changes">
|
||||
正在清理更改
|
||||
</sys:String>
|
||||
<sys:String x:Key="RunAct_Getting_digital_license">
|
||||
正在获取数字许可证
|
||||
</sys:String>
|
||||
<sys:String x:Key="CompleteTitle">
|
||||
完成
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorTitle">
|
||||
错误
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorCode">
|
||||
代码:
|
||||
</sys:String>
|
||||
<sys:String x:Key="SysMsg">
|
||||
系统返回:
|
||||
</sys:String>
|
||||
|
||||
<!--
|
||||
Attention:
|
||||
DO NOT USE ANY Indentation in Preserve Mode, Please!
|
||||
-->
|
||||
|
||||
<sys:String x:Key="HelpText" xml:space="preserve">
|
||||
这个应用现已支持通过控制台参数启动! -a	--auto		自动激活。 -h	--hide		隐藏模式运行 (只能与 -auto 一起使用)。 -e	--expact		实验性激活。 -?	--help		显示此说明对话框。
|
||||
</sys:String>
|
||||
<sys:String x:Key="DonateTextConverted" xml:space="preserve">
|
||||
祝贺! Windows 10 已经成功转换。
|
||||
</sys:String>
|
||||
<sys:String x:Key="DonateTextActivated" xml:space="preserve">
|
||||
祝贺! Windows 10 已经成功激活。
|
||||
</sys:String>
|
||||
<sys:String x:Key="UpdateText" xml:space="preserve">
|
||||
我们发现了新版本的 云萌 Windows10 数字权利激活工具。 请更新到最新版本来确保它可以正常工作。
|
||||
</sys:String>
|
||||
<sys:String x:Key="UpdateMustText" xml:space="preserve">
|
||||
我们发现了新版本的 云萌 Windows10 数字权利激活工具。 由于您的版本太旧,所以您必须更新到最新版本来确保它可以正常工作。
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-0" xml:space="preserve">
|
||||
激活Windows10需要网络获取产品密钥 :)
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-1" xml:space="preserve">
|
||||
无法卸载旧密钥 :(
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-1.1" xml:space="preserve">
|
||||
无法安装密钥,可能没有选择或输入正确的版本 :(
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-1.2" xml:space="preserve">
|
||||
无法获取版本代号 :(
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-2" xml:space="preserve">
|
||||
无法安装密钥,可能没有选择或输入正确的版本 :(
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-3" xml:space="preserve">
|
||||
执行超时,可能没有选择正确或输入的版本 :(
|
||||
</sys:String>
|
||||
<sys:String x:Key="ErrorMsg-4" xml:space="preserve">
|
||||
激活失败。 :( 可能因为: 1. 此版本/类型的 Windows 不支持数字权利(数字许可证)方式激活。 2. 无法连接到微软Windows激活服务器。 3. 其它未知问题。 你可以尝试稍等片刻或者稍后重试。
|
||||
</sys:String>
|
||||
</ResourceDictionary>
|
@ -6,7 +6,7 @@
|
||||
xmlns:domain="clr-namespace:CMWTAT_DIGITAL.Domain"
|
||||
xmlns:local="clr-namespace:CMWTAT_DIGITAL"
|
||||
mc:Ignorable="d"
|
||||
Title="CMWTAT Digital Edition V2" Height="550" Width="450"
|
||||
Title="{DynamicResource TitleName}" Height="550" Width="450"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
|
||||
TextElement.FontWeight="Regular"
|
||||
@ -14,16 +14,17 @@
|
||||
TextOptions.TextFormattingMode="Ideal"
|
||||
TextOptions.TextRenderingMode="Auto"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
FontFamily="{DynamicResource MaterialDesignFont}"
|
||||
ResizeMode="NoResize"
|
||||
d:DataContext="{d:DesignInstance domain:ViewModel, d:IsDesignTimeCreatable=False}"
|
||||
Icon="CMWTAT.ico"
|
||||
Closing="Window_Closing"
|
||||
FontFamily="{DynamicResource Font}"
|
||||
>
|
||||
<!--FontFamily="{DynamicResource MaterialDesignFont}"-->
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<materialDesign:Card Padding="32" Margin="15,15,15,0">
|
||||
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}"><Run Text="CMWTAT Digital Edition V2"/></TextBlock>
|
||||
<TextBlock FontSize="20" ><Run Text="{DynamicResource AppName}"/></TextBlock>
|
||||
</materialDesign:Card>
|
||||
<materialDesign:Card Padding="32" Margin="15,15,15,0">
|
||||
<StackPanel>
|
||||
@ -39,15 +40,15 @@
|
||||
</TextBox.Text>
|
||||
</TextBox>
|
||||
</Grid>
|
||||
<!--<TextBlock x:Name="SystemEditionText" Style="{DynamicResource MaterialDesignTitleTextBlock}" Text="Checking System" />-->
|
||||
<!--<TextBlock x:Name="SystemEditionText" Text="Checking System" />-->
|
||||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Margin="0,30,0,0">
|
||||
<RadioButton x:Name="AutoRadio" Content="Auto Mode" Margin="30,0,30,0" IsChecked="True" Checked="A_RadioButton_Checked"/>
|
||||
<RadioButton x:Name="ManualRadio" Content="Manual Mode" Margin="30,0,30,0" Checked="M_RadioButton_Checked"/>
|
||||
<RadioButton x:Name="AutoRadio" Content="{DynamicResource Auto_Mode}" Margin="30,0,30,0" IsChecked="True" Checked="A_RadioButton_Checked"/>
|
||||
<RadioButton x:Name="ManualRadio" Content="{DynamicResource Manual_Mode}" Margin="30,0,30,0" Checked="M_RadioButton_Checked"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
<Button x:Name="actbtn" Content="Activate" Margin="30,30,30,0" VerticalAlignment="Top" Click="Activate_Button_Click" Height="65"/>
|
||||
<Button x:Name="installbtn" Content="Convert versions (Install Key without Activate)" Margin="30,30,30,0" VerticalAlignment="Top" Click="installbtn_Click" Height="65"/>
|
||||
<Button FontFamily="{DynamicResource Font}" x:Name="actbtn" Content="{DynamicResource Activate_Button}" Margin="30,30,30,0" VerticalAlignment="Top" Click="Activate_Button_Click" Height="65"/>
|
||||
<Button FontFamily="{DynamicResource Font}" x:Name="installbtn" Content="{DynamicResource Convert_versions}" Margin="30,30,30,0" VerticalAlignment="Top" Click="installbtn_Click" Height="65"/>
|
||||
</StackPanel>
|
||||
<Grid x:Name="DialogHostGrid" Visibility="Hidden">
|
||||
<materialDesign:DialogHost x:Name="DialogWait" IsOpen="False">
|
||||
@ -57,7 +58,7 @@
|
||||
<StackPanel>
|
||||
<StackPanel Margin="32,24,32,24">
|
||||
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
|
||||
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Loading</TextBlock>
|
||||
<TextBlock Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Loading}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
@ -71,7 +72,7 @@
|
||||
<StackPanel>
|
||||
<StackPanel Margin="32,24,32,24">
|
||||
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
|
||||
<TextBlock x:Name="activatingtext" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Activating</TextBlock>
|
||||
<TextBlock x:Name="activatingtext" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Activating}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
@ -85,13 +86,13 @@
|
||||
<StackPanel>
|
||||
<StackPanel Margin="24,24,24,8">
|
||||
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
|
||||
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="24,16,24,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Loading</TextBlock>
|
||||
<TextBlock Margin="24,16,24,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Loading}" />
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
|
||||
CommandParameter="Sample2Cancel"
|
||||
HorizontalAlignment="Center">CANCEL</Button>
|
||||
HorizontalAlignment="Center" Content="{DynamicResource Cancel}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
@ -105,14 +106,14 @@
|
||||
<StackPanel>
|
||||
<StackPanel Margin="16,16,16,8">
|
||||
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
|
||||
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Title</TextBlock>
|
||||
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Hello World</TextBlock>
|
||||
<TextBlock Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Title" />
|
||||
<TextBlock Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="Hello World" />
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
|
||||
CommandParameter="Sample2Cancel"
|
||||
HorizontalAlignment="Center">OK</Button>
|
||||
HorizontalAlignment="Center" Content="{DynamicResource OK}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
@ -126,14 +127,14 @@
|
||||
<StackPanel>
|
||||
<StackPanel Margin="16,16,16,8">
|
||||
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
|
||||
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Help"></TextBlock>
|
||||
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="This application now supports the use of console args to startup! -a	--auto		Auto activate. -h	--hide		Run with hide mode (Only be worked with -auto). -e	--expact		Experimental activation. -?	--help		Show this help Dialog."></TextBlock>
|
||||
<TextBlock Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Help"></TextBlock>
|
||||
<TextBlock Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource HelpText}"></TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
|
||||
CommandParameter="Sample2Cancel"
|
||||
HorizontalAlignment="Center">OK</Button>
|
||||
HorizontalAlignment="Center" Content="{DynamicResource OK}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
@ -147,13 +148,13 @@
|
||||
<StackPanel>
|
||||
<StackPanel Margin="16,16,16,8">
|
||||
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
|
||||
<TextBlock x:Name="DialogWithExitTitle" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Error</TextBlock>
|
||||
<TextBlock x:Name="DialogWithExitText" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Unable to connect to server, program will exit.</TextBlock>
|
||||
<TextBlock x:Name="DialogWithExitTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource ErrorTitle}"/>
|
||||
<TextBlock x:Name="DialogWithExitText" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Disconnect_to_server_exit}"/>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
Click="Exit_Button_Click"
|
||||
HorizontalAlignment="Center">Exit</Button>
|
||||
HorizontalAlignment="Center" Content="{DynamicResource Exit}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
@ -167,13 +168,13 @@
|
||||
<StackPanel>
|
||||
<StackPanel Margin="16,16,16,8">
|
||||
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
|
||||
<TextBlock x:Name="DialogWithOKToCloseDialogTitle" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Title</TextBlock>
|
||||
<TextBlock x:Name="DialogWithOKToCloseDialogText" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Text</TextBlock>
|
||||
<TextBlock x:Name="DialogWithOKToCloseDialogTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Title</TextBlock>
|
||||
<TextBlock x:Name="DialogWithOKToCloseDialogText" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Text</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
|
||||
HorizontalAlignment="Center">OK</Button>
|
||||
HorizontalAlignment="Center" Content="{DynamicResource OK}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
@ -187,16 +188,35 @@
|
||||
<StackPanel>
|
||||
<StackPanel Margin="16,16,16,8">
|
||||
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
|
||||
<TextBlock x:Name="DialogWithOKToCloseDialogDonateTitle" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Title</TextBlock>
|
||||
<TextBlock x:Name="DialogWithOKToCloseDialogDonateText" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" >Text</TextBlock>
|
||||
<TextBlock x:Name="DialogWithOKToCloseDialogDonateTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource Complete}" />
|
||||
<TextBlock x:Name="DialogWithOKToCloseDialogDonateText" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource DonateTextActivated}" />
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
Click="Donate_Button_Click"
|
||||
HorizontalAlignment="Center">Thanks developer and donate a dinner</Button>
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
|
||||
HorizontalAlignment="Center">Refuse</Button>
|
||||
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" HorizontalAlignment="Center" Content="{DynamicResource Refuse}"/>
|
||||
<Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
Click="Donate_Button_Click" HorizontalAlignment="Center" Content="{DynamicResource DonateBtn}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
</Grid>
|
||||
</materialDesign:DialogHost.DialogContent>
|
||||
</materialDesign:DialogHost>
|
||||
<materialDesign:DialogHost x:Name="DialogUpdate" IsOpen="False">
|
||||
<materialDesign:DialogHost.DialogContent>
|
||||
<Grid>
|
||||
<materialDesign:Card>
|
||||
<StackPanel>
|
||||
<StackPanel Margin="16,16,16,8">
|
||||
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
|
||||
<TextBlock x:Name="DialogUpdateTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource UpdateTitle}" />
|
||||
<TextBlock x:Name="DialogUpdateText" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource UpdateText}" />
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
|
||||
<Button x:Name="IgnoreUpdate" FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" HorizontalAlignment="Center" Content="{DynamicResource Ignore}"/>
|
||||
<Button x:Name="UpdateBtn" FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
|
||||
Click="UpdateBtn_Click" HorizontalAlignment="Center" Content="{DynamicResource UpdateNow}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
|
@ -22,9 +22,17 @@ using Microsoft.Win32;
|
||||
using CMWTAT_DIGITAL.Domain;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
|
||||
namespace CMWTAT_DIGITAL
|
||||
{
|
||||
|
||||
static class Constants
|
||||
{
|
||||
public const string DefaultLang = "en"; // 缺省语言
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MainWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
@ -112,6 +120,77 @@ namespace CMWTAT_DIGITAL
|
||||
fileStream.Close();
|
||||
}
|
||||
|
||||
public static string LocalLang = Constants.DefaultLang;
|
||||
public static string NowLang = LocalLang;
|
||||
ResourceDictionary langRd = null; //语言资源字典
|
||||
public static CultureInfo currentCultureInfo = CultureInfo.CurrentCulture; //获取系统语言
|
||||
public static bool NotSupportLang = false;
|
||||
|
||||
/// <summary>
|
||||
/// 加载指定语言(支持热加载)
|
||||
/// </summary>
|
||||
public void LoadLang(string LangName = Constants.DefaultLang)
|
||||
{
|
||||
|
||||
//MessageBox.Show(currentCultureInfo.Name);
|
||||
|
||||
try
|
||||
{
|
||||
//根据名字载入语言文件
|
||||
langRd = System.Windows.Application.LoadComponent(new Uri(@"Lang\" + LangName + ".xaml", UriKind.Relative)) as ResourceDictionary;
|
||||
NowLang = LangName;
|
||||
if (LangName != Constants.DefaultLang)
|
||||
{
|
||||
LocalLang = LangName;
|
||||
//btnChangeLang.Tag = LocalLang;
|
||||
}
|
||||
NotSupportLang = false;
|
||||
}
|
||||
catch
|
||||
{
|
||||
NotSupportLang = true;
|
||||
//System.Windows.MessageBox.Show("The " + LangName + " language pack was not found and the language was set to English.\nIf you want to use Chinese as the interface language, click the \"Language\" button to switch.");
|
||||
langRd = System.Windows.Application.LoadComponent(new Uri(@"Lang\" + Constants.DefaultLang + ".xaml", UriKind.Relative)) as ResourceDictionary;
|
||||
NowLang = Constants.DefaultLang;
|
||||
}
|
||||
|
||||
if (langRd != null)
|
||||
{
|
||||
//如果已使用其他语言,先清空
|
||||
if (this.Resources.MergedDictionaries.Count > 0)
|
||||
{
|
||||
this.Resources.MergedDictionaries.Clear();
|
||||
}
|
||||
this.Resources.MergedDictionaries.Add(langRd);
|
||||
}
|
||||
}
|
||||
|
||||
string ProductVersion = "0.0.0.0"; // 存储程序版本
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前版本
|
||||
/// </summary>
|
||||
private void GetEdition()
|
||||
{
|
||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
|
||||
Console.WriteLine("AppAssemblyFullName: " + assembly.FullName);
|
||||
|
||||
// 获取程序集元数据
|
||||
AssemblyCopyrightAttribute copyright = (AssemblyCopyrightAttribute)
|
||||
AssemblyCopyrightAttribute.GetCustomAttribute(Assembly.GetExecutingAssembly(),
|
||||
typeof(AssemblyCopyrightAttribute));
|
||||
AssemblyDescriptionAttribute description = (AssemblyDescriptionAttribute)
|
||||
AssemblyDescriptionAttribute.GetCustomAttribute(System.Reflection.Assembly.GetExecutingAssembly(),
|
||||
typeof(AssemblyDescriptionAttribute));
|
||||
|
||||
ProductVersion = System.Windows.Forms.Application.ProductVersion;
|
||||
|
||||
Console.WriteLine("AppDescription: " + description.Description);
|
||||
Console.WriteLine("AppCopyright: " + copyright.Copyright);
|
||||
Console.WriteLine("AppProductVersion: " + System.Windows.Forms.Application.ProductVersion);
|
||||
}
|
||||
|
||||
bool autoact = false;
|
||||
bool hiderun = false;
|
||||
bool expact = false;
|
||||
@ -125,6 +204,8 @@ namespace CMWTAT_DIGITAL
|
||||
public MainWindow()
|
||||
{
|
||||
|
||||
GetEdition(); // 获取程序版本
|
||||
|
||||
autoact = Program.autoact;
|
||||
hiderun = Program.hiderun;
|
||||
expact = Program.expact;
|
||||
@ -134,18 +215,28 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
string LangName = currentCultureInfo.Name;
|
||||
//根据本地语言来进行本地化
|
||||
LangName = LangName.Substring(0, LangName.IndexOf("-"));
|
||||
//LangName = "ja"; // 如需测试语言,请取消注释此行
|
||||
LoadLang(LangName);
|
||||
|
||||
this.Title = this.Title + " V" + ProductVersion; // 初始化语言后为标题增加版本号
|
||||
|
||||
//System.Windows.MessageBox.Show((string)this.Resources["HelpText"]);
|
||||
|
||||
if (showhelp == true)
|
||||
{
|
||||
DialogHelp.IsOpen = true;
|
||||
}
|
||||
|
||||
notifyIcon = new System.Windows.Forms.NotifyIcon();
|
||||
notifyIcon.Text = "CloudMoe Windows 10 Activation Toolkit V2";
|
||||
notifyIcon = new System.Windows.Forms.NotifyIcon(); // 先初始化托盘图标,以方便语言缺省时提示
|
||||
notifyIcon.Text = (string)this.Resources["notifyIconTitle"]; //托盘图标标题
|
||||
notifyIcon.Icon = ((System.Drawing.Icon)(CMWTAT_DIGITAL.Properties.Resources.CMWTAT_ICON));
|
||||
|
||||
if (hiderun == true && autoact == true)
|
||||
if ((hiderun == true && autoact == true) || NotSupportLang == true)
|
||||
{
|
||||
this.Hide();
|
||||
|
||||
//notifyIcon.BalloonTipText = "The app has been minimised. Click the tray icon to show.";
|
||||
//notifyIcon.BalloonTipTitle = "The App";
|
||||
|
||||
@ -177,10 +268,24 @@ namespace CMWTAT_DIGITAL
|
||||
//{
|
||||
// if (e.Button == MouseButtons.Left) this.Show();
|
||||
//});
|
||||
}
|
||||
|
||||
if (NotSupportLang == true)
|
||||
{
|
||||
int tipShowMilliseconds = 0;
|
||||
string tipTitle = (string)this.Resources["notifyIconTitle"];
|
||||
string tipContent = "The language pack \"" + LangName + "\" was not found, language has been automatically switched to English. You can submit this language on GitHub."; // 提示不支持语言提示
|
||||
ToolTipIcon tipType = ToolTipIcon.None;
|
||||
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
|
||||
}
|
||||
|
||||
if (hiderun == true && autoact == true)
|
||||
{
|
||||
this.Hide();
|
||||
|
||||
int tipShowMilliseconds = 0;
|
||||
string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
|
||||
string tipContent = "Running.";
|
||||
string tipTitle = (string)this.Resources["notifyIconTitle"]; //通知气泡标题
|
||||
string tipContent = (string)this.Resources["Running"]; //提示正在运行
|
||||
ToolTipIcon tipType = ToolTipIcon.None;
|
||||
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
|
||||
|
||||
@ -231,6 +336,55 @@ namespace CMWTAT_DIGITAL
|
||||
LoadOSList();
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查更新
|
||||
/// </summary>
|
||||
private void CheckUpdate()
|
||||
{
|
||||
try
|
||||
{
|
||||
string check_update_json = GetHttpWebRequest("https://cmwtat.cloudmoe.com/api/check_update?version=" + ProductVersion);
|
||||
JObject check_update_jsonobj = JObject.Parse(check_update_json);
|
||||
List<Frequency> check_update_list = new List<Frequency>();
|
||||
JValue latest_version = (JValue)check_update_jsonobj["latest"];
|
||||
JValue oldest_version = (JValue)check_update_jsonobj["oldest"];
|
||||
//System.Windows.MessageBox.Show(latest_version.ToString());
|
||||
Version CurrentVersion = new Version(ProductVersion);
|
||||
Version LatestVersion = new Version(latest_version.ToString());
|
||||
Version AllowedVersion = new Version(oldest_version.ToString());
|
||||
if (CurrentVersion >= LatestVersion) // 当前版本大于等于最新版本
|
||||
{
|
||||
//System.Windows.MessageBox.Show("无需更新");
|
||||
}
|
||||
if (CurrentVersion < LatestVersion) // 当前版本小于最新版本
|
||||
{
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
if (CurrentVersion < AllowedVersion) // 当前版本小于最低允许版本
|
||||
{
|
||||
this.IgnoreUpdate.IsEnabled = false;
|
||||
//System.Windows.MessageBox.Show("必须更新");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.IgnoreUpdate.IsEnabled = true;
|
||||
}
|
||||
this.DialogUpdateTitle.Text = (string)this.Resources["UpdateTitle"];
|
||||
this.DialogUpdateText.Text = (string)this.Resources["UpdateText"] + "\r\n" + (string)this.Resources["CurrentVersion"] + ": " + ProductVersion + "\r\n" + (string)this.Resources["LatestVersion"] + ": " + latest_version.ToString();
|
||||
this.DialogUpdate.IsOpen = true;
|
||||
}));
|
||||
//System.Windows.MessageBox.Show("需要更新");
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static string MainServerDomain = "https://cmwtat.cloudmoe.com"; // 主要服务器
|
||||
public static string BackupServerDomain = "https://kms.kumo.moe"; // 备用服务器
|
||||
|
||||
private void LoadOSList()
|
||||
{
|
||||
|
||||
@ -240,9 +394,21 @@ namespace CMWTAT_DIGITAL
|
||||
{
|
||||
DialogWait.IsOpen = true;
|
||||
}));
|
||||
|
||||
try
|
||||
{
|
||||
string json = GetHttpWebRequest("https://kms.kumo.moe/api/digital?list=1&ver=2");
|
||||
string json;
|
||||
try
|
||||
{
|
||||
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=1&ver=2"); // 主要服务器
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("MainServer:" + MainServerDomain + " is not working.");
|
||||
Console.WriteLine("Error Message:" + e.Message);
|
||||
Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain);
|
||||
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=1&ver=2"); // 备用服务器
|
||||
}
|
||||
JObject jsonobj = JObject.Parse(json);
|
||||
List<Frequency> list = new List<Frequency>();
|
||||
Frequency freq = new Frequency();
|
||||
@ -284,15 +450,15 @@ namespace CMWTAT_DIGITAL
|
||||
if (is_selected == 0)//没有匹配
|
||||
{
|
||||
this.SystemEditionText.SelectedIndex = 0;
|
||||
this.DialogWithOKToCloseDialogTitle.Text = "Attention";
|
||||
this.DialogWithOKToCloseDialogText.Text = "Unable to correctly identify your operating system edition, may be not be supported.\r\n(System edition: " + SystemEdition + OSVersionInfo.BuildVersion + ")";
|
||||
this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["Attention"];
|
||||
this.DialogWithOKToCloseDialogText.Text = (string)this.Resources["May_be_not_be_supported"] + "\r\n(" + (string)this.Resources["System_Edition"] + ": " + SystemEdition + OSVersionInfo.BuildVersion + ")";
|
||||
this.DialogWithOKToCloseDialog.IsOpen = true;
|
||||
}
|
||||
else if (is_selected == 2)//只找到实验性
|
||||
{
|
||||
this.SystemEditionText.SelectedIndex = 0;
|
||||
this.DialogWithOKToCloseDialogTitle.Text = "Attention";
|
||||
this.DialogWithOKToCloseDialogText.Text = "Only find experimental options that can be used with this operating system edition, little hope of activation success.\r\n(System edition: " + SystemEdition + OSVersionInfo.BuildVersion + ")";
|
||||
this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["Attention"];
|
||||
this.DialogWithOKToCloseDialogText.Text = (string)this.Resources["Only_find_experimental"] + "\r\n(" + (string)this.Resources["System_Edition"] + ": " + SystemEdition + OSVersionInfo.BuildVersion + ")";
|
||||
this.DialogWithOKToCloseDialog.IsOpen = true;
|
||||
}
|
||||
else
|
||||
@ -330,8 +496,8 @@ namespace CMWTAT_DIGITAL
|
||||
if (hiderun == true)
|
||||
{
|
||||
int tipShowMilliseconds = 0;
|
||||
string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
|
||||
string tipContent = "Your system edition may not be supported, program will exit. you can try add --expact or -e to startup.";
|
||||
string tipTitle = (string)this.Resources["notifyIconTitle"];
|
||||
string tipContent = (string)this.Resources["notify_May_be_not_be_supported_try"]; //提示不支持可尝试实验性
|
||||
ToolTipIcon tipType = ToolTipIcon.None;
|
||||
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
|
||||
Exit_Button_Click(null, null);//退出
|
||||
@ -342,8 +508,8 @@ namespace CMWTAT_DIGITAL
|
||||
if (hiderun == true)
|
||||
{
|
||||
int tipShowMilliseconds = 0;
|
||||
string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
|
||||
string tipContent = "Your system edition may not be supported, program will exit.";
|
||||
string tipTitle = (string)this.Resources["notifyIconTitle"];
|
||||
string tipContent = (string)this.Resources["notify_May_be_not_be_supported_exit"]; //提示不支持并退出(实验性开启)
|
||||
ToolTipIcon tipType = ToolTipIcon.None;
|
||||
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
|
||||
Exit_Button_Click(null, null);//退出
|
||||
@ -367,13 +533,14 @@ namespace CMWTAT_DIGITAL
|
||||
if (hiderun == true && autoact == true)
|
||||
{
|
||||
int tipShowMilliseconds = 0;
|
||||
string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
|
||||
string tipContent = "Unable to connect to server, program will exit.";
|
||||
string tipTitle = (string)this.Resources["notifyIconTitle"];
|
||||
string tipContent = (string)this.Resources["notify_Disconnect_to_server_exit"]; //提示无法连接服务器退出
|
||||
ToolTipIcon tipType = ToolTipIcon.None;
|
||||
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
|
||||
Exit_Button_Click(null, null);//退出
|
||||
}
|
||||
}
|
||||
CheckUpdate(); // 检查更新
|
||||
}
|
||||
private void Activate_Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
@ -394,7 +561,13 @@ namespace CMWTAT_DIGITAL
|
||||
installthread.Start();
|
||||
}
|
||||
|
||||
private string GetHttpWebRequest(string url)
|
||||
private string GetHttpWebRequest(string url, int timeout = 10000, int retry = 2)
|
||||
{
|
||||
string outex = "UnknowError";
|
||||
for (int i = 0; i < retry; i++) // 默认重试2次
|
||||
{
|
||||
Console.WriteLine("GetHttpWebRequest Try: " + i.ToString());
|
||||
try
|
||||
{
|
||||
Uri uri = new Uri(url);
|
||||
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(uri);
|
||||
@ -402,15 +575,31 @@ namespace CMWTAT_DIGITAL
|
||||
myReq.Accept = "*/*";
|
||||
myReq.KeepAlive = true;
|
||||
myReq.Headers.Add("Accept-Language", "zh-cn,en-us;q=0.5");
|
||||
HttpWebResponse result = (HttpWebResponse)myReq.GetResponse();
|
||||
myReq.Timeout = timeout; // 默认10s超时
|
||||
HttpWebResponse result = null;
|
||||
string strHTML = null;
|
||||
result = (HttpWebResponse)myReq.GetResponse();
|
||||
Stream receviceStream = result.GetResponseStream();
|
||||
StreamReader readerOfStream = new StreamReader(receviceStream, System.Text.Encoding.GetEncoding("utf-8"));
|
||||
string strHTML = readerOfStream.ReadToEnd();
|
||||
strHTML = readerOfStream.ReadToEnd();
|
||||
readerOfStream.Close();
|
||||
receviceStream.Close();
|
||||
result.Close();
|
||||
return strHTML;
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
outex = ex.Message;
|
||||
Console.WriteLine("GetHttpWebRequest Exception: " + ex.Message);
|
||||
if (ex.Status == WebExceptionStatus.Timeout) // 超时重试
|
||||
{
|
||||
continue;
|
||||
}
|
||||
throw new Exception(ex.Message); // 其他错误抛出
|
||||
}
|
||||
}
|
||||
throw new Exception(outex);
|
||||
}
|
||||
|
||||
private void Exit_Button_Click(object sender, EventArgs e)
|
||||
{
|
||||
@ -426,7 +615,7 @@ namespace CMWTAT_DIGITAL
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.DialogActProg.IsOpen = true;
|
||||
this.activatingtext.Text = "Converting";
|
||||
this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
|
||||
}));
|
||||
|
||||
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
|
||||
@ -455,14 +644,25 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Getting Key";
|
||||
this.activatingtext.Text = (string)this.Resources["RunInstall_Getting_Key"]; //提示正在获取密钥
|
||||
}));
|
||||
|
||||
//获取密钥和SKU
|
||||
try
|
||||
{
|
||||
|
||||
string json = GetHttpWebRequest("https://kms.kumo.moe/api/digital?list=0&ver=2");
|
||||
string json;
|
||||
try
|
||||
{
|
||||
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=2"); // 主要服务器
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("MainServer:" + MainServerDomain + " is not working.");
|
||||
Console.WriteLine("Error Message:" + e.Message);
|
||||
Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain);
|
||||
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=2"); // 备用服务器
|
||||
}
|
||||
JObject jsonobj = JObject.Parse(json);
|
||||
List<Frequency> list = new List<Frequency>();
|
||||
ositems = (JArray)jsonobj["OS"];
|
||||
@ -474,7 +674,7 @@ namespace CMWTAT_DIGITAL
|
||||
catch
|
||||
{
|
||||
code = "-0";
|
||||
msg = "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
|
||||
msg = (string)this.Resources["ErrorMsg-0"]; // "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
|
||||
goto EndLine;
|
||||
}
|
||||
}
|
||||
@ -493,7 +693,7 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Uninstalling old Key";
|
||||
this.activatingtext.Text = (string)this.Resources["RunInstall_Uninstalling_old_Key"]; //提示正在卸载旧密钥
|
||||
}));
|
||||
//卸载
|
||||
string runend = RunCScript(slmgr_self, "-upk").Trim();
|
||||
@ -503,7 +703,7 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Installing Key";
|
||||
this.activatingtext.Text = (string)this.Resources["RunInstall_Installing_Key"]; //提示正在安装密钥
|
||||
}));
|
||||
|
||||
//安装数字权利升级密钥
|
||||
@ -514,13 +714,13 @@ namespace CMWTAT_DIGITAL
|
||||
else
|
||||
{
|
||||
code = "-2";
|
||||
msg = "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
|
||||
msg = (string)this.Resources["ErrorMsg-2"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
code = "-1";
|
||||
msg = "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
|
||||
msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
|
||||
}
|
||||
//string runend = RunCScript(slmgr_self, "-upk").Trim();
|
||||
EndLine:;
|
||||
@ -529,10 +729,10 @@ namespace CMWTAT_DIGITAL
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.DialogActProg.IsOpen = false;
|
||||
this.activatingtext.Text = "Converting";
|
||||
this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
|
||||
this.DialogWithOKToCloseDialog.IsOpen = true;
|
||||
this.DialogWithOKToCloseDialogTitle.Text = "Error";
|
||||
this.DialogWithOKToCloseDialogText.Text = msg + "\r\nCode:" + code;
|
||||
this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["ErrorTitle"]; //错误标题
|
||||
this.DialogWithOKToCloseDialogText.Text = msg + "\r\n" + (string)this.Resources["ErrorCode"] + code; //错误代码 如:错误信息\r\nCode:000
|
||||
}));
|
||||
//MessageBox.Show(msg + "\r\nCode:" + code);
|
||||
}
|
||||
@ -541,10 +741,10 @@ namespace CMWTAT_DIGITAL
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.DialogActProg.IsOpen = false;
|
||||
this.activatingtext.Text = "Converting";
|
||||
this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
|
||||
this.DialogWithOKToCloseDialogDonate.IsOpen = true;
|
||||
this.DialogWithOKToCloseDialogDonateTitle.Text = "Complete";
|
||||
this.DialogWithOKToCloseDialogDonateText.Text = "\nCongratulation! \n\nWindows 10 has been successful converted.\n";
|
||||
this.DialogWithOKToCloseDialogDonateTitle.Text = (string)this.Resources["CompleteTitle"]; //完成标题
|
||||
this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextConverted"]; //完成转换内容
|
||||
}));
|
||||
//MessageBox.Show("Congratulation!");
|
||||
}
|
||||
@ -559,7 +759,7 @@ namespace CMWTAT_DIGITAL
|
||||
if (hiderun == true && autoact == true)
|
||||
{
|
||||
int tipShowMilliseconds = 0;
|
||||
string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
|
||||
string tipTitle = (string)this.Resources["notifyIconTitle"];
|
||||
string tipContent = this.activatingtext.Text;
|
||||
ToolTipIcon tipType = ToolTipIcon.None;
|
||||
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
|
||||
@ -574,7 +774,7 @@ namespace CMWTAT_DIGITAL
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.DialogActProg.IsOpen = true;
|
||||
this.activatingtext.Text = "Activating";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
|
||||
@ -606,7 +806,7 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Getting Key";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_Key"]; //提示正在获取密钥
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
|
||||
@ -614,7 +814,18 @@ namespace CMWTAT_DIGITAL
|
||||
try
|
||||
{
|
||||
|
||||
string json = GetHttpWebRequest("https://kms.kumo.moe/api/digital?list=0&ver=2");
|
||||
string json;
|
||||
try
|
||||
{
|
||||
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=2"); // 主要服务器
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine("MainServer:" + MainServerDomain + " is not working.");
|
||||
Console.WriteLine("Error Message:" + e.Message);
|
||||
Console.WriteLine("Ready to use BackupServer:" + BackupServerDomain);
|
||||
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=2"); // 备用服务器
|
||||
}
|
||||
JObject jsonobj = JObject.Parse(json);
|
||||
List<Frequency> list = new List<Frequency>();
|
||||
ositems = (JArray)jsonobj["OS"];
|
||||
@ -631,7 +842,7 @@ namespace CMWTAT_DIGITAL
|
||||
catch
|
||||
{
|
||||
code = "-0";
|
||||
msg = "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
|
||||
msg = (string)this.Resources["ErrorMsg-0"]; // "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
|
||||
goto EndLine;
|
||||
}
|
||||
|
||||
@ -649,7 +860,7 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Uninstalling old Key";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Uninstalling_old_Key"]; //提示正在卸载旧密钥
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
|
||||
@ -666,7 +877,7 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Getting edition code (Experimental)";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_edition_code_Exp"]; // "Getting edition code (Experimental)";
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
|
||||
@ -682,7 +893,7 @@ namespace CMWTAT_DIGITAL
|
||||
{
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Uninstalling old Key (Experimental)";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Uninstalling_old_Key_Exp"]; //提示正在卸载旧密钥(实验性)
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
|
||||
@ -692,7 +903,7 @@ namespace CMWTAT_DIGITAL
|
||||
{
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Prepare for the next step (Experimental)";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Prepare_for_the_next_step_Exp"]; // "Prepare for the next step (Experimental)";
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
}
|
||||
@ -700,14 +911,14 @@ namespace CMWTAT_DIGITAL
|
||||
else
|
||||
{
|
||||
code = "-1.2";
|
||||
msg = "无法获取版本代号 :(\nCannot to get edition code. :(";
|
||||
msg = (string)this.Resources["ErrorMsg-1.2"]; // "无法获取版本代号 :(\nCannot to get edition code. :(";
|
||||
goto EndLine;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
code = "-1.1";
|
||||
msg = "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
|
||||
msg = (string)this.Resources["ErrorMsg-1.1"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
|
||||
goto EndLine;
|
||||
}
|
||||
}
|
||||
@ -717,7 +928,7 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Writing feature of old Windows version";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Writing_old_OS"]; // "Writing feature of old Windows version";
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
|
||||
@ -728,7 +939,7 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Installing Key";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Installing_Key"]; //提示正在安装密钥
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
|
||||
@ -741,7 +952,7 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Getting free upgrade permissions";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_free_upgrade_permissions"]; // "Getting free upgrade permissions";
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
|
||||
@ -760,7 +971,7 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Cleaning changes";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Cleaning_changes"]; // "Cleaning changes";
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
|
||||
@ -769,20 +980,21 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Getting digital license";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_digital_license"]; // "Getting digital license";
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
|
||||
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
|
||||
Wow64EnableWow64FsRedirection(false); // 关闭文件重定向
|
||||
RunCMD(Environment.SystemDirectory + @"\ClipUp.exe -v -o -altto " + tempfile);
|
||||
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.activatingtext.Text = "Activating";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; // 提示激活中
|
||||
ShowBallSameDig();
|
||||
}));
|
||||
|
||||
runend = RunCScript(slmgr_self, "-ato").Trim();
|
||||
Console.WriteLine(runend);
|
||||
if (runend.EndsWith("060' to display the error text.") || runend.EndsWith("successfully.") || runend.EndsWith("to display the error text."))
|
||||
{
|
||||
code = "200";
|
||||
@ -790,25 +1002,25 @@ namespace CMWTAT_DIGITAL
|
||||
else
|
||||
{
|
||||
code = "-4";
|
||||
msg = "激活失败 :(\nActivation Failed. :(";
|
||||
msg = (string)this.Resources["ErrorMsg-4"] + "\r\n" + (string)this.Resources["SysMsg"] + "\r\n" + runend; // "激活失败 :(\nActivation Failed. :(";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
code = "-3";
|
||||
msg = "执行超时,可能没有选择正确或输入的版本 :(\nTime out, may be you choose or enter a incorrect version. :(";
|
||||
msg = (string)this.Resources["ErrorMsg-3"]; // "执行超时,可能没有选择正确或输入的版本 :(\nTime out, may be you choose or enter a incorrect version. :(";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
code = "-2";
|
||||
msg = "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
|
||||
msg = (string)this.Resources["ErrorMsg-2"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
code = "-1";
|
||||
msg = "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
|
||||
msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
|
||||
}
|
||||
//string runend = RunCScript(slmgr_self, "-upk").Trim();
|
||||
EndLine:;
|
||||
@ -817,14 +1029,14 @@ namespace CMWTAT_DIGITAL
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.DialogActProg.IsOpen = false;
|
||||
this.activatingtext.Text = "Activating";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
|
||||
this.DialogWithOKToCloseDialog.IsOpen = true;
|
||||
this.DialogWithOKToCloseDialogTitle.Text = "Error";
|
||||
this.DialogWithOKToCloseDialogText.Text = msg + "\r\nCode:" + code;
|
||||
this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["ErrorTitle"]; //错误标题
|
||||
this.DialogWithOKToCloseDialogText.Text = msg + "\r\n" + (string)this.Resources["ErrorCode"] + code; //错误代码 如:错误信息\r\nCode:000
|
||||
if (hiderun == true && autoact == true)
|
||||
{
|
||||
int tipShowMilliseconds = 0;
|
||||
string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
|
||||
string tipTitle = (string)this.Resources["notifyIconTitle"];
|
||||
string tipContent = msg;
|
||||
ToolTipIcon tipType = ToolTipIcon.None;
|
||||
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
|
||||
@ -838,15 +1050,15 @@ namespace CMWTAT_DIGITAL
|
||||
actbtn.Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
this.DialogActProg.IsOpen = false;
|
||||
this.activatingtext.Text = "Activating";
|
||||
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
|
||||
this.DialogWithOKToCloseDialogDonate.IsOpen = true;
|
||||
this.DialogWithOKToCloseDialogDonateTitle.Text = "Complete";
|
||||
this.DialogWithOKToCloseDialogDonateText.Text = "\nCongratulation! \n\nWindows 10 has been successful activated.\n";
|
||||
this.DialogWithOKToCloseDialogDonateTitle.Text = (string)this.Resources["CompleteTitle"]; //完成标题
|
||||
this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextActivated"]; //完成转换内容
|
||||
if (hiderun == true && autoact == true)
|
||||
{
|
||||
int tipShowMilliseconds = 0;
|
||||
string tipTitle = "CloudMoe Windows 10 Activation Toolkit V2";
|
||||
string tipContent = "Congratulation!\nWindows 10 has been successful activated.";
|
||||
string tipTitle = (string)this.Resources["notifyIconTitle"];
|
||||
string tipContent = this.DialogWithOKToCloseDialogDonateText.Text;
|
||||
ToolTipIcon tipType = ToolTipIcon.None;
|
||||
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
|
||||
Exit_Button_Click(null, null);
|
||||
@ -936,7 +1148,7 @@ namespace CMWTAT_DIGITAL
|
||||
|
||||
private void Donate_Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://waxel.cloudmoe.com/donate/");
|
||||
System.Diagnostics.Process.Start("https://cmwtat.cloudmoe.com/donate"); // 打开捐赠页
|
||||
this.DialogWithOKToCloseDialogDonate.IsOpen = false;
|
||||
}
|
||||
|
||||
@ -955,6 +1167,38 @@ namespace CMWTAT_DIGITAL
|
||||
last_key = SystemEditionTextInput.Text;
|
||||
SystemEditionTextInput.SelectionStart = SystemEditionTextInput.Text.Length;
|
||||
}
|
||||
UpdateInputMatch(); // 更新按钮启用状态
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证产品密钥字符串是否匹配正则表达式描述的规则并更新按钮状态(如果自动模式则启用按钮)
|
||||
/// </summary>
|
||||
private void UpdateInputMatch()
|
||||
{
|
||||
//防止初始化前访问null出错
|
||||
try
|
||||
{
|
||||
string pattern = @"^[a-zA-Z0-9]{5}-[a-zA-Z0-9]{5}-[a-zA-Z0-9]{5}-[a-zA-Z0-9]{5}-[a-zA-Z0-9]{5}$";
|
||||
if (is_auto == false)
|
||||
{
|
||||
if (CMWTAT_DIGITAL.Domain.IsSN.IsMatch((SystemEditionTextInput.Text ?? "").ToString(), pattern))
|
||||
{
|
||||
actbtn.IsEnabled = true;
|
||||
installbtn.IsEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
actbtn.IsEnabled = false;
|
||||
installbtn.IsEnabled = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
actbtn.IsEnabled = true;
|
||||
installbtn.IsEnabled = true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void A_RadioButton_Checked(object sender, RoutedEventArgs e)
|
||||
@ -962,6 +1206,7 @@ namespace CMWTAT_DIGITAL
|
||||
SystemEditionText.Visibility = Visibility.Visible;
|
||||
SystemEditionTextInput.Visibility = Visibility.Hidden;
|
||||
is_auto = true;
|
||||
UpdateInputMatch(); // 更新按钮启用状态
|
||||
}
|
||||
|
||||
private void M_RadioButton_Checked(object sender, RoutedEventArgs e)
|
||||
@ -969,6 +1214,7 @@ namespace CMWTAT_DIGITAL
|
||||
SystemEditionText.Visibility = Visibility.Hidden;
|
||||
SystemEditionTextInput.Visibility = Visibility.Visible;
|
||||
is_auto = false;
|
||||
UpdateInputMatch(); // 更新按钮启用状态
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
@ -976,5 +1222,10 @@ namespace CMWTAT_DIGITAL
|
||||
DelectTempFile();
|
||||
notifyIcon.Visible = false;
|
||||
}
|
||||
|
||||
private void UpdateBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://cmwtat.cloudmoe.com"); // 打开官网
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,5 +51,5 @@ using System.Windows;
|
||||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.2.0.1")]
|
||||
[assembly: AssemblyFileVersion("2.2.0.1")]
|
||||
[assembly: AssemblyVersion("2.3.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.3.0.0")]
|
||||
|
2
CMWTAT_DIGITAL/Properties/Settings.Designer.cs
generated
2
CMWTAT_DIGITAL/Properties/Settings.Designer.cs
generated
@ -12,7 +12,7 @@ namespace CMWTAT_DIGITAL.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
@ -1,3 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user