Check if activated before getting the BIOS key
This commit is contained in:
parent
bc320b4d87
commit
528602d98e
1 changed files with 5 additions and 4 deletions
|
|
@ -72,6 +72,11 @@ def activate_with_bios():
|
|||
#####################################################
|
||||
bios_key = None
|
||||
table = b"MSDM"
|
||||
# Check if activation is needed
|
||||
if is_activated():
|
||||
raise GenericWarning('System already activated')
|
||||
|
||||
# Get BIOS key
|
||||
if acpi.FindAcpiTable(table) is True:
|
||||
rawtable = acpi.GetAcpiTable(table)
|
||||
#http://msdn.microsoft.com/library/windows/hardware/hh673514
|
||||
|
|
@ -82,10 +87,6 @@ def activate_with_bios():
|
|||
if not bios_key:
|
||||
raise GenericError('BIOS key not found.')
|
||||
|
||||
# Check if activation is needed
|
||||
if is_activated():
|
||||
raise GenericWarning('System already activated')
|
||||
|
||||
# Install Key
|
||||
cmd = ['cscript', '//nologo', SLMGR, '/ipk', bios_key]
|
||||
run_program(cmd, check=False)
|
||||
|
|
|
|||
Loading…
Reference in a new issue