Skip to content

Commit

Permalink
add support for Office 2019
Browse files Browse the repository at this point in the history
  • Loading branch information
jm33-m0 committed Jan 2, 2019
1 parent 8d1a18a commit 0a75a71
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 20 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# kms-activate
Microsoft Windows/Office 一键激活工具,基于kms.jm33.me的KMS服务器

> in case this repo (or even my account) is blocked, please contact me via Telegram if you need the binary
supported versions
## supported versions

- Windows 10 Professional
- Windows 10 Enterprise
Expand All @@ -17,14 +15,19 @@ supported versions
- Windows Server 2012 R2 Datacenter
- Windows Server 2008 R2 Standard
- Windows Server 2008 R2 Enterprise
- Office 2010, 2013, 2016 Professional Plus
- Office 2010, 2013, 2016, 2019

## Office Deployment Tool

you can use [Office Deployment Tool](https://www.microsoft.com/en-us/download/details.aspx?id=49117) to download and install Office (VOL) from Microsoft

NOTE:
## NOTE:

- **Change KMS server** if activation keeps failing
- KMS activation requires a working internet connection, and `kms.jm33.me` or your custom KMS server must be reachable
- Change KMS server if activation keeps failing
- Check `Show debug info` to view log
- Make sure kms server is reachable, and is present in your slmgr.vbs
- Tested on Windows 10 Vol and/or Windows 10 Download Tool edition, it should work in most cases
- Office 2016 Vol is recommended
- Office 2019 Vol is recommended
- Download from [here](https://github.com/jm33-m0/kms-activate/releases)

![](/img/win-activate.JPG)
![screenshot](/img/win-activate.JPG)
49 changes: 38 additions & 11 deletions win10-activate/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System.Security.Principal;
using System.Windows;
using System.Linq;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Security.Principal;
using System.Threading;
using System.IO;
using System.Collections.Generic;
using Microsoft.Win32;
using System;
using System.Windows;

namespace kms_activate
{
Expand Down Expand Up @@ -141,6 +139,14 @@ public void WinActivate()
// which version to activate?
string key = "";
string productName = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName", "").ToString();
if (productName.ToLower().Contains("ultimate"))
// in case you want to activate Windows 7 Ultimate (it's a retail version, which doesn't support VOL at all)
{
MessageBox.Show("Not supported", "Error", MessageBoxButton.OK, MessageBoxImage.Stop);
return;
}


try
{
foreach (string winversion in winKeys.Keys)
Expand Down Expand Up @@ -324,10 +330,14 @@ private void Button_Click(object sender, RoutedEventArgs e)
Application.Current.Shutdown();
}

MessageBoxResult response = MessageBox.Show("Make sure you are using VOL version", "Proceed?", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (response == MessageBoxResult.No)
if (office_option.IsChecked.Value)
// Office has to be vol
{
return;
MessageBoxResult response = MessageBox.Show("Make sure you are using VOL version", "Proceed?", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (response == MessageBoxResult.No)
{
return;
}
}

// Disable all buttons
Expand Down Expand Up @@ -371,21 +381,38 @@ private void Windows_option_Checked(object sender, RoutedEventArgs e)

private void Office_option_Checked(object sender, RoutedEventArgs e)
{
// look for Office's install path, where OSPP.VBS can be found
try
{
button.Content = "Activate ";
RegistryKey localKey;
if (Environment.Is64BitOperatingSystem)
{
localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
}
else
{
localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
}

string officepath = "";
RegistryKey officeBaseKey = localKey.OpenSubKey(@"SOFTWARE\Microsoft\Office");
if (officeBaseKey.OpenSubKey(@"16.0", false) != null)
{
officepath = officeBaseKey.OpenSubKey(@"16.0\Word\InstallRoot").GetValue("Path").ToString();
button.Content += "Office 2016";

if (officepath.Contains("root"))
// Office 2019 can only be installed via Click-To-Run, therefore we get "C:\Program Files\Microsoft Office\root\Office16\",
// otherwise we get "C:\Program Files\Microsoft Office\Office16\"
{
// OSPP.VBS is still in "C:\Program Files\Microsoft Office\Office16\"
officepath = officepath.Replace("root", "");
button.Content += "Office 2019/2016";
}
else
{
button.Content += "Office 2016";
}
}
else if (officeBaseKey.OpenSubKey(@"15.0", false) != null)
{
Expand Down

0 comments on commit 0a75a71

Please sign in to comment.