Skip to content

Commit

Permalink
chocolatey-visualstudio.extension: refactor Start-VisualStudioModifyO…
Browse files Browse the repository at this point in the history
…peration package parameter handling

Move negated argument handling later, so that the original, user-supplied
parameters are accesible longer.

Explain why and when it would be beneficial to use the bootstrapper
instead of the installer.

GitHub-Issue: GH-10
  • Loading branch information
jberezanski committed May 15, 2018
1 parent 3522ab6 commit 96dcec7
Showing 1 changed file with 12 additions and 10 deletions.
Expand Up @@ -61,15 +61,6 @@
}
}

# TODO: move this closer to actual installer/bootstrapper invocation
$baseArgumentSet['norestart'] = ''
if (-not $baseArgumentSet.ContainsKey('quiet') -and -not $baseArgumentSet.ContainsKey('passive'))
{
$baseArgumentSet['quiet'] = ''
}

Remove-NegatedArguments -Arguments $baseArgumentSet -RemoveNegativeSwitches

$argumentSets = ,$baseArgumentSet
if ($baseArgumentSet.ContainsKey('installPath'))
{
Expand Down Expand Up @@ -243,7 +234,10 @@
}
}

# TODO: use bootstrapper if possible (layout or $BootstrapperUrl)
# TODO: use bootstrapper if possible (layout or $BootstrapperUrl) and operation is 'update'
# that way, users can expect that packages using Install-VisualStudio will always call the bootstrapper
# and workload packages will always call the installer, so the users will know which arguments will
# be supported in each case.

if ($installer -eq $null)
{
Expand Down Expand Up @@ -273,6 +267,14 @@
}
}

$argumentSet['norestart'] = ''
if (-not $argumentSet.ContainsKey('quiet') -and -not $argumentSet.ContainsKey('passive'))
{
$argumentSet['quiet'] = ''
}

Remove-NegatedArguments -Arguments $argumentSet -RemoveNegativeSwitches

$blacklist = @('bootstrapperPath', 'installLayoutPath')
Remove-VSPackageParametersNotPassedToNativeInstaller -PackageParameters $argumentSet -TargetDescription 'VS Installer' -Blacklist $blacklist

Expand Down

0 comments on commit 96dcec7

Please sign in to comment.