Author: arkurth
Date: Thu Jan 28 19:36:14 2010
New Revision: 904228
URL: http://svn.apache.org/viewvc?rev=904228&view=rev
Log:
VCL-301
Changed Version_6.pm::pre_capture() to use an array and a loop rather than
having many lines calling disable_scheduled_task().
Moved the call to disable the OptinNotification scheduled task from
pre_capture() in Version_6.pm to Vista.pm because it only applies to Vista.
Added Windows 7 and Windows Server 2008 R2 keys to
Version_6.pm::get_kms_client_product_key().
Fixed bug in Version_6.pm::run_slmgr_ipk() where it was calling next instead of
return.
Renamed Version_6.pm::ignore_private_default_routes() to
set_ignore_default_routes(). Updated the code to set
ignoredefaultroutes=enabled on the private interface and
ignoredefaultroutes=disabled on the public interface.
Added Version_7.pm and 7.pm modules for the Windows 7 OS. Version_7.pm is set
to inherit from Version_6.pm because the code works for Windows 7 with few
exceptions.
Added:
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_7/
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_7.pm
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_7/7.pm
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6.pm
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/Vista.pm
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6.pm?rev=904228&r1=904227&r2=904228&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6.pm
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6.pm
Thu Jan 28 19:36:14 2010
@@ -120,37 +120,24 @@
notify($ERRORS{'OK'}, 0, "beginning Windows version 6 image pre-capture
tasks");
-=item *
-
-Disable defrag scheduled task
-
-=cut
-
-
$self->disable_scheduled_task('\Microsoft\Windows\Defrag\ScheduledDefrag');
-
-=item *
-
-Disable system restore scheduled task
-
-=cut
-
- $self->disable_scheduled_task('\Microsoft\Windows\SystemRestore\SR');
-
-=item *
-
-Disable customer improvement program consolidator scheduled task
-
-=cut
-
- $self->disable_scheduled_task('\Microsoft\Windows\Customer Experience
Improvement Program\Consolidator');
-
-=item *
-
-Disable customer improvement program opt-in notification scheduled task
+=item 1
-=cut
+Disable the following scheduled tasks:
- $self->disable_scheduled_task('\Microsoft\Windows\Customer Experience
Improvement Program\OptinNotification');
+ * ScheduledDefrag - This task defragments the computers hard disk drives
+ * SR - This task creates regular system protection points
+ * Consolidator - If the user has consented to participate in the Windows
Customer Experience Improvement Program, this job collects and sends usage data
to Microsoft
+
+=cut
+
+ my @scheduled_tasks = (
+ '\Microsoft\Windows\Defrag\ScheduledDefrag',
+ '\Microsoft\Windows\SystemRestore\SR',
+ '\Microsoft\Windows\Customer Experience Improvement
Program\Consolidator',
+ );
+ for my $scheduled_task (@scheduled_tasks) {
+ $self->disable_scheduled_task($scheduled_task);
+ }
=item *
@@ -213,11 +200,11 @@
=item *
-Ignore default routes configured for the private interface
+Ignore default routes configured for the private interface and use default
routes configured for the public interface
=cut
- $self->ignore_private_default_routes();
+ $self->set_ignore_default_routes();
=item *
@@ -441,18 +428,31 @@
# Create a hash of KMS setup product keys
# These are publically available from Microsoft's Volume Activation 2.0
Deployment Guide
my %kms_product_keys = (
- 'Windows Vista Business' =>
'YFKBB-PQJJV-G996G-VWGXY-2V3X8',
- 'Windows Vista Business N' =>
'HMBQG-8H2RH-C77VX-27R82-VMQBT',
- 'Windows Vista Enterprise' =>
'VKK3X-68KWM-X2YGT-QR4M6-4BWMV',
- 'Windows Vista Enterprise N' =>
'VTC42-BM838-43QHV-84HX6-XJXKV',
- 'Windows Server 2008 Datacenter' =>
'7M67G-PC374-GR742-YH8V4-TCBY3',
- 'Windows Server 2008 Datacenter without Hyper-V' =>
'22XQ2-VRXRG-P8D42-K34TD-G3QQC',
- 'Windows Server 2008 for Itanium-Based Systems' =>
'4DWFP-JF3DJ-B7DTH-78FJB-PDRHK',
- 'Windows Server 2008 Enterprise' =>
'YQGMW-MPWTJ-34KDK-48M3W-X4Q6V',
- 'Windows Server 2008 Enterprise without Hyper-V' =>
'39BXF-X8Q23-P2WWT-38T2F-G3FPG',
- 'Windows Server 2008 Standard' =>
'TM24T-X9RMF-VWXK6-X8JC9-BFGM2',
- 'Windows Server 2008 Standard without Hyper-V' =>
'W7VD6-7JFBR-RX26B-YKQ3Y-6FFFJ',
- 'Windows Web Server 2008' =>
'WYR28-R7TFJ-3X2YQ-YCY4H-M249D',
+ 'Windows Vista Business' =>
'YFKBB-PQJJV-G996G-VWGXY-2V3X8',
+ 'Windows Vista Business N' =>
'HMBQG-8H2RH-C77VX-27R82-VMQBT',
+ 'Windows Vista Enterprise' =>
'VKK3X-68KWM-X2YGT-QR4M6-4BWMV',
+ 'Windows Vista Enterprise N' =>
'VTC42-BM838-43QHV-84HX6-XJXKV',
+ 'Windows Server 2008 Datacenter' =>
'7M67G-PC374-GR742-YH8V4-TCBY3',
+ 'Windows Server 2008 Datacenter without Hyper-V' =>
'22XQ2-VRXRG-P8D42-K34TD-G3QQC',
+ 'Windows Server 2008 for Itanium-Based Systems' =>
'4DWFP-JF3DJ-B7DTH-78FJB-PDRHK',
+ 'Windows Server 2008 Enterprise' =>
'YQGMW-MPWTJ-34KDK-48M3W-X4Q6V',
+ 'Windows Server 2008 Enterprise without Hyper-V' =>
'39BXF-X8Q23-P2WWT-38T2F-G3FPG',
+ 'Windows Server 2008 Standard' =>
'TM24T-X9RMF-VWXK6-X8JC9-BFGM2',
+ 'Windows Server 2008 Standard without Hyper-V' =>
'W7VD6-7JFBR-RX26B-YKQ3Y-6FFFJ',
+ 'Windows Web Server 2008' =>
'WYR28-R7TFJ-3X2YQ-YCY4H-M249D',
+ 'Windows Server 2008 HPC' =>
'RCTX3-KWVHP-BR6TB-RB6DM-6X7HP',
+ 'Windows 7 Professional' =>
'FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4',
+ 'Windows 7 Professional N' =>
'MRPKT-YTG23-K7D7T-X2JMM-QY7MG',
+ 'Windows 7 Professional E' =>
'W82YF-2Q76Y-63HXB-FGJG9-GF7QX',
+ 'Windows 7 Enterprise' =>
'33PXH-7Y6KF-2VJC9-XBBR8-HVTHH',
+ 'Windows 7 Enterprise N' =>
'YDRBP-3D83W-TY26F-D46B2-XCKRJ',
+ 'Windows 7 Enterprise E' =>
'C29WB-22CC8-VJ326-GHFJW-H9DH4',
+ 'Windows Server 2008 R2 Web' =>
'6TPJF-RBVHG-WBW2R-86QPH-6RTM4',
+ 'Windows Server 2008 R2 HPC edition' =>
'FKJQ8-TMCVP-FRMR7-4WR42-3JCD7',
+ 'Windows Server 2008 R2 Standard' =>
'YC6KT-GKW9T-YTKYR-T4X34-R7VHC',
+ 'Windows Server 2008 R2 Enterprise' =>
'489J6-VHDMP-X63PK-3K798-CPX3Y',
+ 'Windows Server 2008 R2 Datacenter' =>
'74YFP-3QFB3-KQT8W-PMXWJ-7M648',
+ 'Windows Server 2008 R2 for Itanium-based Systems' =>
'GT63C-RJFQ3-4GMB6-BRFB9-CB83V',
);
# Get the matching product key from the hash for the product name
@@ -502,11 +502,11 @@
}
elsif (defined($ipk_exit_status)) {
notify($ERRORS{'WARNING'}, 0, "failed to install product key:
$product_key, exit status: $ipk_exit_status, output:\...@{$ipk_output}");
- next;
+ return;
}
else {
notify($ERRORS{'WARNING'}, 0, "failed to execute ssh command to
install product key: $product_key");
- next;
+ return;
}
return 1;
@@ -1400,23 +1400,24 @@
#/////////////////////////////////////////////////////////////////////////////
-=head2 ignore_private_default_routes
+=head2 set_ignore_default_routes
- Parameters : None
+ Parameters : Interface type (public or private), mode (enabled or disabled)
Returns : If successful: true
If failed: false
- Description : Configures computer to ignore default routes configured for the
- private network interface. This is necessary in order for
traffic
- to be correctly routed out of the computer. If default routes
are
- configured for both the public and private interfaces and the
- metric for the private default route is equal to or less than
the
- metric for the public route, traffic originating from the
- computer to the Internet will fail because it will be routed on
- the private interface.
+ Description : Configures the public interface with "ignore default routes =
+ disabled" and the private interface
with "ignore default routes =
+ enabled". This is necessary in order
for traffic to be correctly
+ routed out of the computer. If default
routes are configured for
+ both the public and private interfaces
and the metric for the
+ private default route is equal to or
less than the metric for the
+ public route, traffic originating from
the computer to the
+ Internet will fail because it will be
routed on the private
+ interface.
=cut
-sub ignore_private_default_routes {
+sub set_ignore_default_routes {
my $self = shift;
unless (ref($self) && $self->isa('VCL::Module')) {
notify($ERRORS{'CRITICAL'}, 0, "subroutine can only be called
as a VCL::Module module object method");
@@ -1435,17 +1436,39 @@
}
# Run netsh.exe to configure any default routes configured for the
private interface to be ignored
- my $netsh_command = "netsh.exe interface ip set interface
\"$private_interface_name\" ignoredefaultroutes=enabled";
- my ($netsh_exit_status, $netsh_output) =
run_ssh_command($computer_node_name, $management_node_keys, $netsh_command);
- if (defined($netsh_exit_status) && $netsh_exit_status == 0) {
- notify($ERRORS{'OK'}, 0, "configured interface
\"$private_interface_name\" to ignore default routes");
+ my $private_netsh_command = "netsh.exe interface ip set interface
\"$private_interface_name\" ignoredefaultroutes=enabled";
+ my ($private_netsh_exit_status, $private_netsh_output) =
run_ssh_command($computer_node_name, $management_node_keys,
$private_netsh_command);
+ if (defined($private_netsh_exit_status) && $private_netsh_exit_status
== 0) {
+ notify($ERRORS{'OK'}, 0, "configured interface
\"$private_interface_name\": ignore default routes = enabled");
}
- elsif (defined($netsh_exit_status)) {
- notify($ERRORS{'WARNING'}, 0, "failed to configure interface
\"$private_interface_name\" to ignore default routes, exit status:
$netsh_exit_status, output:\...@{$netsh_output}");
+ elsif (defined($private_netsh_exit_status)) {
+ notify($ERRORS{'WARNING'}, 0, "failed to configure interface
\"$private_interface_name\": ignore default routes = enabled, exit status:
$private_netsh_exit_status, output:\...@{$private_netsh_output}");
+ return;
+ }
+ else {
+ notify($ERRORS{'WARNING'}, 0, "failed to run ssh command to
configure interface \"$private_interface_name\": ignore default routes =
enabled");
+ return;
+ }
+
+ # Get the public interface name
+ my $public_interface_name = $self->get_public_interface_name();
+ if (!$private_interface_name) {
+ notify($ERRORS{'WARNING'}, 0, "unable to determine public
interface name");
+ return;
+ }
+
+ # Run netsh.exe to configure any default routes configured for the
public interface to be used
+ my $public_netsh_command = "netsh.exe interface ip set interface
\"$public_interface_name\" ignoredefaultroutes=disabled";
+ my ($public_netsh_exit_status, $public_netsh_output) =
run_ssh_command($computer_node_name, $management_node_keys,
$public_netsh_command);
+ if (defined($public_netsh_exit_status) && $public_netsh_exit_status ==
0) {
+ notify($ERRORS{'OK'}, 0, "configured interface
\"$public_interface_name\": ignore default routes = disabled");
+ }
+ elsif (defined($public_netsh_exit_status)) {
+ notify($ERRORS{'WARNING'}, 0, "failed to configure interface
\"$public_interface_name\": ignore default routes = disabled, exit status:
$public_netsh_exit_status, output:\...@{$public_netsh_output}");
return;
}
else {
- notify($ERRORS{'WARNING'}, 0, "failed to run ssh command to
configure interface \"$private_interface_name\" to ignore default routes");
+ notify($ERRORS{'WARNING'}, 0, "failed to run ssh command to
configure interface \"$public_interface_name\": ignore default routes =
disabled");
return;
}
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/Vista.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/Vista.pm?rev=904228&r1=904227&r2=904228&view=diff
==============================================================================
---
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/Vista.pm
(original)
+++
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/Vista.pm
Thu Jan 28 19:36:14 2010
@@ -107,8 +107,28 @@
}
notify($ERRORS{'OK'}, 0, "beginning Windows Vista image capture
preparation tasks");
-
- # Prepare the computer for newsid.exe to be run
+
+=item 1
+
+Disable the following scheduled tasks:
+
+ * OptinNotification - This scheduled task prompts the Microsoft Windows
Software Quality Metrics opt-in notification
+
+=cut
+
+ my @scheduled_tasks = (
+ '\Microsoft\Windows\Customer Experience Improvement
Program\OptinNotification',
+ );
+ for my $scheduled_task (@scheduled_tasks) {
+ $self->disable_scheduled_task($scheduled_task);
+ }
+
+=item *
+
+Prepare the computer for newsid.exe to be run
+
+=cut
+
# This shuts down the computer
if (!$self->prepare_newsid()) {
notify($ERRORS{'WARNING'}, 0, "failed to prepare the computer
for newsid.exe to be run");
Added: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_7.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_7.pm?rev=904228&view=auto
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_7.pm
(added)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_7.pm
Thu Jan 28 19:36:14 2010
@@ -0,0 +1,187 @@
+#!/usr/bin/perl -w
+###############################################################################
+# $Id: $
+###############################################################################
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###############################################################################
+
+=head1 NAME
+
+VCL::Module::OS::Windows::Version_7.pm - VCL module to support Windows 7.x
operating systems
+
+=head1 SYNOPSIS
+
+ Needs to be written
+
+=head1 DESCRIPTION
+
+ This module provides VCL support for Windows version 7.x operating systems.
+
+=cut
+
+##############################################################################
+package VCL::Module::OS::Windows::Version_7;
+
+# Specify the lib path using FindBin
+use FindBin;
+use lib "$FindBin::Bin/../../../..";
+
+# Configure inheritance
+# Windows 7 can be configured using the Windows 6 code
+use base qw(VCL::Module::OS::Windows::Version_6);
+
+# Specify the version of this module
+our $VERSION = '2.00';
+
+# Specify the version of Perl to use
+use 5.008000;
+
+use strict;
+use warnings;
+use diagnostics;
+
+use VCL::utils;
+
+##############################################################################
+
+=head1 CLASS VARIABLES
+
+=cut
+
+=head2 $SOURCE_CONFIGURATION_DIRECTORY
+
+ Data type : Scalar
+ Description : Location on management node of script/utilty/configuration
+ files needed to configure the OS. This is normally the
+ directory under the 'tools' directory specific to this OS.
+
+=cut
+
+our $SOURCE_CONFIGURATION_DIRECTORY = "$TOOLS/Windows_Version_7";
+
+##############################################################################
+
+=head1 INTERFACE OBJECT METHODS
+
+=cut
+
+#/////////////////////////////////////////////////////////////////////////////
+
+=head2 pre_capture
+
+ Parameters : None
+ Returns : If successful: true
+ If failed: false
+ Description : Performs steps before an image is captured which are specific to
+ Windows version 7.x.
+
+=over 3
+
+=cut
+
+sub pre_capture {
+ my $self = shift;
+ my $args = shift;
+
+ # Check if subroutine was called as an object method
+ unless (ref($self) && $self->isa('VCL::Module')) {
+ notify($ERRORS{'CRITICAL'}, 0, "subroutine can only be called
as a VCL::Module object method");
+ return;
+ }
+
+=item 1
+
+Call parent class's pre_capture() subroutine
+
+=cut
+
+ notify($ERRORS{'OK'}, 0, "calling parent class pre_capture()
subroutine");
+ if ($self->SUPER::pre_capture($args)) {
+ notify($ERRORS{'OK'}, 0, "successfully executed parent class
pre_capture() subroutine");
+ }
+ else {
+ notify($ERRORS{'WARNING'}, 0, "failed to execute parent class
pre_capture() subroutine");
+ return 0;
+ }
+
+ notify($ERRORS{'OK'}, 0, "beginning Windows version 7 image pre-capture
tasks");
+
+=item 1
+
+Disable the following scheduled tasks:
+
+ * WinSAT - Measures a system's performance and capabilities
+ * RacTask - Microsoft Reliability Analysis task to process system reliability
data
+ * ProgramDataUpdater - Collects program telemetry information if opted-in to
the Microsoft Customer Experience Improvement Program
+ * AitAgent - Aggregates and uploads Application Telemetry information if
opted-in to the Microsoft Customer Experience Improvement Program
+ * KernelCeipTask - The Kernel CEIP (Customer Experience Improvement Program)
task collects additional information about the system and sends this data to
Microsoft
+ * UsbCeip - The USB CEIP (Customer Experience Improvement Program) task
collects Universal Serial Bus related statistics and information about your
machine and sends it to the Windows Device Connectivity engineering group at
Microsoft
+ * Proxy - This task collects and uploads autochk SQM data if opted-in to the
Microsoft Customer Experience Improvement Program
+ * ConfigNotification - This scheduled task notifies the user that Windows
Backup has not been configured
+ * Microsoft-Windows-DiskDiagnosticDataCollector - The Windows Disk Diagnostic
reports general disk and system information to Microsoft for users
participating in the Customer Experience Program
+ * Scheduled - The Windows Scheduled Maintenance Task performs periodic
maintenance of the computer system by fixing problems automatically or
reporting them through the Action Center
+ * RegIdleBackup - Registry Idle Backup Task
+ * AnalyzeSystem - This job analyzes the system looking for conditions that
may cause high energy use.
+ * LPRemove - Launch language cleanup tool
+
+=cut
+
+ my @scheduled_tasks = (
+ '\Microsoft\Windows\Maintenance\WinSAT',
+ '\Microsoft\Windows\RAC\RacTask',
+ '\Microsoft\Windows\Application Experience\ProgramDataUpdater',
+ '\Microsoft\Windows\Application Experience\AitAgent',
+ '\Microsoft\Windows\Customer Experience Improvement
Program\KernelCeipTask',
+ '\Microsoft\Windows\Customer Experience Improvement
Program\UsbCeip',
+ '\Microsoft\Windows\Autochk\Proxy',
+ '\Microsoft\Windows\WindowsBackup\ConfigNotification',
+
'\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector',
+ '\Microsoft\Windows\Diagnosis\Scheduled',
+ '\Microsoft\Windows\Registry\RegIdleBackup',
+ '\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem',
+ '\Microsoft\Windows\MUI\LPRemove',
+ );
+ for my $scheduled_task (@scheduled_tasks) {
+ $self->disable_scheduled_task($scheduled_task);
+ }
+
+=item *
+
+Disable the following services:
+
+ * IP Helper (iphlpsvc) - Provides tunnel connectivity using IPv6 transition
technologies (6to4, ISATAP, Port Proxy, and Teredo), and IP-HTTPS
+ * Function Discovery Resource Publication (FDResPub) - Publishes this
computer and resources attached to this computer so they can be discovered over
the network. If this service is stopped, network resources will no longer be
published and they will not be discovered by other computers on the network.
+=cut
+
+ my @services = (
+ 'iphlpsvc',
+ 'FDResPub',
+ );
+ for my $service (@services) {
+ $self->set_service_startup_mode($service, 'disabled');
+ }
+}
+
+#/////////////////////////////////////////////////////////////////////////////
+
+1;
+__END__
+
+=head1 SEE ALSO
+
+L<http://cwiki.apache.org/VCL/>
+
+=cut
Added:
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_7/7.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_7/7.pm?rev=904228&view=auto
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_7/7.pm
(added)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_7/7.pm
Thu Jan 28 19:36:14 2010
@@ -0,0 +1,137 @@
+#!/usr/bin/perl -w
+###############################################################################
+# $Id: $
+###############################################################################
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###############################################################################
+
+=head1 NAME
+
+VCL::Module::OS::Windows::Version_6::7.pm - VCL module to support Windows 7
operating system
+
+=head1 SYNOPSIS
+
+ Needs to be written
+
+=head1 DESCRIPTION
+
+ This module provides VCL support for Windows 7.
+
+=cut
+
+##############################################################################
+package VCL::Module::OS::Windows::Version_7::7;
+
+# Specify the lib path using FindBin
+use FindBin;
+use lib "$FindBin::Bin/../../../../..";
+
+# Configure inheritance
+use base qw(VCL::Module::OS::Windows::Version_7);
+
+# Specify the version of this module
+our $VERSION = '2.00';
+
+# Specify the version of Perl to use
+use 5.008000;
+
+use strict;
+use warnings;
+use diagnostics;
+
+use VCL::utils;
+
+##############################################################################
+
+=head1 CLASS VARIABLES
+
+=cut
+
+=head2 $SOURCE_CONFIGURATION_DIRECTORY
+
+ Data type : Scalar
+ Description : Location on management node of script/utilty/configuration
+ files needed to configure the OS. This is normally the
+ directory under the 'tools' directory
specific to this OS.
+
+=cut
+
+our $SOURCE_CONFIGURATION_DIRECTORY = "$TOOLS/Windows_7";
+
+##############################################################################
+
+=head1 OBJECT METHODS
+
+=cut
+
+#/////////////////////////////////////////////////////////////////////////////
+
+=head2 pre_capture
+
+ Parameters :
+ Returns :
+ Description :
+
+=cut
+
+sub pre_capture {
+ my $self = shift;
+ my $args = shift;
+ if (ref($self) !~ /windows/i) {
+ notify($ERRORS{'CRITICAL'}, 0, "subroutine was called as a
function, it must be called as a class method");
+ return;
+ }
+
+ # Call parent class's pre_capture() subroutine
+ notify($ERRORS{'OK'}, 0, "calling parent class pre_capture()
subroutine");
+ if ($self->SUPER::pre_capture($args)) {
+ notify($ERRORS{'OK'}, 0, "successfully executed parent class
pre_capture() subroutine");
+ }
+ else {
+ notify($ERRORS{'WARNING'}, 0, "failed to execute parent class
pre_capture() subroutine");
+ return 0;
+ }
+
+ notify($ERRORS{'OK'}, 0, "beginning Windows 7 image capture preparation
tasks");
+
+ # Check if Sysprep should be used
+ if ($self->data->get_imagemeta_sysprep()) {
+ if (!$self->run_sysprep()) {
+ notify($ERRORS{'WARNING'}, 0, "capture preparation
failed, failed to run Sysprep");
+ return;
+ }
+ }
+ else {
+ if (!$self->prepare_post_load()) {
+ notify($ERRORS{'WARNING'}, 0, "capture preparation
failed, failed to run prepare post_load");
+ return;
+ }
+ }
+
+ notify($ERRORS{'OK'}, 0, "returning 1");
+ return 1;
+} ## end sub pre_capture
+
+#/////////////////////////////////////////////////////////////////////////////
+
+1;
+__END__
+
+=head1 SEE ALSO
+
+L<http://cwiki.apache.org/VCL/>
+
+=cut