Skip to content

Commit

Permalink
KMS is for office 2010 and above
Browse files Browse the repository at this point in the history
  • Loading branch information
jm33-m0 committed Apr 12, 2018
1 parent 1aa2666 commit 696dbf8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Binary file removed img/win-activate-done.JPG
Binary file not shown.
Binary file removed img/win-activate-wait.JPG
Binary file not shown.
Binary file modified img/win-activate.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 11 additions & 6 deletions win10-activate/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public void CheckActivateState(string choice)
MessageBox.Show("Activation failed!", "Failed!", MessageBoxButton.OK, MessageBoxImage.Error);
button.Content = "Retry";
button.IsEnabled = true;
windows_option.IsEnabled = true;
office_option.IsEnabled = true;
CheckBox.IsEnabled = true;
});
}
}
Expand Down Expand Up @@ -297,12 +300,18 @@ public void OfficeActivate()
{
button.Content = "Done! Click to exit";
button.IsEnabled = true;
windows_option.IsEnabled = true;
office_option.IsEnabled = true;
CheckBox.IsEnabled = true;
}
else
{
MessageBox.Show("Activation failed!", "Failed!", MessageBoxButton.OK, MessageBoxImage.Error);
button.Content = "Retry";
button.IsEnabled = true;
windows_option.IsEnabled = true;
office_option.IsEnabled = true;
CheckBox.IsEnabled = true;
}
});
}
Expand Down Expand Up @@ -388,14 +397,10 @@ private void Office_option_Checked(object sender, RoutedEventArgs e)
officepath = officeBaseKey.OpenSubKey(@"14.0\Word\InstallRoot").GetValue("Path").ToString();
button.Content += "Office 2010";
}
else if (officeBaseKey.OpenSubKey(@"12.0", false) != null)
{
officepath = officeBaseKey.OpenSubKey(@"12.0\Word\InstallRoot").GetValue("Path").ToString();
button.Content += "Office 2007";
}
else
{
MessageBox.Show("Could not read Office installation from registry", "Error detecting Office path", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show("Only works with Office 2010 and/or above", "Unsupported version", MessageBoxButton.OK, MessageBoxImage.Error);
button.Content = "Unsupported version";
windows_option.IsChecked = true;
return;
}
Expand Down

0 comments on commit 696dbf8

Please sign in to comment.