diff --git a/automatic/datagrip/tools/ChocolateyInstall.ps1 b/automatic/datagrip/tools/ChocolateyInstall.ps1 index 11485a08a70..ce14e69f5ac 100644 --- a/automatic/datagrip/tools/ChocolateyInstall.ps1 +++ b/automatic/datagrip/tools/ChocolateyInstall.ps1 @@ -2,20 +2,17 @@ $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -# Workaround for https://youtrack.jetbrains.com/issue/IDEA-202935 -$programFiles = (${env:ProgramFiles(x86)}, ${env:ProgramFiles} -ne $null)[0] $pp = Get-PackageParameters -$installDir = "$programFiles\JetBrains\DataGrip $env:ChocolateyPackageVersion" +$silentArgs = "/S /CONFIG=$toolsDir\silent.config " if ($pp.InstallDir) { - $installDir = $pp.InstallDir + # note there are no quotes around the installDir + # (taken from https://www.jetbrains.com/help/datagrip/2023.1/installation-guide.html#silent): + # /D: Specify the path to the installation directory + # This parameter must be the last in the command line, and it should not contain any quotes even if the path contains blank spaces. + $silentArgs += "/D=$($pp.InstallDir)" } -$silentArgs = "/S /CONFIG=$toolsDir\silent.config " -$silentArgs += "/D=`"$installDir`"" - -New-Item -ItemType Directory -Force -Path $installDir - $arguments = @{ packageName = $env:ChocolateyPackageName softwareName = 'JetBrains DataGrip*'