Index: dev/install_python_gtk.ps1 ================================================================== --- dev/install_python_gtk.ps1 +++ dev/install_python_gtk.ps1 @@ -93,11 +93,11 @@ cmd = "" iargs = "/S /D={STREAMRIPPER}" #NSIS does not use double quotes in /D parm regkey = "$regPathLM\Streamripper" testpth= "{STREAMRIPPER}\streamripper.exe" is_opt = '($optionalInstall)' # ← could use '((Ask "Install streamripper too [y/N]") -match N)' instead - prescn = 'if ($optionalInstall) {if ($_found = (Get-ITPV "Streamripper")) {$STREAMRIPPER = $_found}} else {$STREAMRIPPER=""; continue;}' + prescn = 'if ($optionalInstall) {if ($t.found = (Get-ITPV "Streamripper")) {$STREAMRIPPER = $_found}} else {$STREAMRIPPER=""; continue;}' }, @{ title = "Uninstall script" cmd = 'Create-Uninstallscript' }, @@ -196,11 +196,11 @@ } } #-- create Desktop/Startmenu shortcuts function Make-Shortcut { - param($dir, $name, $target, $arg=$false, $parm=$false) + param($dir, $name, $target, $arg=$false, $parm=$false, [parameter(ValueFromRemainingArguments=$true)]$kwargs=0) if (!(Test-Path -Path $dir)) { New-Item -Path $dir -ItemType directory > $null } $wsh = New-Object -ComObject WScript.Shell if (!$wsh) { return } @@ -325,11 +325,11 @@ $t.testpth = $t.testpth -replace "{PYTHON}","$PYTHON" if (!$t.regkey -and !$t.testpth) { continue } if ($t.prescn) { # expression for e.g. registry → path lookup - Invoke-Expression $t.prescn # should set $_found + global $PLACEHOLDER variable + Invoke-Expression $t.prescn # should set $.found + global $PLACEHOLDER variable } elseif ($t.testpth) { if (Test-Path $t.testpth) { $t.found = $t.testpth } @@ -431,11 +431,11 @@ Set-ItemProperty -Path "$regkey" -Name "WindowsInstaller" -Value "0" } } # exe elseif ($file -match ".+.exe$") { - Write-Host -f DarkGray " → $file $iargs" + write-host -f DarkGray " → $file $iargs" if ($iargs) { Start-Process -Wait "$TEMP\$file" -ArgumentList $iargs } else { Start-Process -Wait "$TEMP\$file"