Implemented .cab format patches.
This commit is contained in:
parent
ff05673dcf
commit
83b984a4ea
16
pkgtool.pm
16
pkgtool.pm
|
@ -935,6 +935,8 @@ sub check_cfg_patchdef ($$)
|
||||||
}
|
}
|
||||||
elsif ($style eq 'msp') {
|
elsif ($style eq 'msp') {
|
||||||
}
|
}
|
||||||
|
elsif ($style eq 'cab') {
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
print_log('pkg', ERROR, 'Unknown patch style at %s', $label.': '.$style);
|
print_log('pkg', ERROR, 'Unknown patch style at %s', $label.': '.$style);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2391,7 +2393,7 @@ sub install_patch ($$$$$$$)
|
||||||
$$vars{patchsuffix} = defined $$patchdef{suffix} ? $$patchdef{suffix} : '';
|
$$vars{patchsuffix} = defined $$patchdef{suffix} ? $$patchdef{suffix} : '';
|
||||||
|
|
||||||
my $style = $$patchdef{style};
|
my $style = $$patchdef{style};
|
||||||
$$vars{patchext} = $style eq 'exe' ? '.exe' : $style eq 'msu' ? '.msu' : $style eq 'msp' ? '.msp' : '';
|
$$vars{patchext} = $style eq 'exe' ? '.exe' : $style eq 'msu' ? '.msu' : $style eq 'msp' ? '.msp' : $style eq 'cab' ? '.cab' : '';
|
||||||
|
|
||||||
my $sourcespec = $$patchdef{'source-file'};
|
my $sourcespec = $$patchdef{'source-file'};
|
||||||
$sourcespec = '%patchprefix%%patchkbname%%patchnum%%patchextra%%patchedition%%patcharch%%patchsuffix%%patchext%' unless defined $sourcespec;
|
$sourcespec = '%patchprefix%%patchkbname%%patchnum%%patchextra%%patchedition%%patcharch%%patchsuffix%%patchext%' unless defined $sourcespec;
|
||||||
|
@ -2435,6 +2437,18 @@ sub install_patch ($$$$$$$)
|
||||||
$exitcode = -1;
|
$exitcode = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elsif ($style eq 'cab') {
|
||||||
|
my $exename = substitute_variables($vars, '%systemroot%/System32/dism.exe', 1, undef, 'pkg');
|
||||||
|
my $paramlist = ['/online', '/add-package', '/packagepath:'.$sourcefile];
|
||||||
|
push @$paramlist, @{$$patchdef{parameters}} if defined $$patchdef{parameters};
|
||||||
|
if (-f $sourcefile) {
|
||||||
|
($error, $exitcode) = run_exe('pkg', $db, $vars, undef, $exename, $paramlist, 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$error = sprintf('Cannot find CAB file %s: %s', $sourcefile, $!);
|
||||||
|
$exitcode = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (defined $error) {
|
if (defined $error) {
|
||||||
if (defined $exitcode && $exitcode == 194) {
|
if (defined $exitcode && $exitcode == 194) {
|
||||||
print_log('pkg', INFO, 'Ignoring patch %s installation exit code: %s', $kb, $exitcode);
|
print_log('pkg', INFO, 'Ignoring patch %s installation exit code: %s', $kb, $exitcode);
|
||||||
|
|
Loading…
Reference in a new issue