You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by ar...@apache.org on 2009/06/04 20:06:31 UTC

svn commit: r781813 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_6.pm

Author: arkurth
Date: Thu Jun  4 18:06:30 2009
New Revision: 781813

URL: http://svn.apache.org/viewvc?rev=781813&view=rev
Log:
VCL-23
Updated deactivate_license() sub to remove KMS registry keys. These weren't being removed by running slmgr.vbs -ckms.
Added call to deactivate_license() in pre_capture() in Version_6.pm. This needs to be done or else a Vista image which was captured a while ago will have problems when it comes up. The autoadminlogon sequence will fail because an activate now or later screen appears.

Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_6.pm

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_6.pm
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_6.pm?rev=781813&r1=781812&r2=781813&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_6.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_6.pm Thu Jun  4 18:06:30 2009
@@ -135,6 +135,17 @@
 		return 0;
 	}
 
+=item *
+
+Deactivate Windows licensing activation
+
+=cut
+
+	if (!$self->deactivate_license()) {
+		notify($ERRORS{'WARNING'}, 0, "unable to deactivate Windows licensing activation");
+		return 0;
+	}
+
 =back
 
 =cut
@@ -334,6 +345,7 @@
                If failed: false
  Description : Runs cscript.exe slmgr.vbs -ckms to clear the KMS server address
                stored on the computer.
+               Deletes existing KMS servers keys from the registry.
                Runs cscript.exe slmgr.vbs -rearm to rearm licensing on the
                computer.
 
@@ -364,6 +376,24 @@
 		return;
 	}
 	
+	my $registry_string .= <<'EOF';
+Windows Registry Editor Version 5.00
+
+[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SL]
+"KeyManagementServicePort"=-
+"KeyManagementServiceName"=-
+"SkipRearm"=dword:00000001
+EOF
+
+	# Import the string into the registry
+	if ($self->import_registry_string($registry_string)) {
+		notify($ERRORS{'DEBUG'}, 0, "removed kms keys from the registry");
+	}
+	else {
+		notify($ERRORS{'WARNING'}, 0, "failed to remove kms keys from the registry");
+		return 0;
+	}
+	
 	# Run slmgr.vbs -rearm
 	my $rearm_command = '$SYSTEMROOT/System32/cscript.exe //NoLogo $SYSTEMROOT/System32/slmgr.vbs -rearm';
 	my ($rearm_exit_status, $rearm_output) = run_ssh_command($computer_node_name, $management_node_keys, $rearm_command);