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 2010/10/28 16:12:16 UTC

svn commit: r1028304 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm

Author: arkurth
Date: Thu Oct 28 14:12:16 2010
New Revision: 1028304

URL: http://svn.apache.org/viewvc?rev=1028304&view=rev
Log:
VCL-411
Added calls to Windows.pm::post_load and clean_hard_drive to delete the VCL*cmd logon and logoff scripts if they exist.  Added call to remove_group_policy_script to delete the file that was specified.

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

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm?rev=1028304&r1=1028303&r2=1028304&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Thu Oct 28 14:12:16 2010
@@ -751,6 +751,17 @@ sub post_load {
 
 =item *
 
+ Delete legacy VCL logon/logoff scripts
+
+=cut
+	
+	my $system32_path = $self->get_system32_path();
+	if (!$self->delete_files_by_pattern("$system32_path/GroupPolicy/User/Scripts", ".*VCL.*cmd", 2)) {
+		notify($ERRORS{'WARNING'}, 0, "failed to delete legacy VCL logon and logoff scripts");
+	}
+
+=item *
+
  Check if the imagemeta postoption is set to reboot, reboot if necessary
 
 =cut
@@ -5441,7 +5452,7 @@ sub delete_capture_configuration_files {
 	# Delete VCL scheduled task if it exists
 	$self->delete_scheduled_task('VCL Startup Configuration');
 
-	## Remove VCLprepare.cmd and VCLcleanup.cmd lines from scripts.ini file
+	# Remove VCLprepare.cmd and VCLcleanup.cmd lines from scripts.ini file
 	$self->remove_group_policy_script('logon', 'VCLprepare.cmd');
 	$self->remove_group_policy_script('logoff', 'VCLcleanup.cmd');
 
@@ -5753,6 +5764,9 @@ sub remove_group_policy_script {
 	else {
 		$opposite_stage_argument = 'Logon';
 	}
+	
+	# Attempt to delete batch or script files specified by the argument
+	$self->delete_files_by_pattern("$system32_path/GroupPolicy/User/Scripts", ".*$cmdline_argument.*", 2);
 
 	# Path to scripts.ini file
 	my $scripts_ini = $system32_path . '/GroupPolicy/User/Scripts/scripts.ini';
@@ -6283,8 +6297,9 @@ sub clean_hard_drive {
 		'$SYSTEMDRIVE/Documents and Settings,.*Temporary Internet Files\\/Content.*\\/.*,10',
 		'$SYSTEMDRIVE,.*pagefile\\.sys,1',
 		'$SYSTEMDRIVE/cygwin/home/root,.*%USERPROFILE%,1',
+		"$system32_path/GroupPolicy/User/Scripts,.*VCL.*cmd"
 	);
-
+	
 	# Attempt to stop the AFS service, needed to delete AFS files
 	if ($self->service_exists('TransarcAFSDaemon')) {
 		$self->stop_service('TransarcAFSDaemon');