#i101955# adapted smoketest to previous HG change 8a7b875f63e1 (smoketestoo_native/config.pl now writes a registrymodifications.xcu); cleaned up

This commit is contained in:
sb
2009-08-28 10:38:55 +02:00
parent 2a01d80fba
commit e335318f7f
5 changed files with 52 additions and 183 deletions

View File

@@ -1,6 +1,3 @@
:
eval 'exec perl -wS $0 ${1+"$@"}'
if 0;
#************************************************************************* #*************************************************************************
# #
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,139 +30,58 @@ eval 'exec perl -wS $0 ${1+"$@"}'
#************************************************************************* #*************************************************************************
use File::Path; use File::Path;
use File::Copy;
### globals ### $branddir = $ARGV[0];
$userinstalldir = $ARGV[1];
$buildid = $ARGV[2];
$is_debug = 0; if ($ENV{GUI} ne "UNX") {
$quickstart = $branddir . "program/quickstart.exe";
$gui = $ENV{GUI}; print "kill $quickstart\n";
$cygwin = "cygwin"; unlink $quickstart or die "cannot unlink $fullquickstart_path";
if ($^O =~ /cygwin/) {
$gui = $cygwin;
} }
if (($gui eq "UNX") or ($gui eq $cygwin)) { $regpath = $userinstalldir . "user";
$pathslash = "/"; $regfile = $regpath . "/registrymodifications.xcu";
} print "create $regfile\n";
else mkpath($regpath, 0, 0777);
{ open (OUT, "> $regfile") or die "cannot open $regfile for writing";
$pathslash = "\\"; print OUT << "EOF";
} <oor:items xmlns:oor='http://openoffice.org/2001/registry'>
<item oor:path='/org.openoffice.Office.Common/Help/Registration'>
#### Hardly coded path for <prop oor:name='ReminderDate'>
# \share\registry\data\org\openoffice\Office\Jobs.xcu <value>Patch$buildid</value>
</prop>
$jobs_XML_Path = "share" . $pathslash . "registry" . $pathslash . "data" . $pathslash . "org" . $pathslash . "openoffice" . $pathslash . "Office" . $pathslash . "Jobs.xcu"; </item>
<item oor:path='/org.openoffice.Office.Common/Misc'>
# \user\registry\data\org\openoffice\ <prop oor:name='FirstRun'>
<value>false</value>
$User_Path = "user" . $pathslash . "registry" . $pathslash . "data" . $pathslash . "org" . $pathslash . "openoffice" . $pathslash; </prop>
</item>
# \user\registry\data\org\openoffice\Office\ <item oor:path='/org.openoffice.Office.Common/Security/Scripting'>
<prop oor:name='MacroSecurityLevel'>
$User_Office_Path = $User_Path . "Office" . $pathslash; <value>0</value>
</prop>
# \user\registry\data\org\openoffice\Office\OOoImprovement <prop oor:name='OfficeBasic'>
<value>2</value>
$OOoImprovement_Path = $User_Office_Path . "OOoImprovement" . $pathslash; </prop>
</item>
$common_XML = "Common.xcu"; <item oor:path='/org.openoffice.Office.OOoImprovement.Settings/Participation'>
$setup_XML = "Setup.xcu"; <prop oor:name='InvitationAccepted'>
$oooimprovement_XML = "Settings.xcu"; <value>false</value>
</prop>
# $(INPATH)\misc\Common.xcu <prop oor:name='ShowedInvitation'>
$inpath_Common_XCU = $ENV{INPATH} . $pathslash . "misc" . $pathslash . $common_XML; <value>true</value>
</prop>
### main ### </item>
<item oor:path='/org.openoffice.Setup/Office'>
$idStr = ' $Revision: 1.5 $ '; <prop oor:name='FirstStartWizardCompleted'>
$idStr =~ /Revision:\s+(\S+)\s+\$/ <value>true</value>
? ($cpflat2minor_rev = $1) : ($cpflat2minor_rev = "-"); </prop>
<prop oor:name='LicenseAcceptDate'>
if ( ($#ARGV >= 3) ) { <value>2100-01-01T00:00:00</value>
$ARGV[0] =~ s/\"//g; </prop>
$ARGV[1] =~ s/\"//g; </item>
$ARGV[2] =~ s/\"//g; </oor:items>
$ARGV[3] =~ s/\"//g; EOF
chop($ARGV[0]); close OUT;
chop($ARGV[1]);
chop($ARGV[2]);
chop($ARGV[3]);
}
if ( ! ( ($#ARGV >= 4) && $ARGV[0] && $ARGV[1] && $ARGV[2] && $ARGV[3] && (-d $ARGV[3]) && $ARGV[4] ) ) {
print "Usage: config <basispath> <brandpath> <userinstallpath> <datapath> <buildid>\n" ;
exit(1);
}
$basisdir = $ARGV[0];
$branddir = $ARGV[1];
$userinstalldir = $ARGV[2];
$datapath = $ARGV[3];
$buildid = $ARGV[4];
$fullquickstart_path = $branddir . "program" . $pathslash . "quickstart.exe";
print "patching config ... \n";
if (!-d "$userinstalldir$User_Office_Path") {
mkpath("$userinstalldir$User_Office_Path", 0, 0777);
}
if (!-d "$userinstalldir$OOoImprovement_Path") {
mkpath("$userinstalldir$OOoImprovement_Path", 0, 0777);
}
# copy Common.xcu
print "Patching Common.xcu\n" if $is_debug;
PatchCommonXcu($buildid);
print "cp $inpath_Common_XCU $userinstalldir$User_Office_Path$common_XML\n" if $is_debug;
copy ("$inpath_Common_XCU", "$userinstalldir$User_Office_Path$common_XML");
# copy OOoImprovement/Settings.xcu
print "cp $datapath$oooimprovement_XML $userinstalldir$OOoImprovement_Path$oooimprovement_XML\n" if $is_debug;
copy ("$datapath$oooimprovement_XML", "$userinstalldir$OOoImprovement_Path$oooimprovement_XML");
# copy Setup.xcu
print "cp $datapath$setup_XML $userinstalldir$User_Path$setup_XML\n" if $is_debug;
copy ("$datapath$setup_XML", "$userinstalldir$User_Path$setup_XML");
# quickstarter loeschen
if ($gui ne "UNX") {
print "kill $fullquickstart_path \n";
unlink( $fullquickstart_path ) or die "cannot unlink $fullquickstart_path";
}
#delete joblist
$fullsource_path = $basisdir . $jobs_XML_Path;
unlink ($fullsource_path);
exit(0);
############################################################################
sub PatchCommonXcu #17.04.2009 10:37
############################################################################
{
my $buildid = shift;
open(INFILE, "< $datapath$common_XML") || die "Can't open $datapath$common_XML (read)\n";
open(OUTFILE, "> $inpath_Common_XCU") || die "Can't open $inpath_Common_XCU (write)\n";
my $patch_next_line = 0;
my $value = "<value>Patch" . $buildid . "</value>\n";
while ( $line = <INFILE> ) {
if ( $patch_next_line ) {
print OUTFILE " $value";
$patch_next_line = 0;
} else
{
print OUTFILE $line;
}
if ( $line =~ /ReminderDate/ ) {
$patch_next_line = 1;
}
}
close(INFILE);
close(OUTFILE);
} ##PatchCommonXcu

View File

@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:package="org.openoffice.Office" oor:name="Common">
<node oor:name="Misc">
<prop oor:name="FirstRun" oor:type="xs:boolean">
<value>false</value>
</prop>
</node>
<node oor:name="Security">
<node oor:name="Scripting">
<prop oor:name="OfficeBasic" oor:type="xs:int">
<value>2</value>
</prop>
<prop oor:name="MacroSecurityLevel" oor:type="xs:int">
<value>0</value>
</prop>
</node>
</node>
<node oor:name="Help">
<node oor:name="Registration">
<prop oor:name="ReminderDate">
<value/>
</prop>
</node>
</node>
</oor:component-data>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Settings" oor:package="org.openoffice.Office.OOoImprovement">
<node oor:name="Participation">
<prop oor:name="ShowedInvitation" oor:type="xs:boolean">
<value>true</value>
</prop>
<prop oor:name="InvitationAccepted" oor:type="xs:boolean">
<value>false</value>
</prop>
</node>
</oor:component-data>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Setup" oor:package="org.openoffice">
<node oor:name="Office">
<prop oor:name="LicenseAcceptDate" oor:type="xs:string">
<value>2100-01-01T00:00:00</value>
</prop>
<prop oor:name="FirstStartWizardCompleted" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</oor:component-data>

View File

@@ -488,7 +488,7 @@ sub doTest {
# patch config (error 3) # patch config (error 3)
$Command = "$PERL config.pl \"$basisdir \" \"$branddir \" \"$userinstallpath \" \"$DATA \" \"$buildid\""; $Command = "$PERL config.pl \"$branddir\" \"$userinstallpath\" \"$buildid\"";
execute_Command ($Command, $error_patchConfig, $show_Message, $command_normal ); execute_Command ($Command, $error_patchConfig, $show_Message, $command_normal );
# copy basicscripts (error 9) # copy basicscripts (error 9)