Fixed restart question for .cab patch installations.

Gave version matching the option to depend on package name as well.
This commit is contained in:
László Valkó 2021-01-23 03:31:17 +01:00
parent d3214cabd9
commit 532b679a4d

View file

@ -1400,7 +1400,7 @@ sub match_package_version ($$$$)
my $matchvercond = $$def{'match-version-condition'};
my $matchversion = $$def{'match-version'};
if (defined $matchvercond) {
my ($value, $error) = evaluate_expression('global', $vars, { version => $instver }, $matchvercond);
my ($value, $error) = evaluate_expression('global', $vars, { version => $instver, name => $$inst{Name} }, $matchvercond);
if (defined $error && $error ne '') {
print_log('global', WARNING, 'Evaluating version match condition expression %s failed: %s',
@ -3016,7 +3016,7 @@ sub install_patch ($$$$$$$)
}
elsif ($style eq 'cab') {
my $exename = substitute_variables($vars, '%systemroot%/System32/dism.exe', 1, undef, 'pkg');
my $paramlist = ['/online', '/add-package', '/packagepath:'.$sourcefile];
my $paramlist = ['/online', '/add-package', '/packagepath:'.$sourcefile, '/norestart'];
push @$paramlist, @{$$patchdef{parameters}} if defined $$patchdef{parameters};
if (-f $sourcefile) {
($error, $exitcode) = run_exe('pkg', $db, $vars, undef, $exename, $paramlist, 0);