Repository: TGSAN/CMWTAT_Digital_Edition
Branch: master
Commit: 2bab2dfd5734
Files: 34
Total size: 242.7 KB
Directory structure:
gitextract_3jvuoj2b/
├── .gitattributes
├── .github/
│ └── ISSUE_TEMPLATE/
│ └── bug_report.md
├── .gitignore
├── CDNDirectRun.ps1
├── CMWTAT_DIGITAL/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── CMWTAT_DIGITAL.csproj
│ ├── Domain/
│ │ ├── IsSN.cs
│ │ ├── NotifyPropertyChangedExtension.cs
│ │ └── ViewModel.cs
│ ├── FodyWeavers.xml
│ ├── Lang/
│ │ ├── en.xaml
│ │ ├── fr.xaml
│ │ ├── ja.xaml
│ │ ├── ru.xaml
│ │ └── zh.xaml
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── OSVersionInfoClass.cs
│ ├── Properties/
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── app.config
│ ├── app.manifest
│ └── packages.config
├── CMWTAT_DIGITAL.sln
├── DirectRun.ps1
├── LICENSE
├── README.en.md
├── README.md
├── README.zh.md
└── _config.yml
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
# Auto detect text files and perform LF normalization
* text=auto
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**PC Information (please complete the following information):**
- CPU Arch: [e.g. x86/x64/ARM64]
- Windows Version: [e.g. Windows 10 10.0.10240.0]
- Original SKU: [e.g. Home/Pro/Education etc.]
- Target SKU: [e.g. Home/Pro/Education etc.]
- Version [e.g. 2.6.2.0]
**Additional context**
Add any other context about the problem here.
================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
================================================
FILE: CDNDirectRun.ps1
================================================
$isAdmin = (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) {
Start-Process powershell -ArgumentList "irm https://fastly.jsdelivr.net/gh/TGSAN/CMWTAT_Digital_Edition/CDNDirectRun.ps1 | iex" -Verb RunAs
Exit
}
# $exePath = ".\CMWTAT_DIGITAL\bin\Debug\CMWTAT_DIGITAL.exe"
# $exeBytes = [System.IO.File]::ReadAllBytes($exePath)
# $bytes = $exeBytes
$bytes = (Invoke-WebRequest "https://release-download.static.cloudmoe.com/TGSAN/CMWTAT_Digital_Edition/releases/download/2.7.2.0/CMWTAT_Digital_Release_2_7_2_0.exe").Content
$assembly = [System.Reflection.Assembly]::Load($bytes)
$entryPointMethod = $assembly.EntryPoint
$entryPointMethod.Invoke($null, @())
================================================
FILE: CMWTAT_DIGITAL/App.xaml
================================================
================================================
FILE: CMWTAT_DIGITAL/App.xaml.cs
================================================
using System;
using System.Windows;
namespace CMWTAT_DIGITAL
{
///
/// App.xaml 的交互逻辑
///
public partial class App : Application
{
public static bool autoact = false;
public static bool hiderun = false;
public static bool expact = false;
public static bool log2file = false;
public static bool showhelp = false;
protected override void OnStartup(StartupEventArgs e)
{
foreach (string arg in e.Args)
{
Console.WriteLine("arg: " + arg);
if (arg == "-a" || arg == "--auto")
{
Console.WriteLine("AUTO: True");
autoact = true;
}
if (arg == "-h" || arg == "--hide")
{
Console.WriteLine("HIDE: True");
hiderun = true;
}
if (arg == "-e" || arg == "--expact")
{
Console.WriteLine("EXPACT: True");
expact = true;
}
if (arg == "-l" || arg == "--log")
{
Console.WriteLine("LOG: True");
log2file = true;
}
if (arg == "-?" || arg == "--help")
{
Console.WriteLine("SHOWHELP: True");
showhelp = true;
}
}
base.OnStartup(e);
}
}
}
================================================
FILE: CMWTAT_DIGITAL/CMWTAT_DIGITAL.csproj
================================================
10.0.10240.0
Debug
AnyCPU
{961DE925-B82C-4515-8FBD-6805E36D1212}
WinExe
CMWTAT_DIGITAL
CMWTAT_DIGITAL
v4.5.2
512
{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
4
publish\
true
Disk
false
Foreground
7
Days
false
false
true
0
1.0.0.%2a
false
false
true
AnyCPU
true
full
false
bin\Debug\
DEBUG;TRACE
prompt
4
false
AnyCPU
pdbonly
true
bin\Release\
TRACE
prompt
4
false
app.manifest
CMWTAT.ico
..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll
..\packages\MaterialDesignColors.2.0.6\lib\net452\MaterialDesignColors.dll
..\packages\MaterialDesignThemes.4.5.0\lib\net452\MaterialDesignThemes.Wpf.dll
..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll
4.0
MSBuild:Compile
Designer
Designer
MSBuild:Compile
MSBuild:Compile
Designer
MSBuild:Compile
Designer
MSBuild:Compile
Designer
Designer
MSBuild:Compile
MSBuild:Compile
Designer
App.xaml
Code
MainWindow.xaml
Code
Code
True
True
Resources.resx
True
Settings.settings
True
ResXFileCodeGenerator
Resources.Designer.cs
Designer
Designer
SettingsSingleFileGenerator
Settings.Designer.cs
False
.NET Framework 3.5 SP1
false
这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。
================================================
FILE: CMWTAT_DIGITAL/Domain/IsSN.cs
================================================
using System.Globalization;
using System.Text.RegularExpressions;
using System.Windows.Controls;
namespace CMWTAT_DIGITAL.Domain
{
class IsSN : ValidationRule
{
#region 匹配方法
///
/// 验证字符串是否匹配正则表达式描述的规则
///
/// 待验证的字符串
/// 正则表达式字符串
/// 是否匹配
public static bool IsMatch(string inputStr, string patternStr)
{
return IsMatch(inputStr, patternStr, false, false);
}
///
/// 验证字符串是否匹配正则表达式描述的规则
///
/// 待验证的字符串
/// 正则表达式字符串
/// 匹配时是否不区分大小写
/// 是否匹配
public static bool IsMatch(string inputStr, string patternStr, bool ifIgnoreCase)
{
return IsMatch(inputStr, patternStr, ifIgnoreCase, false);
}
///
/// 验证字符串是否匹配正则表达式描述的规则
///
/// 待验证的字符串
/// 正则表达式字符串
/// 匹配时是否不区分大小写
/// 是否验证空白字符串
/// 是否匹配
public static bool IsMatch(string inputStr, string patternStr, bool ifIgnoreCase, bool ifValidateWhiteSpace)
{
if (!ifValidateWhiteSpace && string.IsNullOrEmpty(inputStr))
return false;//如果不要求验证空白字符串而此时传入的待验证字符串为空白字符串,则不匹配
Regex regex = null;
if (ifIgnoreCase)
regex = new Regex(patternStr, RegexOptions.IgnoreCase);//指定不区分大小写的匹配
else
regex = new Regex(patternStr);
return regex.IsMatch(inputStr);
}
#endregion
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
{
//Console.WriteLine("\""+value+"\"");
//return string.IsNullOrWhiteSpace((value ?? "").ToString())
// ? new ValidationResult(false, "Key is required.")
// : ValidationResult.ValidResult;
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 (IsMatch((value ?? "").ToString(), pattern))
{
return ValidationResult.ValidResult;
}
else if (string.IsNullOrWhiteSpace((value ?? "").ToString()))
{
return new ValidationResult(false, "Please enter the key for the current edition.");
}
else
{
return new ValidationResult(false, "Invalid format.");
}
}
}
}
================================================
FILE: CMWTAT_DIGITAL/Domain/NotifyPropertyChangedExtension.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace CMWTAT_DIGITAL.Domain
{
public static class NotifyPropertyChangedExtension
{
public static void MutateVerbose(this INotifyPropertyChanged instance, ref TField field, TField newValue, Action raise, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer.Default.Equals(field, newValue)) return;
field = newValue;
raise?.Invoke(new PropertyChangedEventArgs(propertyName));
}
}
}
================================================
FILE: CMWTAT_DIGITAL/Domain/ViewModel.cs
================================================
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
namespace CMWTAT_DIGITAL.Domain
{
class ViewModel : INotifyPropertyChanged
{
private string _sn;
public ViewModel()
{
LongListToTestComboVirtualization = new List(Enumerable.Range(0, 1000));
}
public string SN
{
get { return _sn; }
set
{
this.MutateVerbose(ref _sn, value, RaisePropertyChanged());
}
}
public IList LongListToTestComboVirtualization { get; }
public event PropertyChangedEventHandler PropertyChanged;
private Action RaisePropertyChanged()
{
return args => PropertyChanged?.Invoke(this, args);
}
}
}
================================================
FILE: CMWTAT_DIGITAL/FodyWeavers.xml
================================================
================================================
FILE: CMWTAT_DIGITAL/Lang/en.xaml
================================================
Roboto
OK
Cancel
Refuse
Thanks developer and donate a dinner
Exit
Update Now
Ignore
CMWTAT Digital Edition
CMWTAT Digital Edition V2
A new version available!
Upgrade to full version of Windows
Current Version
Latest Version
Auto Mode
Manual Mode
Activate
Convert versions (Install Key without Activate)
Upgrade to full version of Windows
Test Text
Loading
Activating
Complete
CloudMoe Windows 10+ Activation Toolkit V2
Running.
Experimental
Attention
System edition
Unable to correctly identify your operating system edition in support list, may be not be supported.
Only found experimental options that can be used with this operating system edition, little hope of activation success.
Your system edition may not be supported, program will exit. you can try add --expact or -e to startup.
Your system edition may not be supported, program will exit.
Unable to connect to server, Please check the network and try to try again later, program will exit.
Unable to connect to server, Please check the network and try to try again later, program will exit.
Converting
Activating
Getting Key via Internet
Getting Key via Internet
Uninstalling old Key
Uninstalling old Key
Uninstalling old Key (Experimental)
Installing Key
Installing Key
Getting edition code (Experimental)
Prepare for the next step (Experimental)
Writing feature of old Windows version
Getting free upgrade permissions
Cleaning changes
Getting digital license
Upgrading
Complete
Error
Code:
System return:
You are currently using the core version of Windows, you can use this feature to upgrade to the full version of Windows.
(If the operation does not respond it may be that the current version does not support the upgrade or is in the process of upgrading)
Note:
This operation is not reversible and once the upgrade is complete you will not be able to roll back to the core version of Windows!
Are you sure you want to perform an upgrade?
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.
-l --log Output log to file.
-? --help Show this help Dialog.
Congratulation!
Windows has been successful converted.
Congratulation!
Windows has been successful activated.
We found a new version for CloudMoe Windows 10+ Activation Toolkit Digital Edition.
Please update to the latest version to make sure it works.
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.
Activate Windows requires a network to gets the product key :)
Cannot to uninstall old key. :(
Cannot to install key, may be you choose or enter a incorrect version. :(
Cannot to get edition code. :(
Cannot to install key, may be you choose or enter a incorrect version. :(
Time out, may be you choose or enter a incorrect version. :(
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.
Only found Long-Term Offline KMS (LTOK) options that can be used with this operating system edition.
This means that it will not be activate automatically after you reinstalled the system.
But don't worry, this is different from the legacy KMS activation method (it can keep activating for 180 days in offline environment).
LTOK (The prefix is Offline-KMS) can keep activating for up to 2038 even it is without networking!
Congratulation!
Windows is ready to activate.
However, it seems that Windows cannot connect to the Microsoft Activation Server.
Your system will be activated automatically the next time the server is connected.
================================================
FILE: CMWTAT_DIGITAL/Lang/fr.xaml
================================================
Roboto
Ok
Annuler
Refuser
Remerciez les développeurs et offrez leurs un café
Sortir
Mettre à jour maintenant
Ignorer
CMWTAT Edition numérique
CMWTAT Edition numérique V2
Une nouvelle version disponible !
Version actuelle
Dernière version
Mode automatique
Mode manuel
Activer
Convertir la versions (Installer la clé sans l'activer)
Texte de test
Chargement
Activation
Terminé
CloudMoe Windows 10+ Activation Toolkit V2
En cours d'exécution.
Expérimental
Attention
Version du système
La version de votre système d'exploitation n'est pas identifiable, il se peut qu'il ne soit pas supporté.
Seules des options expérimentales peuvent être utilisées avec cette édition du système d'exploitation. Il y a peu d'espoir de succès d'activation.
La version de votre système peut ne pas être supportée, le programme se terminera automatiquement. Vous pouvez essayer d'ajouter --expact ou -e au démarrage.
La version de votre système peut ne pas être prise en charge, le programme va se fermer.
Impossible de se connecter au serveur, Veuillez vérifier le réseau et réessayer plus tard, le programme va se fermer.
Impossible de se connecter au serveur, Veuillez vérifier le réseau et réessayer plus tard, le programme va se fermer.
Conversion
Activation
Obtention de la clé par Internet
Obtention de la clé par Internet
Suppression de l'ancienne clé
Suppression de l'ancienne clé
Suppression de l'ancienne clé (Experimental)
Installation de la clé
Installation de la clé
Obtenir le code version (Experimental)
Préparation à l'étape suivante (Experimental)
Écriture d'une ancienne version de Windows
Obtention des autorisations gratuite de mise à niveau
Nettoyage des changements
Obtention d'une licence numérique
Terminé
Erreur
Code:
Le système à retourné:
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.
-l --log Output log to file.
-? --help Show this help Dialog.
Congratulation!
Windows has been successful converted.
Congratulation!
Windows has been successful activated.
We found a new version for CloudMoe Windows 10+ Activation Toolkit Digital Edition.
Please update to the latest version to make sure it works.
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.
Activate Windows requires a network to gets the product key :)
Cannot to uninstall old key. :(
Cannot to install key, may be you choose or enter a incorrect version. :(
Cannot to get edition code. :(
Cannot to install key, may be you choose or enter a incorrect version. :(
Time out, may be you choose or enter a incorrect version. :(
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.
Only found Long-Term Offline KMS (LTOK) options that can be used with this operating system edition.
This means that it will not be activate automatically after you reinstalled the system.
But don't worry, this is different from the legacy KMS activation method (it can keep activating for 180 days in offline environment).
LTOK (The prefix is Offline-KMS) can keep activating for up to 2038 even it is without networking!
Congratulation!
Windows is ready to activate.
However, it seems that Windows cannot connect to the Microsoft Activation Server.
Your system will be activated automatically the next time the server is connected.
================================================
FILE: CMWTAT_DIGITAL/Lang/ja.xaml
================================================
Yu Gothic UI
はい
キャンセル
リフューズ
寄付します
終了
今すぐアップデート
無視する
雲萌 10+ デジタルライセンス認証アプリ
CMWTAT Digital Edition V2
新しいバージョンがあります!
Upgrade to full version of Windows
バージョン
ラストバージョン
オートモード
マニュアルモード
認証
エディション変換 (キーをインストールするが、認証しません)
Upgrade to full version of Windows
テストテキスト
ローディング
認証中
コンプリート
雲萌 Windows 10+ 認証アプリ V2
実行中。
実験性
注意
システムエディション
あなたのシステムエディションが判別できません、対応していないかもしれません。
このシステムエディションに実験性オプションしか取れません、認証成功の可能性は極めて低い。
あなたのシステムエディションは対応していないかもしれません。アプリは終了する。試して、--expactまたは-eを追加することでアプリ起動してください。
あなたのシステムエディションは対応していないかもしれません。アプリは終了する。
サーバーに接続できません、インターネット接続を確認するまたは後で試してください、アプリは終了します。
サーバーに接続できません、インターネット接続を確認するまたは後で試してください、アプリは終了します。
変換中
ライセンス認証中
インターネットを通じてキーを取得しています
インターネットを通じてキーを取得しています
以前のキーをアンインストールしています
以前のキーをアンインストールしています
以前のキーをアンインストールしています(実験性)
キーをインストールしています
キーをインストールしています
エディションコードを取得中(実験性)
次のステップに準備しています(実験性)
旧システムの特徴を書き込み中
無償アップグレード権限を取得中
変更がクリーンアップされます
デジタルライセンスを取得中
Upgrading
コンプリート
エラー
コード:
システムメッセージ:
You are currently using the core version of Windows, you can use this feature to upgrade to the full version of Windows.
(If the operation does not respond it may be that the current version does not support the upgrade or is in the process of upgrading)
Note:
This operation is not reversible and once the upgrade is complete you will not be able to roll back to the core version of Windows!
Are you sure you want to perform an upgrade?
このアプリは起動時にコンソール引数を使用できるようになりました!
-a --auto 自動認証。
-h --hide 非表示モードで実行 (-autoと一緒に使用するだけ可能)。
-e --expact 実験性認証。
-l --log ログをファイルに出力。
-? --help この説明ダイアログボックスを表示する。
おめでとう!
Windows エディション変換成功。
おめでとう!
Windows 認証成功。
雲萌 Windows 10+ デジタルライセンス認証アプリの新しいバージョン発見しました。
最新バージョンにアップデートしてください。
雲萌 Windows 10+ デジタルライセンス認証アプリの新しいバージョン発見しました。
アプリが古すぎるため、最新バージョンにアップデートしてから利用ください。
Windows ライセンス認証にはインターネットを通じてキーを取得する必要があります :)
以前のキーをアンインストールできません :(
キーをインストールできません、選択または入力されたエディションが間違っているかもしれません :(
エディションコードを取得できません :(
キーをインストールできません、選択または入力されたエディションが間違っているかもしれません :(
タイムアウト,選択または入力されたエディションが間違っているかもしれません :(
認証失敗。 :(
多分:
1. このエディション/バージョンの Windows はデジタルライセンス認証が適用しない。
2. マイクロソフトの認証サーバーに接続できません。
3. その他。
暫くお待ちくださいまたはあとでもう一度やり直してください。
このシステムエディションに適用されたのは長期オフラインKMS(LTOK)オプションしか見つかりません。これによってシステムを再インストールした時自動的にライセンス認証しませんが、心配する必要はありません。この方法(LTOK)でライセンス認証後、インターネット接続なしでも2038年まで稼働を継続できます!
おめでとうございます!
Windowsはライセンス認証の準備が出来ています。
でも、マイクロソフトのライセンス認証サーバーに接続できませんみたいです。
システムは認証サーバーに接続出来る次第に自動的にライセンス認証します。
================================================
FILE: CMWTAT_DIGITAL/Lang/ru.xaml
================================================
Roboto
ОК
Отменить
Отказаться
Поблагодарить и поддержать разработчика
Выйти
Обновить сейчас
Игнорировать
CMWTAT Digital Edition
CMWTAT Digital Edition V2
Доступна новая версия!
Перейти на полную версию Windows
Текущая версия
Последняя версия
Авто
Вручную
Активировать
Конвертировать версии (установить ключ без активации)
Перейти на полную версию Windows
тест текст
Загрузка
Активация
Готово
CloudMoe Windows 10+ Activation Toolkit V2
Работает
Экспериментальный
Внимание
Версия системы
Версия вашей системы не найдена. Возможно, она не поддерживается.
Найдены только экспериментальные варианты для вашей системы. Скорее всего, активация завершится неудачей.
Версия вашей системы может не поддерживаться, программа завершает свою работу. Попробуйте добавить --expact или -e в качестве аргумента для запуска.
Версия вашей системы может не поддерживаться, программа завершает свою работу.
Невозможно подключиться к серверу, проверьте подключение к интернету или попробуйте позже, программа завершает свою работу.
Невозможно подключиться к серверу, проверьте подключение к интернету или попробуйте позже, программа завершает свою работу.
Конвертирую
Активация
Получаю ключ через интернет
Получаю ключ через интернет
Удаляю старый ключ
Удаляю старый ключ
Удаляю старый ключ (Экспериментальный)
Устанавливаю ключ
Устанавливаю ключ
Получаю код версии (Экспериментальный)
Подготовка к следующему шагу (Экспериментальный)
Записываю возможности старой версии системы
Получаю разрешения на бесплатное обновление
Очищаю изменения
Получаю цифровую лицензию
Обновляю
Готово
Ошибка
Код:
Сообщение системы:
Вы используете базовую версию Windows, Вы можете использовать эту функцию, чтобы перейти на полную версию.
(Если программа не отвечает, Ваша версия системы может не поддерживать переход на полную версию или уже в процессе перехода)
Note:
Данное действие необратимо. После перехода на полную версию Вы не сможете перейти обратно!
Вы хотите продолжить?
Эта программа теперь поддерживает аргументы командной строки при запуске!
-a --auto Автоматическая активация.
-h --hide Запустить в скрытом режиме (Работает только с --auto).
-e --expact Экспериментальная активация.
-l --log Вывод логов в файл.
-? --help Показать эту справку.
Поздравляю!
Windows была успешно конвертирована.
Поздравляю!
Windows была успешно активирована.
Была найдена новая версия CloudMoe Windows 10+ Activation Toolkit Digital Edition.
Пожалуйста, обновите программу для полной поддержки.
Было найдено обязательное обновление CloudMoe Windows 10+ Activation Toolkit Digital Edition.
Программа не будет работать без этого обновления.
При активации Windows требуется подключение к сети (для получения ключа) :)
Не удалось удалить старый ключ. :(
Не удалось установить ключ. Может, вы выбрали или ввели неправильную версию системы?
Не удалось получить код версии. :(
Не удалось установить ключ. Может, вы выбрали или ввели неправильную версию системы?
Превышено время. Может, вы выбрали или ввели неправильную версию системы?
Активация не выполнена. :(
Возможно:
1.Эта версия Windows не поддерживает активацию цифровым ключом.
2. Невозможно подключиться к серверу активации Microsoft Activation Server.
3. Другие неизвестные ошибки.
Вы можете попробовать еще раз позже.
Найдены только Long-Term Offline KMS (LTOK) варианты, которые можно использовать с текущей версией системы.
Это значит, что при переустановке системы, Вам надо будет активировать ее заново.
Не волнуйтесь, это не вариант активации legacy KMS, который может продолжать активироваться в течение 180 дней в оффлайн режиме.
LTOK (Префикс Offline-KMS) может продолжать активироваться до 2038 года даже без подключения к сети!
Поздравляю!
Windows готова к активации.
Но похоже, что Windows не может подключиться к серверу активации Microsoft Activation Server.
Ваша система будет активирована автоматически при следующем подключении к Microsoft Activation Server.
================================================
FILE: CMWTAT_DIGITAL/Lang/zh.xaml
================================================
Microsoft YaHei UI
好
取消
丑拒
请顿晚饭,感谢作者
退出
立即更新
忽略
云萌 Windows 10+ 数字权利激活工具
CMWTAT Digital Edition V2
新版本可用!
升级到完整版 Windows
当前版本
最新版本
自动模式
手动模式
激活
版本无缝转换 (安装产品密钥而不激活)
升级到完整版 Windows
测试文本
载入中
激活中
完成
云萌 Windows 10+ 激活工具 V2
运行中。
实验性
注意
系统版本
无法在支持列表里识别您的操作系统版本,可能不受支持。
只找到用于此版本系统的实验性选项,成功概率极低。
你的系统版本可能不受支持,程序即将退出。不过你可以尝试添加 --expact 或者 -e 参数来启动。
你的系统版本可能不受支持,程序即将退出。
无法连接服务器,请检查网络并尝试稍后重试,程序即将退出。
无法连接服务器,请检查网络并尝试稍后重试,程序即将退出。
转换中
激活中
正在通过网络获取产品密钥
正在通过网络获取产品密钥
正在卸载旧的产品密钥
正在卸载旧的产品密钥
正在卸载旧的产品密钥(实验性)
正在安装产品密钥
正在安装产品密钥
正在获取版本代号(实验性)
正在准备下一步(实验性)
正在写入旧系统残留特征
正在获取免费升级许可
正在清理更改
正在获取数字许可证
正在升级
完成
错误
代码:
系统返回:
当前正在使用核心版 Windows,你可以通过此功能升级到完整版 Windows。
(如果操作没有反应可能是当前版本不支持升级,或者正在升级)
注意:
此操作不可逆,一旦升级完成将无法回退到核心版 Windows!
确定要执行升级操作吗?
这个应用现已支持通过控制台参数启动!
-a --auto 自动激活。
-h --hide 隐藏模式运行 (只能与 -auto 一起使用)。
-e --expact 实验性激活。
-l --log 输出日志到文件。
-? --help 显示此说明对话框。
祝贺!
Windows 已经成功转换。
祝贺!
Windows 已经成功激活。
我们发现了新版本的 云萌 Windows 10+ 数字权利激活工具。
请更新到最新版本来确保它可以正常工作。
我们发现了新版本的 云萌 Windows 10+ 数字权利激活工具。
由于您的版本太旧,所以您必须更新到最新版本来确保它可以正常工作。
激活 Windows 需要网络获取产品密钥 :)
无法卸载旧密钥 :(
无法安装密钥,可能没有选择或输入正确的版本 :(
无法获取版本代号 :(
无法安装密钥,可能没有选择或输入正确的版本 :(
执行超时,可能没有选择正确或输入的版本 :(
激活失败。 :(
可能因为:
1. 此版本/类型的 Windows 不支持数字权利(数字许可证)方式激活。
2. 无法连接到微软Windows激活服务器。
3. 其它未知问题。
你可以尝试稍等片刻或者稍后重试。
只找到用于此版本系统的长期离线KMS(批量激活)选项。
这表示您将不能在下次重装系统后自动激活。
不过无需担心,这不同于传统的KMS激活方式(离线状态下可以保持激活180天)
长期离线KMS(Offline-KMS)即使不联网也可以保持激活值2038年!
祝贺!
Windows 已经快要激活成功了。
不过似乎Windows无法连接到微软激活服务器,
当下次连接上服务器时系统将会自动激活。
================================================
FILE: CMWTAT_DIGITAL/MainWindow.xaml
================================================
Title
Text
================================================
FILE: CMWTAT_DIGITAL/MainWindow.xaml.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Net;
using System.IO;
using System.Threading;
using Microsoft.Win32;
using System.Text.RegularExpressions;
using System.Globalization;
using System.Reflection;
using System.Windows.Forms;
using OSVersionInfoClass;
using Newtonsoft.Json.Linq;
using MaterialDesignThemes.Wpf;
namespace CMWTAT_DIGITAL
{
static class Constants
{
public const string DefaultLang = "en"; // 缺省语言
}
///
/// MainWindow.xaml 的交互逻辑
///
public partial class MainWindow : Window
{
[DllImport("Kernel32.dll")]
private static extern bool Wow64EnableWow64FsRedirection(bool Wow64FsEnableRedirection);//重定向
public struct Frequency
{
public int ID { get; set; }
public string DisplayOS { get; set; }
}
public static void ConsoleLog(string log_text = "")
{
Console.WriteLine(log_text);
if (App.log2file == true)
{
WriteLog(log_text);
}
}
public static void WriteLog(string strLog)
{
string sFilePath = AppDomain.CurrentDomain.BaseDirectory;
string sFileName = "CMWTAT-" + DateTime.Now.ToString("yyyy-MM-dd") + ".log";
sFileName = sFilePath + sFileName; //文件的绝对路径
if (!Directory.Exists(sFilePath))//验证路径是否存在
{
Directory.CreateDirectory(sFilePath);
//不存在则创建
}
FileStream fs;
StreamWriter sw;
if (File.Exists(sFileName))
//验证文件是否存在,有则追加,无则创建
{
fs = new FileStream(sFileName, FileMode.Append, FileAccess.Write);
}
else
{
fs = new FileStream(sFileName, FileMode.Create, FileAccess.Write);
}
sw = new StreamWriter(fs);
sw.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + " --- " + strLog);
sw.Close();
fs.Close();
}
string tempfile = Path.GetTempPath() + @"CMWTAT_DIGITAL\";
public void DelectTempFile()
{
if (Directory.Exists(tempfile))
{
try
{
FileAttributes attr = File.GetAttributes(tempfile);
if (attr == FileAttributes.Directory)
{
Directory.Delete(tempfile, true);
}
else
{
File.Delete(tempfile);
}
}
catch (Exception e)
{
ConsoleLog("DelectTempFile:" + e.Message);
}
}
}
public void ExportTempFile()
{
if (Directory.Exists(tempfile))
{
ConsoleLog("找到已存在的缓存,开始删除");
DelectTempFile();
ConsoleLog("删除操作完毕");
if (Directory.Exists(tempfile))
{
ConsoleLog("[警告] 检测到文件依旧存在");
}
}
ConsoleLog("开始创建缓存目录");
if (Directory.Exists(tempfile) == false)
{
Directory.CreateDirectory(tempfile);
}
ConsoleLog("创建缓存目录完毕");
ConsoleLog("开始写入缓存文件");
File.WriteAllBytes(tempfile + "ClipUp" + ".exe", Properties.Resources.ClipUp);
File.WriteAllBytes(tempfile + "slmgr" + ".vbs", Properties.Resources.slmgr);
ConsoleLog("写入缓存文件完毕");
}
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;
///
/// 加载指定语言(支持热加载)
///
public void LoadLang(string LangName = Constants.DefaultLang)
{
//MessageBox.Show(currentCultureInfo.Name);
try
{
//根据名字载入语言文件
langRd = System.Windows.Application.LoadComponent(new Uri(@"/CMWTAT_DIGITAL;component/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(@"/CMWTAT_DIGITAL;component/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);
}
}
private static void ApplyBase(bool isDark)
{
var theme = new PaletteHelper().GetTheme();
theme.SetBaseTheme(isDark ? Theme.Dark : Theme.Light);
new PaletteHelper().SetTheme(theme);
}
string ProductVersion = "0.0.0.0"; // 存储程序版本
///
/// 获取当前版本
///
private void GetEdition()
{
Assembly assembly = Assembly.GetExecutingAssembly();
ConsoleLog("AppAssemblyFullName: " + assembly.FullName);
// 获取程序集元数据
AssemblyCopyrightAttribute copyright = (AssemblyCopyrightAttribute)
Attribute.GetCustomAttribute(assembly, typeof(AssemblyCopyrightAttribute));
AssemblyDescriptionAttribute description = (AssemblyDescriptionAttribute)
Attribute.GetCustomAttribute(assembly, typeof(AssemblyDescriptionAttribute));
ProductVersion = assembly.GetName().Version.ToString();
ConsoleLog("AppDescription: " + description.Description);
ConsoleLog("AppCopyright: " + copyright.Copyright);
ConsoleLog("AppProductVersion: " + ProductVersion);
}
public string SystemEdition = OSVersionInfo.Edition;
bool isDark = false;
string WindowsTheme = "Light";
NotifyIcon notifyIcon;
public void CheckWindowsTheme()
{
var uiSettings = new Windows.UI.ViewManagement.UISettings();
Windows.UI.Color Wcolor = uiSettings.GetColorValue(Windows.UI.ViewManagement.UIColorType.Background);
System.Drawing.Color Scolor = System.Drawing.Color.FromArgb(Wcolor.R, Wcolor.G, Wcolor.B);
float hue = Scolor.GetHue(); // 色调
float saturation = Scolor.GetSaturation(); // 饱和度
float lightness = Scolor.GetBrightness(); // 亮度
if (lightness > 0.75)
{
isDark = false;
WindowsTheme = "Light";
}
else
{
isDark = true;
WindowsTheme = "Dark";
}
//ConsoleLog("Windows Theme Background is: " + Wcolor);
//ConsoleLog("Windows Theme Brightness is: " + lightness);
//ConsoleLog("Windows Theme Mode is: " + WindowsTheme);
}
public MainWindow()
{
InitializeComponent();
}
JArray ositems;
int now_os_index = 0;
string checked_os = "unknow";
bool is_auto = true; //是否为自动模式,false为手动
///
/// 检查更新
///
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 check_update_list = new List();
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 StaticServerDomain = "https://uwa-static.cloudmoe.com"; // 静态服务器
public static string MainServerDomain = "https://cmwtat.cloudmoe.com"; // 主要服务器
public static string BackupServerDomain = "https://kms.kumo.moe"; // 备用服务器
private void LoadOSList()
{
int is_selected = 0; //是否已经自动选择,0未选择,1普通模式,2实验模式,3离线KMS模式
actbtn.Dispatcher.Invoke(new Action(() =>
{
DialogWait.IsOpen = true;
}));
try
{
string json;
try
{
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=1&ver=4"); // 主要服务器
}
catch (Exception e)
{
ConsoleLog("MainServer:" + MainServerDomain + " is not working.");
ConsoleLog("Error Message:" + e.Message);
ConsoleLog("Ready to use BackupServer:" + BackupServerDomain);
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=1&ver=4"); // 备用服务器
}
JObject jsonobj = JObject.Parse(json);
List list = new List();
Frequency freq = new Frequency();
ositems = (JArray)jsonobj["OS"];
for (int i = 0; i < ositems.Count(); i++)
{
freq.ID = i;
freq.DisplayOS = jsonobj["OS"][i].ToString();
//按照优先级判断,如果已经自动选择则忽略新的
//选择带版本号
if (String.Equals(jsonobj["OS"][i].ToString(), SystemEdition + OSVersionInfo.BuildVersion, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//jsonobj["OS"][i].ToString() == SystemEdition + OSVersionInfo.BuildVersion
{
now_os_index = i;
checked_os = SystemEdition + OSVersionInfo.BuildVersion;
is_selected = 1;
}
//选择带版本号Offline-KMS
if (String.Equals(jsonobj["OS"][i].ToString(), "(Offline-KMS) " + SystemEdition + OSVersionInfo.BuildVersion, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//旧的方法:jsonobj["OS"][i].ToString() == "(Experimental) " + SystemEdition,新方法忽略大小写并提升效率
{
now_os_index = i;
checked_os = "(Offline-KMS) " + SystemEdition + OSVersionInfo.BuildVersion;
is_selected = 3;
}
//选择不带版本号
if (String.Equals(jsonobj["OS"][i].ToString(), SystemEdition, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//jsonobj["OS"][i].ToString() == SystemEdition
{
now_os_index = i;
checked_os = SystemEdition;
is_selected = 1;
}
//选择不带版本号Offline-KMS
if (String.Equals(jsonobj["OS"][i].ToString(), "(Offline-KMS) " + SystemEdition, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//旧的方法:jsonobj["OS"][i].ToString() == "(Experimental) " + SystemEdition,新方法忽略大小写并提升效率
{
now_os_index = i;
checked_os = "(Offline-KMS) " + SystemEdition;
is_selected = 3;
}
//选择不带版本号实验
if (String.Equals(jsonobj["OS"][i].ToString(), "(Experimental) " + SystemEdition, StringComparison.CurrentCultureIgnoreCase) && is_selected == 0)//旧的方法:jsonobj["OS"][i].ToString() == "(Experimental) " + SystemEdition,新方法忽略大小写并提升效率
{
now_os_index = i;
checked_os = "(Experimental) " + SystemEdition;
is_selected = 2;
}
list.Add(freq);
}
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.SystemEditionText.ItemsSource = list;//控件的ID
if (is_selected == 0)//没有匹配
{
this.SystemEditionText.SelectedIndex = 0;
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 = now_os_index;
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 if (is_selected == 3)//只找到长期KMS
{
this.SystemEditionText.SelectedIndex = now_os_index;
this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["Attention"];
this.DialogWithOKToCloseDialogText.Text = (string)this.Resources["Only_find_ltok"] + "\r\n(" + (string)this.Resources["System_Edition"] + ": " + SystemEdition + OSVersionInfo.BuildVersion + ")";
this.DialogWithOKToCloseDialog.IsOpen = true;
}
else
{
this.SystemEditionText.SelectedIndex = now_os_index;
}
}));
//this.SystemEditionText.SelectedIndex = now_os_index;
actbtn.Dispatcher.Invoke(new Action(() =>
{
DialogWait.IsOpen = false;
}));
if (App.autoact == true)//自动激活
{
Thread actthread = new Thread(RunAct);
switch (is_selected)
{
case 1: //正常
actthread.Start();
break;
case 2: //实验性
if (App.expact == true)
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
DialogWithOKToCloseDialog.IsOpen = false;
}));
actthread.Start();
}
else
{
if (App.hiderun == true)
{
int tipShowMilliseconds = 0;
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);//退出
}
}
break;
default:
if (App.hiderun == true)
{
int tipShowMilliseconds = 0;
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);//退出
}
break;
}
}
}
catch
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
DialogWait.IsOpen = false;
}));
actbtn.Dispatcher.Invoke(new Action(() =>
{
DialogWithExit.IsOpen = true;
}));
if (App.hiderun == true && App.autoact == true)
{
int tipShowMilliseconds = 0;
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 CheckWindowsCore()
{
if (SystemEdition.ToLower().IndexOf("core") == -1)
{
upgradefullbtn.IsEnabled = false;
upgradefullbtn.Visibility = Visibility.Collapsed;
this.Height -= 95;
}
}
private void Activate_Button_Click(object sender, RoutedEventArgs e)
{
Thread actthread = new Thread(RunAct);
actthread.Start();
//RunAct();
//LoadOSList();
//MessageBox.Show(json);
//MessageBox.Show(rss["OS"][0].ToString());
//MessageBox.Show(SystemEdition);
}
private void installbtn_Click(object sender, RoutedEventArgs e)
{
Thread installthread = new Thread(RunInstall);
installthread.Start();
}
private void upgradefullbtn_Click(object sender, RoutedEventArgs e)
{
this.DialogUpgradeFullVersion.IsOpen = true;
}
private void UpgradeFullVersionWindows_Click(object sender, RoutedEventArgs e)
{
this.DialogUpgradeFullVersion.IsOpen = false;
Thread upgradethread = new Thread(RunUpgradeFullVersion);
upgradethread.Start();
}
private string GetHttpWebRequest(string url, int timeout = 10000, int retry = 2)
{
string outex = "UnknowError";
for (int i = 0; i < retry; i++) // 默认重试2次
{
ConsoleLog("GetHttpWebRequest Try: " + i.ToString());
try
{
Uri uri = new Uri(url);
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(uri);
myReq.UserAgent = "User-Agent:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705";
myReq.Accept = "*/*";
myReq.KeepAlive = true;
myReq.Headers.Add("Accept-Language", "zh-cn,en-us;q=0.5");
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"));
strHTML = readerOfStream.ReadToEnd();
readerOfStream.Close();
receviceStream.Close();
result.Close();
return strHTML;
}
catch (WebException ex)
{
outex = ex.Message;
ConsoleLog("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)
{
DelectTempFile();
notifyIcon.Visible = false;
System.Windows.Application.Current.Shutdown();
}
private void RunInstall()
{
ExportTempFile();
//释放文件
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = true;
this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
}));
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
string code = "-0";
string key = "00000-00000-00000-00000-00000";
string sku = "0";
string msg = "Unknow Error!";
string system = "";
string slmgr = Environment.GetFolderPath(Environment.SpecialFolder.SystemX86) + "\\slmgr.vbs";
string slmgr_self = tempfile + "slmgr.vbs";
try
{
string sourceFile = slmgr;
string targetFile = slmgr_self;
bool isrewrite = true; // true=覆盖已存在的同名文件,false则反之
ConsoleLog("Copy Start: " + sourceFile + " To " + targetFile);
System.IO.File.Copy(sourceFile, targetFile, isrewrite);
ConsoleLog("Copy Completed.");
}
catch (Exception CopyExc)
{
ConsoleLog("Copy has Exception: " + CopyExc.Message);
}
//旧的位置
//string slmgr_self = System.AppDomain.CurrentDomain.BaseDirectory + "slmgr.vbs";
string changepk = Environment.SystemDirectory + "\\changepk.exe";
if (is_auto == true)
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
system = this.SystemEditionText.Text;
}));
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunInstall_Getting_Key"]; //提示正在获取密钥
}));
//获取密钥和SKU
try
{
string json;
try
{
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=4"); // 主要服务器
}
catch (Exception e)
{
ConsoleLog("MainServer:" + MainServerDomain + " is not working.");
ConsoleLog("Error Message:" + e.Message);
ConsoleLog("Ready to use BackupServer:" + BackupServerDomain);
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=4"); // 备用服务器
}
JObject jsonobj = JObject.Parse(json);
List list = new List();
ositems = (JArray)jsonobj["OS"];
key = jsonobj[system]["key"].ToString();
sku = jsonobj[system]["sku"].ToString();
ConsoleLog("Edition:" + system + "\r\nKEY:" + key + "\r\nSKU:" + sku);
}
catch
{
code = "-0";
msg = (string)this.Resources["ErrorMsg-0"]; // "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
goto EndLine;
}
}
else
{
//手动密钥
actbtn.Dispatcher.Invoke(new Action(() =>
{
key = this.SystemEditionTextInput.Text;
}));
}
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunInstall_Uninstalling_old_Key"]; //提示正在卸载旧密钥
}));
//卸载
string runend = RunCScript(slmgr_self, "-upk").Trim();
//string runend = RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -upk").Trim();
ConsoleLog(runend);
if (runend.EndsWith("successfully.") || runend.EndsWith("not found."))
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunInstall_Installing_Key"]; //提示正在安装密钥
}));
//安装数字权利升级密钥
if (RunCScript(slmgr_self, "-ipk " + key).Trim().EndsWith("successfully."))
//if (RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -ipk " + key).Trim().EndsWith("successfully."))
{
code = "200";
}
else
{
code = "-2";
msg = (string)this.Resources["ErrorMsg-2"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
}
}
else
{
code = "-1";
msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
}
//string runend = RunCScript(slmgr_self, "-upk").Trim();
EndLine:;
if (code != "200")
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
this.DialogWithOKToCloseDialog.IsOpen = true;
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);
}
else
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
this.activatingtext.Text = (string)this.Resources["RunInstall_Converting"]; //提示转换中
this.DialogWithOKToCloseDialogDonate.IsOpen = true;
this.DialogWithOKToCloseDialogDonateTitle.Text = (string)this.Resources["CompleteTitle"]; //完成标题
this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextConverted"]; //完成转换内容
}));
//MessageBox.Show("Congratulation!");
}
DelectTempFile();
//清理文件
}
private void RunUpgradeFullVersion()
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = true;
this.activatingtext.Text = (string)this.Resources["RunUpgradeFullVersion_Upgrading"]; //提示升级中
}));
RunCMD(@"sc start sppsvc");
RunCMD(@"sc start wuauserv");
RunCLI("ChangePK.exe", ".", "/ProductKey VK7JG-NPHTM-C97JM-9MPGT-3V66T"); // Pro
RunCLI("ChangePK.exe", ".", "/ProductKey 2B87N-8KFHP-DKV6R-Y2C8J-PKCKT"); // Pro N
RunCLI("ChangePK.exe", ".", "/ProductKey W269N-WFGWX-YVC9B-4J6C9-T83GX"); // KMS Pro
RunCLI("ChangePK.exe", ".", "/ProductKey MH37W-N47XK-V7XM9-C7227-GCQG9"); // KMS Pro N
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
}));
}
private void ShowBallSameDig()
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
if (App.hiderun == true && App.autoact == true)
{
int tipShowMilliseconds = 0;
string tipTitle = (string)this.Resources["notifyIconTitle"];
string tipContent = this.activatingtext.Text;
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
}
}));
}
private void RunAct()
{
bool is_not_network_to_act = false; //是否无法联网稍后激活
ExportTempFile();
//释放文件
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = true;
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
ShowBallSameDig();
}));
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
string code = "-0";
string key = "00000-00000-00000-00000-00000";
string sku = "0";
string msg = "Unknow Error!";
string system = "";
string mode = "1"; //1:普通(SYS、SKU、KEY完全);2.需要获取SKU(SYS、KEY);3.手动输入KEY;4.普通OfflineKMS(SYS、SKU、KEY完全)
string slmgr = Environment.GetFolderPath(Environment.SpecialFolder.SystemX86) + "\\slmgr.vbs";
string slmgr_self = tempfile + "slmgr.vbs";
try
{
string sourceFile = slmgr;
string targetFile = slmgr_self;
bool isrewrite = true; // true=覆盖已存在的同名文件,false则反之
ConsoleLog("Copy Start: " + sourceFile + " To " + targetFile);
File.Copy(sourceFile, targetFile, isrewrite);
ConsoleLog("Copy Completed.");
}
catch (Exception CopyExc)
{
ConsoleLog("Copy has Exception: " + CopyExc.Message);
}
//旧的位置
string changepk = Environment.SystemDirectory + "\\changepk.exe";
if (is_auto == true)
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
system = this.SystemEditionText.Text;
}));
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_Key"]; //提示正在获取密钥
ShowBallSameDig();
}));
//获取密钥和SKU
try
{
string json;
try
{
json = GetHttpWebRequest(MainServerDomain + "/api/digital?list=0&ver=4"); // 主要服务器
}
catch (Exception e)
{
ConsoleLog("MainServer:" + MainServerDomain + " is not working.");
ConsoleLog("Error Message:" + e.Message);
ConsoleLog("Ready to use BackupServer:" + BackupServerDomain);
json = GetHttpWebRequest(BackupServerDomain + "/api/digital?list=0&ver=4"); // 备用服务器
}
JObject jsonobj = JObject.Parse(json);
List list = new List();
ositems = (JArray)jsonobj["OS"];
key = jsonobj[system]["key"].ToString();
sku = jsonobj[system]["sku"].ToString();
ConsoleLog("Edition:" + system + "\r\nKEY:" + key + "\r\nSKU:" + sku);
string selecos = "";
// 获取当前选择的选择的文本
actbtn.Dispatcher.Invoke(new Action(() =>
{
selecos = SystemEditionText.Text;
}));
ConsoleLog("Selected OS: " + selecos);
if (sku == "unknow")
{
mode = "2";
}
if (selecos.ToUpper().StartsWith("(Offline-KMS)".ToUpper()))
{
ConsoleLog("Switch Mode Offline-KMS");
mode = "4";
}
}
catch
{
code = "-0";
msg = (string)this.Resources["ErrorMsg-0"]; // "激活Windows10需要网络获取产品密钥 :) \nActivate Windows 10 requires a network to gets the product key :)";
goto EndLine;
}
}
else
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
key = this.SystemEditionTextInput.Text;
}));
mode = "3";
sku = "unknow";
}
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Uninstalling_old_Key"]; //提示正在卸载旧密钥
ShowBallSameDig();
}));
//卸载
string runend = RunCScript(slmgr_self, "-upk").Trim();
//string runend = RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -upk").Trim();
ConsoleLog(runend);
if (runend.EndsWith("successfully.") || runend.EndsWith("not found."))
{
RunCScript(slmgr_self, "-ckms").Trim();
if (mode == "4")
{
//长期KMS
RunCMD(@"sc stop sppsvc");
RunCMD(@"del /F /Q %systemroot%\system32\spp\store\2.0\tokens.dat");
RunCMD(@"del /F /Q %systemroot%\system32\spp\store\2.0\data.dat");
RunCMD(@"del /F /Q %systemroot%\system32\spp\store\2.0\cache\cache.dat");
RunCMD(@"sc start sppsvc");
}
if (sku == "unknow")//if (mode == "2" || mode == "3") //获取SKU
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_edition_code_Exp"]; // "Getting edition code (Experimental)";
ShowBallSameDig();
}));
//安装转换密钥
runend = RunCScript(slmgr_self, "-ipk " + key);
//runend = RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -ipk " + key);
ConsoleLog(slmgr_self + " -ipk " + key);
ConsoleLog(runend);
if (runend.Trim().EndsWith("successfully."))
{
Thread.Sleep(6000); //等待6秒,确保SKU生效
sku = GetSKU(); //获取SKU
if (sku != "Error")
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Uninstalling_old_Key_Exp"]; //提示正在卸载旧密钥(实验性)
ShowBallSameDig();
}));
runend = RunCScript(slmgr_self, "-upk").Trim();
//runend = RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -upk").Trim();
ConsoleLog(runend);
if (runend.EndsWith("successfully.") || runend.EndsWith("not found."))
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Prepare_for_the_next_step_Exp"]; // "Prepare for the next step (Experimental)";
ShowBallSameDig();
}));
}
}
else
{
code = "-1.2";
msg = (string)this.Resources["ErrorMsg-1.2"]; // "无法获取版本代号 :(\nCannot to get edition code. :(";
goto EndLine;
}
}
else
{
code = "-1.1";
msg = (string)this.Resources["ErrorMsg-1.1"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
goto EndLine;
}
}
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Installing_Key"]; //提示正在安装密钥
ShowBallSameDig();
}));
//安装数字权利升级密钥
runend = RunCScript(slmgr_self, "-ipk " + key);
//runend = RunCMD(@"cscript.exe /nologo %systemroot%\system32\slmgr.vbs -ipk " + key);
ConsoleLog(slmgr_self + " -ipk " + key);
ConsoleLog(runend);
if (runend.Trim().EndsWith("successfully."))
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_free_upgrade_permissions"]; // "Getting free upgrade permissions";
ShowBallSameDig();
}));
string ticket = null;
try
{
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Control\\ProductOptions", true);
var packageFamilyName = registryKey.GetValue("OSProductPfn").ToString();
try
{
if (mode == "4")
{
//长期KMS
ticket = GetHttpWebRequest(StaticServerDomain + "/Tickets/KMS.xml");
}
else
{
ticket = GetHttpWebRequest(StaticServerDomain + "/Tickets/" + packageFamilyName + ".xml");
}
//System.Windows.MessageBox.Show(ticket);
}
catch (Exception e)
{
ConsoleLog("StaticServer:" + StaticServerDomain + " is not working.");
ConsoleLog("Error Message:" + e.Message);
}
}
catch (Exception e)
{
ConsoleLog("Get PackageFamilyName failed.");
ConsoleLog("Error Message:" + e.Message);
}
File.WriteAllText(tempfile + "GenuineTicketvNext.xml", ticket, Encoding.UTF8);
ConsoleLog("进入下一步(CUR:VNEXT)");
var hasvNextTicket = File.Exists(tempfile + "GenuineTicketvNext.xml");
if (hasvNextTicket)
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Getting_digital_license"]; // "Getting digital license";
ShowBallSameDig();
}));
RunCMD(@"sc start wuauserv");
RunCMD(@"sc start clipsvc");
RunCMD(@"clipup -v -o -altto " + tempfile);
RunCMD(@"clipup -v -o -altto " + tempfile.TrimEnd('\\')); // 旧版本系统的 ClipUp 路径不能带最后的反斜杠
if (OSVersionInfo.BuildVersion >= 20348)
{
RunCLI(tempfile + "ClipUp.exe", ".", "-v -o -altto " + tempfile); // 固定版本解决 22H2 后 ARM64 许可证接收问题
RunCLI(tempfile + "ClipUp.exe", ".", "-v -o -altto " + tempfile.TrimEnd('\\'));
}
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; // 提示激活中
ShowBallSameDig();
}));
int try_max_count = 30;
for (int i = 0; i < try_max_count + 1; i++)
{
if (!File.Exists(tempfile + "GenuineTicketvNext.xml"))
{
break;
}
Thread.Sleep(1000);
ConsoleLog($"应用许可证 重试 {i}/{try_max_count}");
}
runend = RunCScript(slmgr_self, "-ato").Trim();
ConsoleLog(runend);
var xprrunend = RunCScript(slmgr_self, "-xpr").Trim();
var activated = (xprrunend.Contains("activated") || xprrunend.Contains("activation will expire"));
ConsoleLog(xprrunend);
if (runend.EndsWith("successfully.") || activated || runend.Contains("0xC004C003")) // Error 0xC004C003: The activation server determined that the specified product key is blocked. 是因为未连接激活服务器,下次连接时会自动激活。
{
if (runend.Contains("0xC004C003"))
{
is_not_network_to_act = true;
}
code = "200";
}
else
{
code = "-4";
msg = (string)this.Resources["ErrorMsg-4"] + "\r\n" + (string)this.Resources["SysMsg"] + "\r\n" + runend; // "激活失败 :(\nActivation Failed. :(";
}
}
else
{
code = "-3";
msg = (string)this.Resources["ErrorMsg-3"]; // "执行超时,可能没有选择正确或输入的版本 :(\nTime out, may be you choose or enter a incorrect version. :(";
}
}
else
{
code = "-2";
msg = (string)this.Resources["ErrorMsg-2"]; // "无法安装密钥,可能没有选择或输入正确的版本 :(\nCannot to install key, may be you choose or enter a incorrect version. :(";
}
}
else
{
code = "-1";
msg = (string)this.Resources["ErrorMsg-1"]; // "无法卸载旧密钥 :(\nCannot to uninstall old key. :(";
}
//string runend = RunCScript(slmgr_self, "-upk").Trim();
EndLine:;
if (code != "200")
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
this.DialogWithOKToCloseDialog.IsOpen = true;
this.DialogWithOKToCloseDialogTitle.Text = (string)this.Resources["ErrorTitle"]; //错误标题
this.DialogWithOKToCloseDialogText.Text = msg + "\r\n" + (string)this.Resources["ErrorCode"] + code; //错误代码 如:错误信息\r\nCode:000
if (App.hiderun == true && App.autoact == true)
{
int tipShowMilliseconds = 0;
string tipTitle = (string)this.Resources["notifyIconTitle"];
string tipContent = msg;
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
Exit_Button_Click(null, null);
}
}));
//MessageBox.Show(msg + "\r\nCode:" + code);
}
else
{
actbtn.Dispatcher.Invoke(new Action(() =>
{
this.DialogActProg.IsOpen = false;
this.activatingtext.Text = (string)this.Resources["RunAct_Activating"]; //提示激活中
this.DialogWithOKToCloseDialogDonate.IsOpen = true;
this.DialogWithOKToCloseDialogDonateTitle.Text = (string)this.Resources["CompleteTitle"]; //完成标题
if (is_not_network_to_act == true)
{
this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextWillActivated"]; //即将激活内容
}
else
{
this.DialogWithOKToCloseDialogDonateText.Text = (string)this.Resources["DonateTextActivated"]; //完成激活内容
}
if (App.hiderun == true && App.autoact == true)
{
int tipShowMilliseconds = 0;
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);
}
}));
//MessageBox.Show("Congratulation!");
}
DelectTempFile();
//清理文件
}
public static string RunCLI(string path, string wdPath, string var = "")
{
ConsoleLog(path + " " + var);
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
//执行命令行函数
try
{
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = path;//要执行的程序名称
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.RedirectStandardInput = true;//可能接受来自调用程序的输入信息
myProcess.StartInfo.RedirectStandardOutput = true;//由调用程序获取输出信息
myProcess.StartInfo.CreateNoWindow = true;//不显示程序窗口
myProcess.StartInfo.Arguments = var;
myProcess.StartInfo.WorkingDirectory = wdPath;
//myProcess.Arguments = "/c chcp 65001 > nul && cmd /c \"" + PHPRuntimePath + "\" \"" + path + "\" " + var;
//myProcess.Arguments = "/c " & Commands
//myProcess.StartInfo.StandardOutputEncoding = Encoding.UTF8;
myProcess.Start();
myProcess.WaitForExit(120 * 1000);
StreamReader myStreamReader = myProcess.StandardOutput;
string myString = myStreamReader.ReadToEnd();
myProcess.Close();
ConsoleLog(myString.Trim());
ConsoleLog("执行完毕");
return myString.Trim();
}
catch
{
return "Error";
}
}
public static string RunCMD(string var)
{
ConsoleLog(var);
Wow64EnableWow64FsRedirection(false); //关闭文件重定向
//执行命令行函数
try
{
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = "cmd.exe";//要执行的程序名称
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.RedirectStandardInput = true;//可能接受来自调用程序的输入信息
myProcess.StartInfo.RedirectStandardOutput = true;//由调用程序获取输出信息
myProcess.StartInfo.CreateNoWindow = true;//不显示程序窗口
myProcess.StartInfo.Arguments = "/c chcp 437 > nul && cmd /c \"" + var + "\"";
//myProcess.Arguments = "/c chcp 65001 > nul && cmd /c \"" + PHPRuntimePath + "\" \"" + path + "\" " + var;
//myProcess.Arguments = "/c " & Commands
//myProcess.StartInfo.StandardOutputEncoding = Encoding.UTF8;
myProcess.Start();
myProcess.WaitForExit(60 * 1000);
System.IO.StreamReader myStreamReader = myProcess.StandardOutput;
string myString = myStreamReader.ReadToEnd();
myProcess.Close();
ConsoleLog(myString.Trim());
return myString.Trim();
}
catch
{
return "Error";
}
}
public static string RunCScript(string path, string var = "")
{
ConsoleLog("CScript" + " " + "//Nologo \"" + path + "\" " + var);
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
//执行命令行函数
try
{
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo ProcessStartInfo = new System.Diagnostics.ProcessStartInfo("CScript", "//Nologo \"" + path + "\" " + var)
{
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true,
//myProcessStartInfo.Arguments = "/c chcp 65001 > nul && cmd /c \"" + PHPRuntimePath + "\" \"" + path + "\" " + var;
//myProcessStartInfo.Arguments = "/c " & Commands
StandardOutputEncoding = Encoding.UTF8
};
myProcess.StartInfo = ProcessStartInfo;
myProcess.Start();
myProcess.WaitForExit(60 * 1000);
System.IO.StreamReader myStreamReader = myProcess.StandardOutput;
string myString = myStreamReader.ReadToEnd();
myProcess.Close();
ConsoleLog(myString.Trim());
return myString.Trim();
}
catch
{
return "Error";
}
}
public static string GetSKU()
{
ConsoleLog("Geting SKU");
Wow64EnableWow64FsRedirection(false);//关闭文件重定向
//执行命令行函数
try
{
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = "cmd.exe";//要执行的程序名称
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.RedirectStandardOutput = true;
myProcess.StartInfo.CreateNoWindow = true;
myProcess.StartInfo.Arguments = "/c wmic os get OperatingSystemSKU";
//myProcess.Arguments = "/c chcp 65001 > nul && cmd /c \"" + PHPRuntimePath + "\" \"" + path + "\" " + var;
//myProcess.Arguments = "/c " & Commands
myProcess.StartInfo.StandardOutputEncoding = Encoding.UTF8;
myProcess.Start();
myProcess.WaitForExit(60 * 1000);
System.IO.StreamReader myStreamReader = myProcess.StandardOutput;
string myString = myStreamReader.ReadToEnd();
myProcess.Close();
myString = Regex.Replace(myString, @"[^0-9]+", "");
ConsoleLog("Get SKU:\"" + myString.Trim() + "\"");
return myString.Trim(); //只保留数字SKU
}
catch
{
return "Error";
}
}
private void Donate_Button_Click(object sender, RoutedEventArgs e)
{
System.Diagnostics.Process.Start("https://cmwtat.cloudmoe.com/donate"); // 打开捐赠页
this.DialogWithOKToCloseDialogDonate.IsOpen = false;
}
string last_key = "";
private void SystemEditionTextInput_TextChanged(object sender, TextChangedEventArgs e)
{
if (SystemEditionTextInput.Text != last_key)
{
int selectlen = SystemEditionTextInput.SelectionStart;
string temp = SystemEditionTextInput.Text;
temp = Regex.Replace(temp, @"[^a-zA-Z0-9]+", "");//XAML禁用输入法,并替换可能粘贴进的意外字符
temp = Regex.Replace(temp, @"([a-zA-Z0-9]{5}(?!$))", "$1-");
//temp = string.Join("-", Regex.Matches(temp, @".....").Cast().ToList());
SystemEditionTextInput.Text = temp.ToUpper();
last_key = SystemEditionTextInput.Text;
SystemEditionTextInput.SelectionStart = SystemEditionTextInput.Text.Length;
}
UpdateInputMatch(); // 更新按钮启用状态
}
///
/// 验证产品密钥字符串是否匹配正则表达式描述的规则并更新按钮状态(如果自动模式则启用按钮)
///
private void UpdateInputMatch()
{
//防止初始化前访问null出错
try
{
if (actbtn != null)
{
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)
{
SystemEditionText.Visibility = Visibility.Visible;
SystemEditionTextInput.Visibility = Visibility.Hidden;
is_auto = true;
UpdateInputMatch(); // 更新按钮启用状态
}
private void M_RadioButton_Checked(object sender, RoutedEventArgs e)
{
SystemEditionText.Visibility = Visibility.Hidden;
SystemEditionTextInput.Visibility = Visibility.Visible;
is_auto = false;
UpdateInputMatch(); // 更新按钮启用状态
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
DelectTempFile();
notifyIcon.Visible = false;
}
private void UpdateBtn_Click(object sender, RoutedEventArgs e)
{
System.Diagnostics.Process.Start("https://cmwtat.cloudmoe.com"); // 打开官网
}
private void Window_Activated(object sender, EventArgs e)
{
CheckWindowsTheme();
ApplyBase(isDark); // 应用颜色
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
CheckWindowsTheme();
ConsoleLog("Windows Theme Mode is: " + WindowsTheme);
GetEdition(); // 获取程序版本
//autoact = App.autoact;
//hiderun = App.hiderun;
//expact = App.expact;
//log2file = App.log2file;
//showhelp = App.showhelp;
//MessageBox.Show("A:" + autoact.ToString() + ";H:" + hiderun.ToString());
ApplyBase(isDark);
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 (App.showhelp == true)
{
DialogHelp.IsOpen = true;
}
notifyIcon = new NotifyIcon
{
Text = (string)this.Resources["notifyIconTitle"], //托盘图标标题
Icon = Properties.Resources.CMWTAT_ICON
}; // 先初始化托盘图标,以方便语言缺省时提示
if ((App.hiderun == true && App.autoact == true) || NotSupportLang == true)
{
//notifyIcon.BalloonTipText = "The app has been minimised. Click the tray icon to show.";
//notifyIcon.BalloonTipTitle = "The App";
//notifyIcon.Icon = new System.Drawing.Icon("TheAppIcon.ico");
//notifyIcon.Click += new EventHandler(notifyIcon_Click);
notifyIcon.Visible = true;
//打开菜单项
//System.Windows.Forms.MenuItem open = new System.Windows.Forms.MenuItem("Open");
//open.Click += new EventHandler((o, e) =>
//{
// this.Show();
//});
//退出菜单项
System.Windows.Forms.MenuItem exit = new System.Windows.Forms.MenuItem("Exit");
exit.Click += new EventHandler(Exit_Button_Click);
//关联托盘控件
//System.Windows.Forms.MenuItem[] childen = new System.Windows.Forms.MenuItem[] { open, exit };
System.Windows.Forms.MenuItem[] childen = new System.Windows.Forms.MenuItem[] { exit };
notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu(childen);
//this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler((o, e) =>
//{
// 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 (App.hiderun == true && App.autoact == true)
{
this.Hide();
int tipShowMilliseconds = 0;
string tipTitle = (string)this.Resources["notifyIconTitle"]; //通知气泡标题
string tipContent = (string)this.Resources["Running"]; //提示正在运行
ToolTipIcon tipType = ToolTipIcon.None;
notifyIcon.ShowBalloonTip(tipShowMilliseconds, tipTitle, tipContent, tipType);
//notifyIcon.BalloonTipClicked += new EventHandler((o, e) =>
//{
// //System.Windows.MessageBox.Show(System.Windows.Forms.Control.MouseButtons.ToString());
// if (System.Windows.Forms.Control.MouseButtons == MouseButtons.None) //左键返回不是Right是None
// {
// System.Windows.MessageBox.Show("Hello");
// };
//});
}
//初始化动态表单数据绑定
DataContext = new Domain.ViewModel();
this.DialogHostGrid.Visibility = Visibility.Visible;
DialogWait.IsOpen = true;
try
{
RegistryKey pRegKey = Registry.LocalMachine;
pRegKey = pRegKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
SystemEdition = pRegKey.GetValue("EditionID").ToString();
}
catch
{
SystemEdition = OSVersionInfo.Edition;
}
//SystemEditionText.Text = SystemEdition;
Thread loadthread = new Thread(LoadOSList);
loadthread.Start();
CheckWindowsCore();
}
}
}
================================================
FILE: CMWTAT_DIGITAL/OSVersionInfoClass.cs
================================================
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
// http://www.codeproject.com/Articles/73000/Getting-Operating-System-Version-Info-Even-for-Win
//https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions
//Thanks to Member 7861383, Scott Vickery for the Windows 8.1 update and workaround.
//I have moved it to the beginning of the Name property, though...
//Thakts to Brisingr Aerowing for help with the Windows 10 adapatation
namespace OSVersionInfoClass
{
///
/// Provides detailed information about the host operating system.
///
public static class OSVersionInfo
{
#region ENUMS
public enum SoftwareArchitecture
{
Unknown = 0,
Bit32 = 1,
Bit64 = 2
}
public enum ProcessorArchitecture
{
Unknown = 0,
Bit32 = 1,
Bit64 = 2,
Itanium64 = 3
}
#endregion ENUMS
#region DELEGATE DECLARATION
private delegate bool IsWow64ProcessDelegate([In] IntPtr handle, [Out] out bool isWow64Process);
#endregion DELEGATE DECLARATION
#region BITS
///
/// Determines if the current application is 32 or 64-bit.
///
static public SoftwareArchitecture ProgramBits
{
get
{
SoftwareArchitecture pbits = SoftwareArchitecture.Unknown;
System.Collections.IDictionary test = Environment.GetEnvironmentVariables();
switch (IntPtr.Size * 8)
{
case 64:
pbits = SoftwareArchitecture.Bit64;
break;
case 32:
pbits = SoftwareArchitecture.Bit32;
break;
default:
pbits = SoftwareArchitecture.Unknown;
break;
}
return pbits;
}
}
static public SoftwareArchitecture OSBits
{
get
{
SoftwareArchitecture osbits = SoftwareArchitecture.Unknown;
switch (IntPtr.Size * 8)
{
case 64:
osbits = SoftwareArchitecture.Bit64;
break;
case 32:
if (Is32BitProcessOn64BitProcessor())
osbits = SoftwareArchitecture.Bit64;
else
osbits = SoftwareArchitecture.Bit32;
break;
default:
osbits = SoftwareArchitecture.Unknown;
break;
}
return osbits;
}
}
///
/// Determines if the current processor is 32 or 64-bit.
///
static public ProcessorArchitecture ProcessorBits
{
get
{
ProcessorArchitecture pbits = ProcessorArchitecture.Unknown;
try
{
SYSTEM_INFO l_System_Info = new SYSTEM_INFO();
GetNativeSystemInfo(ref l_System_Info);
switch (l_System_Info.uProcessorInfo.wProcessorArchitecture)
{
case 9: // PROCESSOR_ARCHITECTURE_AMD64
pbits = ProcessorArchitecture.Bit64;
break;
case 6: // PROCESSOR_ARCHITECTURE_IA64
pbits = ProcessorArchitecture.Itanium64;
break;
case 0: // PROCESSOR_ARCHITECTURE_INTEL
pbits = ProcessorArchitecture.Bit32;
break;
default: // PROCESSOR_ARCHITECTURE_UNKNOWN
pbits = ProcessorArchitecture.Unknown;
break;
}
}
catch
{
// Ignore
}
return pbits;
}
}
#endregion BITS
#region EDITION
static private string s_Edition;
///
/// Gets the edition of the operating system running on this computer.
///
static public string Edition
{
get
{
if (s_Edition != null)
return s_Edition; //***** RETURN *****//
string edition = String.Empty;
OperatingSystem osVersion = Environment.OSVersion;
OSVERSIONINFOEX osVersionInfo = new OSVERSIONINFOEX();
osVersionInfo.dwOSVersionInfoSize = Marshal.SizeOf(typeof(OSVERSIONINFOEX));
if (GetVersionEx(ref osVersionInfo))
{
int majorVersion = osVersion.Version.Major;
int minorVersion = osVersion.Version.Minor;
byte productType = osVersionInfo.wProductType;
short suiteMask = osVersionInfo.wSuiteMask;
#region VERSION 4
if (majorVersion == 4)
{
if (productType == VER_NT_WORKSTATION)
{
// Windows NT 4.0 Workstation
edition = "Workstation";
}
else if (productType == VER_NT_SERVER)
{
if ((suiteMask & VER_SUITE_ENTERPRISE) != 0)
{
// Windows NT 4.0 Server Enterprise
edition = "Enterprise Server";
}
else
{
// Windows NT 4.0 Server
edition = "Standard Server";
}
}
}
#endregion VERSION 4
#region VERSION 5
else if (majorVersion == 5)
{
if (productType == VER_NT_WORKSTATION)
{
if ((suiteMask & VER_SUITE_PERSONAL) != 0)
{
edition = "Home";
}
else
{
if (GetSystemMetrics(86) == 0) // 86 == SM_TABLETPC
edition = "Professional";
else
edition = "Tablet Edition";
}
}
else if (productType == VER_NT_SERVER)
{
if (minorVersion == 0)
{
if ((suiteMask & VER_SUITE_DATACENTER) != 0)
{
// Windows 2000 Datacenter Server
edition = "Datacenter Server";
}
else if ((suiteMask & VER_SUITE_ENTERPRISE) != 0)
{
// Windows 2000 Advanced Server
edition = "Advanced Server";
}
else
{
// Windows 2000 Server
edition = "Server";
}
}
else
{
if ((suiteMask & VER_SUITE_DATACENTER) != 0)
{
// Windows Server 2003 Datacenter Edition
edition = "Datacenter";
}
else if ((suiteMask & VER_SUITE_ENTERPRISE) != 0)
{
// Windows Server 2003 Enterprise Edition
edition = "Enterprise";
}
else if ((suiteMask & VER_SUITE_BLADE) != 0)
{
// Windows Server 2003 Web Edition
edition = "Web Edition";
}
else
{
// Windows Server 2003 Standard Edition
edition = "Standard";
}
}
}
}
#endregion VERSION 5
#region VERSION 6
else if (majorVersion == 6)
{
int ed;
if (GetProductInfo(majorVersion, minorVersion,
osVersionInfo.wServicePackMajor, osVersionInfo.wServicePackMinor,
out ed))
{
switch (ed)
{
case PRODUCT_BUSINESS:
edition = "Business";
break;
case PRODUCT_BUSINESS_N:
edition = "Business N";
break;
case PRODUCT_CLUSTER_SERVER:
edition = "HPC Edition";
break;
case PRODUCT_CLUSTER_SERVER_V:
edition = "HPC Edition without Hyper-V";
break;
case PRODUCT_DATACENTER_SERVER:
edition = "Datacenter Server";
break;
case PRODUCT_DATACENTER_SERVER_CORE:
edition = "Datacenter Server (core installation)";
break;
case PRODUCT_DATACENTER_SERVER_V:
edition = "Datacenter Server without Hyper-V";
break;
case PRODUCT_DATACENTER_SERVER_CORE_V:
edition = "Datacenter Server without Hyper-V (core installation)";
break;
case PRODUCT_EMBEDDED:
edition = "Embedded";
break;
case PRODUCT_ENTERPRISE:
edition = "Enterprise";
break;
case PRODUCT_ENTERPRISE_N:
edition = "Enterprise N";
break;
case PRODUCT_ENTERPRISE_E:
edition = "Enterprise E";
break;
case PRODUCT_ENTERPRISE_SERVER:
edition = "Enterprise Server";
break;
case PRODUCT_ENTERPRISE_SERVER_CORE:
edition = "Enterprise Server (core installation)";
break;
case PRODUCT_ENTERPRISE_SERVER_CORE_V:
edition = "Enterprise Server without Hyper-V (core installation)";
break;
case PRODUCT_ENTERPRISE_SERVER_IA64:
edition = "Enterprise Server for Itanium-based Systems";
break;
case PRODUCT_ENTERPRISE_SERVER_V:
edition = "Enterprise Server without Hyper-V";
break;
case PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT:
edition = "Essential Business Server MGMT";
break;
case PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL:
edition = "Essential Business Server ADDL";
break;
case PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC:
edition = "Essential Business Server MGMTSVC";
break;
case PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC:
edition = "Essential Business Server ADDLSVC";
break;
case PRODUCT_HOME_BASIC:
edition = "Home Basic";
break;
case PRODUCT_HOME_BASIC_N:
edition = "Home Basic N";
break;
case PRODUCT_HOME_BASIC_E:
edition = "Home Basic E";
break;
case PRODUCT_HOME_PREMIUM:
edition = "Home Premium";
break;
case PRODUCT_HOME_PREMIUM_N:
edition = "Home Premium N";
break;
case PRODUCT_HOME_PREMIUM_E:
edition = "Home Premium E";
break;
case PRODUCT_HOME_PREMIUM_SERVER:
edition = "Home Premium Server";
break;
case PRODUCT_HYPERV:
edition = "Microsoft Hyper-V Server";
break;
case PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT:
edition = "Windows Essential Business Management Server";
break;
case PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING:
edition = "Windows Essential Business Messaging Server";
break;
case PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY:
edition = "Windows Essential Business Security Server";
break;
case PRODUCT_PROFESSIONAL:
edition = "Professional";
break;
case PRODUCT_PROFESSIONAL_N:
edition = "Professional N";
break;
case PRODUCT_PROFESSIONAL_E:
edition = "Professional E";
break;
case PRODUCT_SB_SOLUTION_SERVER:
edition = "SB Solution Server";
break;
case PRODUCT_SB_SOLUTION_SERVER_EM:
edition = "SB Solution Server EM";
break;
case PRODUCT_SERVER_FOR_SB_SOLUTIONS:
edition = "Server for SB Solutions";
break;
case PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM:
edition = "Server for SB Solutions EM";
break;
case PRODUCT_SERVER_FOR_SMALLBUSINESS:
edition = "Windows Essential Server Solutions";
break;
case PRODUCT_SERVER_FOR_SMALLBUSINESS_V:
edition = "Windows Essential Server Solutions without Hyper-V";
break;
case PRODUCT_SERVER_FOUNDATION:
edition = "Server Foundation";
break;
case PRODUCT_SMALLBUSINESS_SERVER:
edition = "Windows Small Business Server";
break;
case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM:
edition = "Windows Small Business Server Premium";
break;
case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE:
edition = "Windows Small Business Server Premium (core installation)";
break;
case PRODUCT_SOLUTION_EMBEDDEDSERVER:
edition = "Solution Embedded Server";
break;
case PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE:
edition = "Solution Embedded Server (core installation)";
break;
case PRODUCT_STANDARD_SERVER:
edition = "Standard Server";
break;
case PRODUCT_STANDARD_SERVER_CORE:
edition = "Standard Server (core installation)";
break;
case PRODUCT_STANDARD_SERVER_SOLUTIONS:
edition = "Standard Server Solutions";
break;
case PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE:
edition = "Standard Server Solutions (core installation)";
break;
case PRODUCT_STANDARD_SERVER_CORE_V:
edition = "Standard Server without Hyper-V (core installation)";
break;
case PRODUCT_STANDARD_SERVER_V:
edition = "Standard Server without Hyper-V";
break;
case PRODUCT_STARTER:
edition = "Starter";
break;
case PRODUCT_STARTER_N:
edition = "Starter N";
break;
case PRODUCT_STARTER_E:
edition = "Starter E";
break;
case PRODUCT_STORAGE_ENTERPRISE_SERVER:
edition = "Enterprise Storage Server";
break;
case PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE:
edition = "Enterprise Storage Server (core installation)";
break;
case PRODUCT_STORAGE_EXPRESS_SERVER:
edition = "Express Storage Server";
break;
case PRODUCT_STORAGE_EXPRESS_SERVER_CORE:
edition = "Express Storage Server (core installation)";
break;
case PRODUCT_STORAGE_STANDARD_SERVER:
edition = "Standard Storage Server";
break;
case PRODUCT_STORAGE_STANDARD_SERVER_CORE:
edition = "Standard Storage Server (core installation)";
break;
case PRODUCT_STORAGE_WORKGROUP_SERVER:
edition = "Workgroup Storage Server";
break;
case PRODUCT_STORAGE_WORKGROUP_SERVER_CORE:
edition = "Workgroup Storage Server (core installation)";
break;
case PRODUCT_UNDEFINED:
edition = "Unknown product";
break;
case PRODUCT_ULTIMATE:
edition = "Ultimate";
break;
case PRODUCT_ULTIMATE_N:
edition = "Ultimate N";
break;
case PRODUCT_ULTIMATE_E:
edition = "Ultimate E";
break;
case PRODUCT_WEB_SERVER:
edition = "Web Server";
break;
case PRODUCT_WEB_SERVER_CORE:
edition = "Web Server (core installation)";
break;
}
}
}
#endregion VERSION 6
}
s_Edition = edition;
return edition;
}
}
#endregion EDITION
#region NAME
static private string s_Name;
///
/// Gets the name of the operating system running on this computer.
///
static public string Name
{
get
{
if (s_Name != null)
return s_Name; //***** RETURN *****//
string name = "unknown";
OperatingSystem osVersion = Environment.OSVersion;
OSVERSIONINFOEX osVersionInfo = new OSVERSIONINFOEX();
osVersionInfo.dwOSVersionInfoSize = Marshal.SizeOf(typeof(OSVERSIONINFOEX));
if (GetVersionEx(ref osVersionInfo))
{
int majorVersion = osVersion.Version.Major;
int minorVersion = osVersion.Version.Minor;
if (majorVersion == 6 && minorVersion == 2)
{
//The registry read workaround is by Scott Vickery. Thanks a lot for the help!
//http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx
// For applications that have been manifested for Windows 8.1 & Windows 10. Applications not manifested for 8.1 or 10 will return the Windows 8 OS version value (6.2).
// By reading the registry, we'll get the exact version - meaning we can even compare against Win 8 and Win 8.1.
string exactVersion = RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentVersion", "");
if (!string.IsNullOrEmpty(exactVersion))
{
string[] splitResult = exactVersion.Split('.');
majorVersion = Convert.ToInt32(splitResult[0]);
minorVersion = Convert.ToInt32(splitResult[1]);
}
if (IsWindows10())
{
majorVersion = 10;
minorVersion = 0;
}
}
switch (osVersion.Platform)
{
case PlatformID.Win32S:
name = "Windows 3.1";
break;
case PlatformID.WinCE:
name = "Windows CE";
break;
case PlatformID.Win32Windows:
{
if (majorVersion == 4)
{
string csdVersion = osVersionInfo.szCSDVersion;
switch (minorVersion)
{
case 0:
if (csdVersion == "B" || csdVersion == "C")
name = "Windows 95 OSR2";
else
name = "Windows 95";
break;
case 10:
if (csdVersion == "A")
name = "Windows 98 Second Edition";
else
name = "Windows 98";
break;
case 90:
name = "Windows Me";
break;
}
}
break;
}
case PlatformID.Win32NT:
{
byte productType = osVersionInfo.wProductType;
switch (majorVersion)
{
case 3:
name = "Windows NT 3.51";
break;
case 4:
switch (productType)
{
case 1:
name = "Windows NT 4.0";
break;
case 3:
name = "Windows NT 4.0 Server";
break;
}
break;
case 5:
switch (minorVersion)
{
case 0:
name = "Windows 2000";
break;
case 1:
name = "Windows XP";
break;
case 2:
name = "Windows Server 2003";
break;
}
break;
case 6:
switch (minorVersion)
{
case 0:
switch (productType)
{
case 1:
name = "Windows Vista";
break;
case 3:
name = "Windows Server 2008";
break;
}
break;
case 1:
switch (productType)
{
case 1:
name = "Windows 7";
break;
case 3:
name = "Windows Server 2008 R2";
break;
}
break;
case 2:
switch (productType)
{
case 1:
name = "Windows 8";
break;
case 3:
name = "Windows Server 2012";
break;
}
break;
case 3:
switch (productType)
{
case 1:
name = "Windows 8.1";
break;
case 3:
name = "Windows Server 2012 R2";
break;
}
break;
}
break;
case 10:
switch (minorVersion)
{
case 0:
switch (productType)
{
case 1:
name = "Windows 10";
break;
case 3:
name = "Windows Server 2016";
break;
}
break;
}
break;
}
break;
}
}
}
s_Name = name;
return name;
}
}
#endregion NAME
#region PINVOKE
#region GET
#region PRODUCT INFO
[DllImport("Kernel32.dll")]
internal static extern bool GetProductInfo(
int osMajorVersion,
int osMinorVersion,
int spMajorVersion,
int spMinorVersion,
out int edition);
#endregion PRODUCT INFO
#region VERSION
[DllImport("kernel32.dll")]
private static extern bool GetVersionEx(ref OSVERSIONINFOEX osVersionInfo);
#endregion VERSION
#region SYSTEMMETRICS
[DllImport("user32")]
public static extern int GetSystemMetrics(int nIndex);
#endregion SYSTEMMETRICS
#region SYSTEMINFO
[DllImport("kernel32.dll")]
public static extern void GetSystemInfo([MarshalAs(UnmanagedType.Struct)] ref SYSTEM_INFO lpSystemInfo);
[DllImport("kernel32.dll")]
public static extern void GetNativeSystemInfo([MarshalAs(UnmanagedType.Struct)] ref SYSTEM_INFO lpSystemInfo);
#endregion SYSTEMINFO
#endregion GET
#region OSVERSIONINFOEX
[StructLayout(LayoutKind.Sequential)]
private struct OSVERSIONINFOEX
{
public int dwOSVersionInfoSize;
public int dwMajorVersion;
public int dwMinorVersion;
public int dwBuildNumber;
public int dwPlatformId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string szCSDVersion;
public short wServicePackMajor;
public short wServicePackMinor;
public short wSuiteMask;
public byte wProductType;
public byte wReserved;
}
#endregion OSVERSIONINFOEX
#region SYSTEM_INFO
[StructLayout(LayoutKind.Sequential)]
public struct SYSTEM_INFO
{
internal _PROCESSOR_INFO_UNION uProcessorInfo;
public uint dwPageSize;
public IntPtr lpMinimumApplicationAddress;
public IntPtr lpMaximumApplicationAddress;
public IntPtr dwActiveProcessorMask;
public uint dwNumberOfProcessors;
public uint dwProcessorType;
public uint dwAllocationGranularity;
public ushort dwProcessorLevel;
public ushort dwProcessorRevision;
}
#endregion SYSTEM_INFO
#region _PROCESSOR_INFO_UNION
[StructLayout(LayoutKind.Explicit)]
public struct _PROCESSOR_INFO_UNION
{
[FieldOffset(0)]
internal uint dwOemId;
[FieldOffset(0)]
internal ushort wProcessorArchitecture;
[FieldOffset(2)]
internal ushort wReserved;
}
#endregion _PROCESSOR_INFO_UNION
#region 64 BIT OS DETECTION
[DllImport("kernel32", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
public extern static IntPtr LoadLibrary(string libraryName);
[DllImport("kernel32", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
public extern static IntPtr GetProcAddress(IntPtr hwnd, string procedureName);
#endregion 64 BIT OS DETECTION
#region PRODUCT
private const int PRODUCT_UNDEFINED = 0x00000000;
private const int PRODUCT_ULTIMATE = 0x00000001;
private const int PRODUCT_HOME_BASIC = 0x00000002;
private const int PRODUCT_HOME_PREMIUM = 0x00000003;
private const int PRODUCT_ENTERPRISE = 0x00000004;
private const int PRODUCT_HOME_BASIC_N = 0x00000005;
private const int PRODUCT_BUSINESS = 0x00000006;
private const int PRODUCT_STANDARD_SERVER = 0x00000007;
private const int PRODUCT_DATACENTER_SERVER = 0x00000008;
private const int PRODUCT_SMALLBUSINESS_SERVER = 0x00000009;
private const int PRODUCT_ENTERPRISE_SERVER = 0x0000000A;
private const int PRODUCT_STARTER = 0x0000000B;
private const int PRODUCT_DATACENTER_SERVER_CORE = 0x0000000C;
private const int PRODUCT_STANDARD_SERVER_CORE = 0x0000000D;
private const int PRODUCT_ENTERPRISE_SERVER_CORE = 0x0000000E;
private const int PRODUCT_ENTERPRISE_SERVER_IA64 = 0x0000000F;
private const int PRODUCT_BUSINESS_N = 0x00000010;
private const int PRODUCT_WEB_SERVER = 0x00000011;
private const int PRODUCT_CLUSTER_SERVER = 0x00000012;
private const int PRODUCT_HOME_SERVER = 0x00000013;
private const int PRODUCT_STORAGE_EXPRESS_SERVER = 0x00000014;
private const int PRODUCT_STORAGE_STANDARD_SERVER = 0x00000015;
private const int PRODUCT_STORAGE_WORKGROUP_SERVER = 0x00000016;
private const int PRODUCT_STORAGE_ENTERPRISE_SERVER = 0x00000017;
private const int PRODUCT_SERVER_FOR_SMALLBUSINESS = 0x00000018;
private const int PRODUCT_SMALLBUSINESS_SERVER_PREMIUM = 0x00000019;
private const int PRODUCT_HOME_PREMIUM_N = 0x0000001A;
private const int PRODUCT_ENTERPRISE_N = 0x0000001B;
private const int PRODUCT_ULTIMATE_N = 0x0000001C;
private const int PRODUCT_WEB_SERVER_CORE = 0x0000001D;
private const int PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT = 0x0000001E;
private const int PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY = 0x0000001F;
private const int PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING = 0x00000020;
private const int PRODUCT_SERVER_FOUNDATION = 0x00000021;
private const int PRODUCT_HOME_PREMIUM_SERVER = 0x00000022;
private const int PRODUCT_SERVER_FOR_SMALLBUSINESS_V = 0x00000023;
private const int PRODUCT_STANDARD_SERVER_V = 0x00000024;
private const int PRODUCT_DATACENTER_SERVER_V = 0x00000025;
private const int PRODUCT_ENTERPRISE_SERVER_V = 0x00000026;
private const int PRODUCT_DATACENTER_SERVER_CORE_V = 0x00000027;
private const int PRODUCT_STANDARD_SERVER_CORE_V = 0x00000028;
private const int PRODUCT_ENTERPRISE_SERVER_CORE_V = 0x00000029;
private const int PRODUCT_HYPERV = 0x0000002A;
private const int PRODUCT_STORAGE_EXPRESS_SERVER_CORE = 0x0000002B;
private const int PRODUCT_STORAGE_STANDARD_SERVER_CORE = 0x0000002C;
private const int PRODUCT_STORAGE_WORKGROUP_SERVER_CORE = 0x0000002D;
private const int PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE = 0x0000002E;
private const int PRODUCT_STARTER_N = 0x0000002F;
private const int PRODUCT_PROFESSIONAL = 0x00000030;
private const int PRODUCT_PROFESSIONAL_N = 0x00000031;
private const int PRODUCT_SB_SOLUTION_SERVER = 0x00000032;
private const int PRODUCT_SERVER_FOR_SB_SOLUTIONS = 0x00000033;
private const int PRODUCT_STANDARD_SERVER_SOLUTIONS = 0x00000034;
private const int PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE = 0x00000035;
private const int PRODUCT_SB_SOLUTION_SERVER_EM = 0x00000036;
private const int PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM = 0x00000037;
private const int PRODUCT_SOLUTION_EMBEDDEDSERVER = 0x00000038;
private const int PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE = 0x00000039;
//private const int ???? = 0x0000003A;
private const int PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT = 0x0000003B;
private const int PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL = 0x0000003C;
private const int PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC = 0x0000003D;
private const int PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC = 0x0000003E;
private const int PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE = 0x0000003F;
private const int PRODUCT_CLUSTER_SERVER_V = 0x00000040;
private const int PRODUCT_EMBEDDED = 0x00000041;
private const int PRODUCT_STARTER_E = 0x00000042;
private const int PRODUCT_HOME_BASIC_E = 0x00000043;
private const int PRODUCT_HOME_PREMIUM_E = 0x00000044;
private const int PRODUCT_PROFESSIONAL_E = 0x00000045;
private const int PRODUCT_ENTERPRISE_E = 0x00000046;
private const int PRODUCT_ULTIMATE_E = 0x00000047;
//private const int PRODUCT_UNLICENSED = 0xABCDABCD;
#endregion PRODUCT
#region VERSIONS
private const int VER_NT_WORKSTATION = 1;
private const int VER_NT_DOMAIN_CONTROLLER = 2;
private const int VER_NT_SERVER = 3;
private const int VER_SUITE_SMALLBUSINESS = 1;
private const int VER_SUITE_ENTERPRISE = 2;
private const int VER_SUITE_TERMINAL = 16;
private const int VER_SUITE_DATACENTER = 128;
private const int VER_SUITE_SINGLEUSERTS = 256;
private const int VER_SUITE_PERSONAL = 512;
private const int VER_SUITE_BLADE = 1024;
#endregion VERSIONS
#endregion PINVOKE
#region SERVICE PACK
///
/// Gets the service pack information of the operating system running on this computer.
///
static public string ServicePack
{
get
{
string servicePack = String.Empty;
OSVERSIONINFOEX osVersionInfo = new OSVERSIONINFOEX();
osVersionInfo.dwOSVersionInfoSize = Marshal.SizeOf(typeof(OSVERSIONINFOEX));
if (GetVersionEx(ref osVersionInfo))
{
servicePack = osVersionInfo.szCSDVersion;
}
return servicePack;
}
}
#endregion SERVICE PACK
#region VERSION
#region BUILD
///
/// Gets the build version number of the operating system running on this computer.
///
static public int BuildVersion
{
get
{
return int.Parse(RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentBuildNumber", "0"));
}
}
#endregion BUILD
#region FULL
#region STRING
///
/// Gets the full version string of the operating system running on this computer.
///
static public string VersionString
{
get
{
return Version.ToString();
}
}
#endregion STRING
#region VERSION
///
/// Gets the full version of the operating system running on this computer.
///
static public Version Version
{
get
{
return new Version(MajorVersion, MinorVersion, BuildVersion, RevisionVersion);
}
}
#endregion VERSION
#endregion FULL
#region MAJOR
///
/// Gets the major version number of the operating system running on this computer.
///
static public int MajorVersion
{
get
{
if(IsWindows10())
{
return 10;
}
string exactVersion = RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentVersion", "");
if(!string.IsNullOrEmpty(exactVersion))
{
string[] splitVersion = exactVersion.Split('.');
return int.Parse(splitVersion[0]);
}
return Environment.OSVersion.Version.Major;
}
}
#endregion MAJOR
#region MINOR
///
/// Gets the minor version number of the operating system running on this computer.
///
static public int MinorVersion
{
get
{
if (IsWindows10())
{
return 0;
}
string exactVersion = RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentVersion", "");
if (!string.IsNullOrEmpty(exactVersion))
{
string[] splitVersion = exactVersion.Split('.');
return int.Parse(splitVersion[1]);
}
return Environment.OSVersion.Version.Minor;
}
}
#endregion MINOR
#region REVISION
///
/// Gets the revision version number of the operating system running on this computer.
///
static public int RevisionVersion
{
get
{
if(IsWindows10())
{
return 0;
}
return Environment.OSVersion.Version.Revision;
}
}
#endregion REVISION
#endregion VERSION
#region 64 BIT OS DETECTION
private static IsWow64ProcessDelegate GetIsWow64ProcessDelegate()
{
IntPtr handle = LoadLibrary("kernel32");
if (handle != IntPtr.Zero)
{
IntPtr fnPtr = GetProcAddress(handle, "IsWow64Process");
if (fnPtr != IntPtr.Zero)
{
return (IsWow64ProcessDelegate)Marshal.GetDelegateForFunctionPointer((IntPtr)fnPtr, typeof(IsWow64ProcessDelegate));
}
}
return null;
}
private static bool Is32BitProcessOn64BitProcessor()
{
IsWow64ProcessDelegate fnDelegate = GetIsWow64ProcessDelegate();
if (fnDelegate == null)
{
return false;
}
bool isWow64;
bool retVal = fnDelegate.Invoke(Process.GetCurrentProcess().Handle, out isWow64);
if (retVal == false)
{
return false;
}
return isWow64;
}
#endregion 64 BIT OS DETECTION
#region Windows 10 Detection
private static bool IsWindows10()
{
string productName = RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName", "");
if (productName.StartsWith("Windows 10", StringComparison.OrdinalIgnoreCase))
{
return true;
}
return false;
}
#endregion
#region Registry Methods
private static string RegistryRead(string RegistryPath, string Field, string DefaultValue)
{
string rtn = "";
string backSlash = "";
string newRegistryPath = "";
try
{
RegistryKey OurKey = null;
string[] split_result = RegistryPath.Split('\\');
if (split_result.Length > 0)
{
split_result[0] = split_result[0].ToUpper(); // Make the first entry uppercase...
if (split_result[0] == "HKEY_CLASSES_ROOT") OurKey = Registry.ClassesRoot;
else if (split_result[0] == "HKEY_CURRENT_USER") OurKey = Registry.CurrentUser;
else if (split_result[0] == "HKEY_LOCAL_MACHINE") OurKey = Registry.LocalMachine;
else if (split_result[0] == "HKEY_USERS") OurKey = Registry.Users;
else if (split_result[0] == "HKEY_CURRENT_CONFIG") OurKey = Registry.CurrentConfig;
if (OurKey != null)
{
for (int i = 1; i < split_result.Length; i++)
{
newRegistryPath += backSlash + split_result[i];
backSlash = "\\";
}
if (newRegistryPath != "")
{
//rtn = (string)Registry.GetValue(RegistryPath, "CurrentVersion", DefaultValue);
OurKey = OurKey.OpenSubKey(newRegistryPath);
rtn = (string)OurKey.GetValue(Field, DefaultValue);
OurKey.Close();
}
}
}
}
catch { }
return rtn;
}
#endregion Registry Methods
}
}
================================================
FILE: CMWTAT_DIGITAL/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("CMWTAT Digital Edition")]
[assembly: AssemblyDescription("CloudMoe Windows 10+ Activation Toolkit")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CloudMoe Network")]
[assembly: AssemblyProduct("CMWTAT Digital Edition")]
[assembly: AssemblyCopyright("Copyright © CloudMoe Saltfish Studio 2024")]
[assembly: AssemblyTrademark("CloudMoe Saltfish Studio")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 CultureYouAreCodingWith
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.7.2.0")]
[assembly: AssemblyFileVersion("2.7.2.0")]
================================================
FILE: CMWTAT_DIGITAL/Properties/Resources.Designer.cs
================================================
//------------------------------------------------------------------------------
//
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
//
//------------------------------------------------------------------------------
namespace CMWTAT_DIGITAL.Properties {
using System;
///
/// 一个强类型的资源类,用于查找本地化的字符串等。
///
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.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() {
}
///
/// 返回此类使用的缓存的 ResourceManager 实例。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CMWTAT_DIGITAL.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
///
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] ClipUp {
get {
object obj = ResourceManager.GetObject("ClipUp", resourceCulture);
return ((byte[])(obj));
}
}
///
/// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
///
internal static System.Drawing.Icon CMWTAT_ICON {
get {
object obj = ResourceManager.GetObject("CMWTAT_ICON", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
///
/// 查找 System.Byte[] 类型的本地化资源。
///
internal static byte[] slmgr {
get {
object obj = ResourceManager.GetObject("slmgr", resourceCulture);
return ((byte[])(obj));
}
}
}
}
================================================
FILE: CMWTAT_DIGITAL/Properties/Resources.resx
================================================
text/microsoft-resx
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
..\res\clipup.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
..\CMWTAT.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
..\Res\slmgr.vbs;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
================================================
FILE: CMWTAT_DIGITAL/Properties/Settings.Designer.cs
================================================
//------------------------------------------------------------------------------
//
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
//
//------------------------------------------------------------------------------
namespace CMWTAT_DIGITAL.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.11.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;
}
}
}
}
================================================
FILE: CMWTAT_DIGITAL/Properties/Settings.settings
================================================
================================================
FILE: CMWTAT_DIGITAL/app.config
================================================
================================================
FILE: CMWTAT_DIGITAL/app.manifest
================================================
true
================================================
FILE: CMWTAT_DIGITAL/packages.config
================================================
================================================
FILE: CMWTAT_DIGITAL.sln
================================================
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CMWTAT_DIGITAL", "CMWTAT_DIGITAL\CMWTAT_DIGITAL.csproj", "{961DE925-B82C-4515-8FBD-6805E36D1212}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{961DE925-B82C-4515-8FBD-6805E36D1212}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{961DE925-B82C-4515-8FBD-6805E36D1212}.Debug|Any CPU.Build.0 = Debug|Any CPU
{961DE925-B82C-4515-8FBD-6805E36D1212}.Release|Any CPU.ActiveCfg = Release|Any CPU
{961DE925-B82C-4515-8FBD-6805E36D1212}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {653ED007-6FEF-4A82-9898-F60578205F1C}
EndGlobalSection
EndGlobal
================================================
FILE: DirectRun.ps1
================================================
$isAdmin = (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin) {
Start-Process powershell -ArgumentList "irm https://tgsan.github.io/CMWTAT_Digital_Edition/DirectRun.ps1 | iex" -Verb RunAs
Exit
}
# $exePath = ".\CMWTAT_DIGITAL\bin\Debug\CMWTAT_DIGITAL.exe"
# $exeBytes = [System.IO.File]::ReadAllBytes($exePath)
# $bytes = $exeBytes
$bytes = (Invoke-WebRequest "https://tgsan.github.io/CMWTAT_Digital_Edition/CMWTAT_Digital_Release_2_7_2_0.exe").Content
$assembly = [System.Reflection.Assembly]::Load($bytes)
$entryPointMethod = $assembly.EntryPoint
$entryPointMethod.Invoke($null, @())
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Copyright (c) 2018 TGSAN
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C) 2018 TGSAN
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
================================================
FILE: README.en.md
================================================
# Official Site
[https://cmwtat.cloudmoe.com]
# CloudMoe Windows 10+ Activation Toolkit Digital Edition
This toolkit can activate your Windows 10 and Windows 11 use digital license.
A Windows 10 and Windows 11 digital license activation tool written in CSharp.
![UI Screenshot][UI_image]
# Download
## Save Locally and Use
> Since it is flagged by Microsoft Defender as a "Windows activation tool," it may be detected as a threat and automatically deleted after downloading.
1. Download the `.exe` release file from [Releases](https://github.com/TGSAN/CMWTAT_Digital_Edition/releases/latest).
2. Run the file directly.
## Use Directly
> Since it fetches the latest version online every time it starts, the startup time will be slower.
1. Press the `Win + R` key combination to open the Run dialog.
2. Copy the following command into the Run dialog and press Enter.
```
powershell -Command "irm https://tgsan.github.io/CMWTAT_Digital_Edition/DirectRun.ps1 | iex"
```
3. Wait for the fetch to complete, and the tool will start automatically.
# Usage
## Getting started
### Use Auto Mode to activate `Windows 10` or `Windows 11`
1. Download release `.exe` file.
2. Run it.
3. Click `Activate` button.
4. Enjoy it :)
## Advanced
### Switch between different editions of `Windows`
* Note: Currently, it is known that `Windows` `Professional`, `ProfessionalWorkstation`, `Education`, `ProfessionalEducation`, and `Enterprise` editions can be switched between each other (except for N and LTSB editions), and these editions cannot be directly converted to `Home (Core)` edition with one click. If you need to switch, please use the `Upgrade to full version of Windows` function added in version 2.6 (this function only appears on the core edition of the operating system) or use the `Change product key` function in `Windows Settings` to upgrade.
You need to activate the `Enterprise` edition before activating the `IoTEnterprise` edition.
##### Auto Mode
1. Run it.
2. Select `Auto Mode` 。
3. Select the edition you want to upgrade to from the drop-down list.
4. Press the `Convert versions` conversion button.
5. Done.
##### Manual Mode
* Note: This method does not work for activating some versions, such as `Professional Education (ProfessionalEducation)`, even if you enter the corresponding OEM retail key.
1. Run it.
2. Select `Manual Mode`.
3. Enter the OEM retail key corresponding to the version you want to upgrade to in the input box (you do not need the activation key on the product packaging, but the key assigned by Microsoft official, such as the professional version corresponding key is `VK7JG-NPHTM-C97JM-9MPGT-3V66T`).
4. Press the `Convert versions` conversion button.
5. Done.
### Activate a `Windows` edition that is not in the list using `Manual Mode`
1. Run it.
2. Select `Manual Mode`.
3. Enter the OEM retail key corresponding to the version you want to upgrade to in the input box (you do not need the activation key on the product packaging, but the key assigned by Microsoft official, such as the professional version corresponding key is `VK7JG-NPHTM-C97JM-9MPGT-3V66T`).
4. Press the `Activate` conversion button.
5. Done.
## Startup Parameters
```
-? --help Pop up the startup parameter help dialog after startup.
-a --auto Automatically activate the system after startup.
-e --expact Allow the use of experimental schemes when automatically activating the system. (Need to be used with -a or --auto)
-h --hide Start in hidden mode, the activation progress is displayed in the form of notifications. (Need to be used with -a or --auto)
```
# License
[GPL-2.0](./LICENSE)
# Contributors
[https://github.com/TGSAN/CMWTAT_Digital_Edition/graphs/contributors]
[UI_image]:./images/UI.jpg
[https://cmwtat.cloudmoe.com]:https://cmwtat.cloudmoe.com
[https://github.com/TGSAN/CMWTAT_Digital_Edition/graphs/contributors]:https://github.com/TGSAN/CMWTAT_Digital_Edition/graphs/contributors
================================================
FILE: README.md
================================================
# Official Site 官方网站
[https://cmwtat.cloudmoe.com]
# CloudMoe Windows 10+ Activation Toolkit Digital Edition
This toolkit can activate your Windows 10 and Windows 11 use digital license.
此工具可以使用数字权利激活您的 `Windows 10` 和 `Windows 11`。
A Windows 10 and Windows 11 digital license activation tool written in CSharp.
一款使用`CSharp`编写的 `Windows 10` 和 `Windows 11` 数字权利激活工具。
![UI界面截图][UI_image]
# Usage 使用
### [English Readme](./README.en.md)
### [中文 Readme](./README.zh.md)
# License 许可协议
[GPL-2.0](./LICENSE)
# Contributors 贡献者
[https://github.com/TGSAN/CMWTAT_Digital_Edition/graphs/contributors]
[UI_image]:./images/UI.jpg
[https://cmwtat.cloudmoe.com]:https://cmwtat.cloudmoe.com
[https://github.com/TGSAN/CMWTAT_Digital_Edition/graphs/contributors]:https://github.com/TGSAN/CMWTAT_Digital_Edition/graphs/contributors
================================================
FILE: README.zh.md
================================================
# 官方网站
[https://cmwtat.cloudmoe.com]
# 云萌 Windows 10+ 数字权利激活工具
此工具可以使用数字权利激活您的 `Windows 10` 和 `Windows 11`。
一款使用`CSharp`编写的 `Windows 10` 和 `Windows 11` 数字权利激活工具。
![UI界面截图][UI_image]
# 下载
## 保存到本地并使用
> 由于被 Microsoft Defender 标记为 “Windows 激活工具”,所以可能会下载后提示检测到威胁并自动删除。
1. 下载 [Releases](https://github.com/TGSAN/CMWTAT_Digital_Edition/releases/latest) 里的 `.exe` 发行文件。
2. 运行即可。
## 直接使用
> 由于每次启动时都会联网拉取最新版本,所以启动时间会更慢。
> 由于被 Microsoft Defender 标记为 “Windows 激活工具”,所以可能无法执行或报错。
1. 按 `Win + R` 组合键打开运行对话框。
2. 复制以下命令到运行对话框中并按回车键。
```
powershell -Command "irm https://tgsan.github.io/CMWTAT_Digital_Edition/DirectRun.ps1 | iex"
```
> 由于中国大陆部分地区的部分运营商屏蔽了 github.io,如果报错或速度缓慢可以使用以下命令替代
```
powershell -Command "irm https://fastly.jsdelivr.net/gh/TGSAN/CMWTAT_Digital_Edition/CDNDirectRun.ps1 | iex"
```
3. 等待拉取成功后,会自动启动工具。
# 使用
## 入门
### 使用自动模式激活 `Windows 10` 或 `Windows 11`
1. 下载 Releases 里的 `.exe` 发行文件。
2. 运行它。
3. 点按 `激活` 按钮。
4. 完成~
## 进阶
### 在不同版本 `Windows` 之间转换
* 注意: 目前已知 `Windows` 的 `专业版(Professional)`、`专业工作站版(ProfessionalWorkstation)`、`教育版(Education)`、`专业教育版(ProfessionalEducation)`、`企业版(Enterprise)` 之间可以进行互相转换(N版本与LTSB版本除外),而这些版本与`家庭版(Core)`均不能直接一键转换,如需转换请使用 2.6 版本新增的 `升级到完整版 Windows` 功能(此功能仅在核心版操作系统上显示)或使用 `Windows设置` 中的 `更改产品密钥` 功能进行升级。
激活 `物联网企业版(IoTEnterprise)` 版本前需要先激活 `企业版(Enterprise)`。
##### 自动模式
1. 运行它。
2. 选择 `自动模式` 。
3. 在下拉列表中选择要升级到的版本。
4. 点按 `版本无缝转换` 按钮。
5. 完成。
##### 手动模式
* 注意: 此方法不适用于某些版本的激活,如 `专业教育版(ProfessionalEducation)` ,即使你输入了对应的OEM零售密钥。
1. 运行它。
2. 选择 `手动模式` 。
3. 输入框中输入需要升级到的版本对应的OEM零售密钥(不需要产品包装上的激活密钥,而是微软官方分配的密钥,如专业版对应密钥为 `VK7JG-NPHTM-C97JM-9MPGT-3V66T`)。
4. 点按 `版本无缝转换` 按钮。
5. 完成。
### 通过 `手动模式` 激活不在列表中的 `Windows` 版本
1. 运行它。
2. 选择 `手动模式` 。
3. 输入框中输入需要升级到的版本对应的OEM零售密钥(不需要产品包装上的激活密钥,而是微软官方分配的密钥,如专业版对应密钥为 `VK7JG-NPHTM-C97JM-9MPGT-3V66T`)。
4. 点按 `激活` 按钮。
5. 完成。
## 启动参数
```
-? --help 启动后弹出启动参数帮助对话框。
-a --auto 启动后自动激活系统。
-e --expact 自动激活系统时允许使用实验性方案。(需要与 -a 或 --auto 配合使用)
-h --hide 以隐藏模式启动,激活进度以通知形式显示。(需要与 -a 或 --auto 配合使用)
```
# 许可协议
[GPL-2.0](./LICENSE)
# 贡献者
[https://github.com/TGSAN/CMWTAT_Digital_Edition/graphs/contributors]
[UI_image]:./images/UI.jpg
[https://cmwtat.cloudmoe.com]:https://cmwtat.cloudmoe.com
[https://github.com/TGSAN/CMWTAT_Digital_Edition/graphs/contributors]:https://github.com/TGSAN/CMWTAT_Digital_Edition/graphs/contributors
================================================
FILE: _config.yml
================================================
theme: jekyll-theme-cayman
show_downloads: false
title: CloudMoe Windows 10 Toolkit Digital Edition
description: CloudMoe Windows 10 Acivation Toolkit get digital license, the best open source Win 10 activator in GitHub.
GitHub 上最棒的开源 Win10 数字权利(数字许可证)激活工具!
# SEORelate
google_site_verification :
bing_site_verification :
alexa_site_verification :
yandex_site_verification :
tags: [Digital License, Windows 10 Acivation Toolkit, Activator]
navbar-links:
Resources:
- Learn markdown: "http://www.markdowntutorial.com/"
- GitHub Pages: "https://pages.github.com/"