|
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105 | title = "Streamripper 1.64.6"
url = "https://netcologne.dl.sourceforge.net/project/streamripper/streamripper%20%28current%29/1.64.6/streamripper-windows-installer-1.64.6.exe"
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;}'
},
@{
title = "Uninstall script"
cmd = 'Create-Uninstallscript'
},
@{
title = "Desktop shortcut" |
|
| 91
92
93
94
95
96
97
98
99
100
101
102
103
104
105 | title = "Streamripper 1.64.6"
url = "https://netcologne.dl.sourceforge.net/project/streamripper/streamripper%20%28current%29/1.64.6/streamripper-windows-installer-1.64.6.exe"
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 ($t.found = (Get-ITPV "Streamripper")) {$STREAMRIPPER = $_found}} else {$STREAMRIPPER=""; continue;}'
},
@{
title = "Uninstall script"
cmd = 'Create-Uninstallscript'
},
@{
title = "Desktop shortcut" |
|
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208 | $host.UI.RawUI.set_bufferSize($MyBuffer)
$host.UI.RawUI.set_windowSize($MyWindow)
}
}
#-- create Desktop/Startmenu shortcuts
function Make-Shortcut {
param($dir, $name, $target, $arg=$false, $parm=$false)
if (!(Test-Path -Path $dir)) {
New-Item -Path $dir -ItemType directory > $null
}
$wsh = New-Object -ComObject WScript.Shell
if (!$wsh) { return }
$lnk = $wsh.CreateShortcut("$dir\$name")
$lnk.TargetPath = $target |
|
| 194
195
196
197
198
199
200
201
202
203
204
205
206
207
208 | $host.UI.RawUI.set_bufferSize($MyBuffer)
$host.UI.RawUI.set_windowSize($MyWindow)
}
}
#-- create Desktop/Startmenu shortcuts
function Make-Shortcut {
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 }
$lnk = $wsh.CreateShortcut("$dir\$name")
$lnk.TargetPath = $target |
|
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337 | ForEach ($t in $tasks) {
$t.found = 0
$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
}
elseif ($t.testpth) {
if (Test-Path $t.testpth) {
$t.found = $t.testpth
}
elseif ($t.regkey -and (Test-Path $t.regkey)) {
$t.found = "installer/registry" |
|
| 323
324
325
326
327
328
329
330
331
332
333
334
335
336
337 | ForEach ($t in $tasks) {
$t.found = 0
$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
}
elseif ($t.testpth) {
if (Test-Path $t.testpth) {
$t.found = $t.testpth
}
elseif ($t.regkey -and (Test-Path $t.regkey)) {
$t.found = "installer/registry" |
|
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443 | Start-Process -Wait msiexec -ArgumentList /i,"$TEMP\$file", $iargs
if ($regkey) {
Set-ItemProperty -Path "$regkey" -Name "WindowsInstaller" -Value "0"
}
}
# exe
elseif ($file -match ".+.exe$") {
Write-Host -f DarkGray " → $file $iargs"
if ($iargs) {
Start-Process -Wait "$TEMP\$file" -ArgumentList $iargs
}
else {
Start-Process -Wait "$TEMP\$file"
}
} |
|
| 429
430
431
432
433
434
435
436
437
438
439
440
441
442
443 | Start-Process -Wait msiexec -ArgumentList /i,"$TEMP\$file", $iargs
if ($regkey) {
Set-ItemProperty -Path "$regkey" -Name "WindowsInstaller" -Value "0"
}
}
# exe
elseif ($file -match ".+.exe$") {
write-host -f DarkGray " → $file $iargs"
if ($iargs) {
Start-Process -Wait "$TEMP\$file" -ArgumentList $iargs
}
else {
Start-Process -Wait "$TEMP\$file"
}
} |
|