Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ branch:  streamtuner2


Check-in [66efee91b0]

Overview
Comment:Updated install/uninstall scripts, py-requests path version-independent.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:66efee91b0dcdbf2cc3d3b9829a48d99fa526968
User & Date: mario on 2016-12-02 20:38:06
Other Links: manifest | tags
Context
2016-12-02
20:55
Fix heaps of typos (as reported by Oliver). check-in: c747c1119f user: mario tags: trunk
20:38
Updated install/uninstall scripts, py-requests path version-independent. check-in: 66efee91b0 user: mario tags: trunk
20:37
timer: warning for invalid dates. check-in: 68349f8772 user: mario tags: trunk
Changes

Modified dev/install_python_gtk.ps1 from [b3f784399d] to [0748f98fbb].

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
...
179
180
181
182
183
184
185
186
187
188
189
190

191
192
193
194
195
196
197
...
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
...
228
229
230
231
232
233
234
235
236
237

238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
...
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
...
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
...
375
376
377
378
379
380
381

382
383
384
385
386
387
388
...
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
...
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
  ),
  @(
    "Python requests",
    "requests", # no download url, pip handles this
    "easy_install",
    "",
    "",
    "{PYTHON}\Lib\site-packages\requests-2.12.1-py2.7.egg",
    "",
    ''
  ),
  @(
    "LXML 2.3",
    "https://pypi.python.org/packages/d4/fa/e4e0c7a8fe971b10e275cdc20efd16f553a225e700c400c11da25276e4f4/lxml-2.3-py2.7-win32.egg",
    "easy_install",
................................................................................
|                                                                             |
|    Installer for Python 2.7.12 & Gtk 2.24.2                                 |
 ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– 
"@
}
function Ask-First {
    Write-Host ""
    if ((Ask "Do you want to install Python and Gtk now? [Y/n] ") -notmatch "^[yY]|^$") {
        $tasks = $tasks[7..($tasks.length-1)]
        return
    }
    $reuseCachedFiles = (Ask "Reuse any cached setup files? [r]euse/[I]gnore) ") -match "^[Rr]"

    $optionalInstall =  (Ask "Install optional components? [y/N] ") -match "^[Yy]"
    Write-Host ""
    return $reuseCachedFiles, $optionalInstall
}

function Console-MaxHeight {
    if ($Host.Name -match "console") {
................................................................................
}

#-- create Desktop/Startmenu shortcuts
function Make-Shortcut {
    [CmdletBinding()]
    param($dir, $name, $target, $arg=$false)
    if (!(Test-Path -Path $dir)) {
        New-Item -Path $dir -ItemType directory 2> $null
    }
    $wsh = New-Object -ComObject WScript.Shell
    if (!$wsh) { return }
    $lnk = $wsh.CreateShortcut("$dir\$name")
    $lnk.TargetPath = $target
    if ($arg) {
        $lnk.Arguments = '"'+$arg+'"'
................................................................................
}

#-- create uninstall script and registry key
function Create-Uninstallscript {
    [CmdletBinding()]
    param()
    #Write-Host " → Creating uninstall script"
    $UninstallScriptPath = "$UsrFolder\share\streamtuner2\dev\uninstall.cmd"
    $installFolder = $usrFolder.substring(0,$usrFolder.LastIndexOf('\'))
    $UninstallScript = Get-Content -Path $UninstallScriptPath

    Out-File -FilePath $UninstallScriptPath -Encoding ascii -InputObject "@set installFolder=$installFolder"
    Out-File -FilePath $UninstallScriptPath -Encoding ascii -Append -InputObject "@set usrFolder=$usrFolder"
    Out-File -FilePath $UninstallScriptPath -Encoding ascii -Append -InputObject "@set Python=$PYTHON"
    Out-File -FilePath $UninstallScriptPath -Encoding ascii -Append -InputObject "@set StreamripperFolder=$STREAMRIPPER"
    Out-File -FilePath $UninstallScriptPath -Encoding ascii -Append -InputObject "@echo off"
    for ($i=4; $i -lt $UninstallScript.Length ; $i++) {
        Out-File -FilePath $UninstallScriptPath -Encoding ascii -Append -InputObject $UninstallScript[$i]
    }
    #Out-File -FilePath "$UsrFolder\share\streamtuner2\dev\Y" -Encoding ascii -InputObject "Y"
    #if (Test-IsElevated) {
    #Write-Host "   Writing to registry"
    Remove-Item -Path $regPathCU\Streamtuner2 2> $null        
    New-Item $regPathCU -Name "Streamtuner2" > $null
    Set-Location -Path $regPathCU\Streamtuner2
    New-ItemProperty -Path . -Name DisplayName -PropertyType String -Value "Streamtuner2" > $null
    New-ItemProperty -Path . -Name DisplayVersion -PropertyType String -Value "2.2.0" > $null
    New-ItemProperty -Path . -Name DisplayIcon -PropertyType String -Value "$IconPath" > $null
    New-ItemProperty -Path . -Name UninstallString -PropertyType String -Value "$UninstallPath" > $null
................................................................................
}

#-- colorized Read-Host
function Ask($str) {
    if ($str -cmatch "^(.+?)(\[[a-z/]*)([A-Z]+)([\w/]*\])(.*)$") {
        Write-Host -n -f Yellow     $matches[1] # Want to install
        Write-Host -n -f Gray       $matches[2] # [n/
        Write-Host -n -f DarkCyan   $matches[3] # Y
        Write-Host -n -f Gray       $matches[4] # /a]
        Write-Host -n -f Yellow     $matches[5] # ?
    }
    else {
        Write-Host -n -f Yellow $str
    }
    Read-Host ; Write-Host ""
................................................................................
    ForEach ($task in $tasks) {
        $title, $url, $cmd, $args, $regkey, $checkpath, $is_optional, $presearch, $_found = $task;
        $checkpath = $checkpath -replace "{PYTHON}","$PYTHON"
        if (($is_optional -and !$optionalInstall) -or (!$regkey -and !$checkpath)) {
            continue
        }
        if ($presearch) {  # expression for e.g. registry → path lookup
            Invoke-Expression $presearch # should set $_found + global $PLACEHOLDER variable
        }
        elseif ($checkpath) {
            if (Test-Path $checkpath) {
                $_found = $checkpath
            }
        }
        elseif ($regkey -and (Test-Path $regkey)) {
            $_found = $regkey -replace ".+\\", ""
        }
        if (!$_found) {
            Write-Host "   - $title not found"
            $result = 0;
        }
        else {
            Write-Host -n "   + $title found "  # and display shortened path:
................................................................................
}




#-- ask before running
Clear-Host

Console-MaxHeight
Display-Logo
Check-Package
$PYTHON = Check-PythonInstall
$reuseCachedFiles, $optionalInstall = Ask-First
Check-Prerequisites

................................................................................
    # print step
    if ($title -match "\d+\.\d+") { $title = "Installing $title" }
    Write-Host -b DarkBlue "`n $title `n"
    chdir($TEMP);

    # test if element (file path or registry key) already exists:
    if ($testpath -AND ($reinstall -ne "all") -AND (Test-Path -Path $testpath)) {
        Write-Host -f Green -NoNewline " → Is already present."
        if ($reinstall -eq "none") { continue tasks }
        Switch -regex ( Ask "   Reinstall [y/N/all/none]? " ) {
            "^all|always|re|^A" { $reinstall = "all"; break }
            "never|none|skip|^S" { $reinstall = "none"; continue tasks }
            "^y|yes|1|go|^R" { break } # YES
            ".*" { continue tasks } # everything else counts as NO
        }
................................................................................
            if (!($file)) {
                $cmd = "& `"$PYTHON\Scripts\easy_install.exe`" $url" #"
            }
            else {
                $cmd = "& `"$PYTHON\Scripts\easy_install.exe`" $TEMP\$file" #"
            }
        }
        Write-Host -f DarkYellow   " → $cmd"
        Invoke-Expression "$cmd"
    }
    # msi
    elseif ($file -match ".+.msi$") {
        Write-Host -f DarkYellow (" → msiexec /i " + "$file " + $args)
        Start-Process -Wait msiexec -ArgumentList /i,"$TEMP\$file", $args
        if ($regkey) {
            Set-ItemProperty -Path "$regkey" -Name "WindowsInstaller"  -Value "0"
        }
    }
    # exe
    elseif ($file -match ".+.exe$") {
        write-host -f DarkYellow " → $file $args"
        if ($args) {
            Start-Process -Wait "$TEMP\$file" -ArgumentList $args
        }
        else {
            Start-Process -Wait "$TEMP\$file"
        }
    }







|







 







|

|

|
>







 







|







 







<

|
>
|
|
|
|
|

|

<
<
<







 







|







 







|







|







 







>







 







|







 







|




|







|







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
...
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
...
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
...
229
230
231
232
233
234
235

236
237
238
239
240
241
242
243
244
245
246



247
248
249
250
251
252
253
...
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
...
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
...
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
...
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
...
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
  ),
  @(
    "Python requests",
    "requests", # no download url, pip handles this
    "easy_install",
    "",
    "",
    "{PYTHON}\Lib\site-packages\requests-2*py2.7.egg",
    "",
    ''
  ),
  @(
    "LXML 2.3",
    "https://pypi.python.org/packages/d4/fa/e4e0c7a8fe971b10e275cdc20efd16f553a225e700c400c11da25276e4f4/lxml-2.3-py2.7-win32.egg",
    "easy_install",
................................................................................
|                                                                             |
|    Installer for Python 2.7.12 & Gtk 2.24.2                                 |
 ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––– 
"@
}
function Ask-First {
    Write-Host ""
    if ((Ask "Do you want install Streamtuner2 and its Python dependencies now? [Y/n] ") -notmatch "^[yY]|^$") {
        $tasks = $tasks[7..($tasks.length-1)]
        exit
    }
#   $reuseCachedFiles = (Ask "Reuse any cached setup files? [r]euse/[I]gnore) ") -match "^[Rr]"
    $reuseCachedFiles = (Ask "Reuse any cached setup files or ignore them? [r/I] ") -match "^[Rr]"
    $optionalInstall =  (Ask "Install optional components? [y/N] ") -match "^[Yy]"
    Write-Host ""
    return $reuseCachedFiles, $optionalInstall
}

function Console-MaxHeight {
    if ($Host.Name -match "console") {
................................................................................
}

#-- create Desktop/Startmenu shortcuts
function Make-Shortcut {
    [CmdletBinding()]
    param($dir, $name, $target, $arg=$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
    if ($arg) {
        $lnk.Arguments = '"'+$arg+'"'
................................................................................
}

#-- create uninstall script and registry key
function Create-Uninstallscript {
    [CmdletBinding()]
    param()
    #Write-Host " → Creating uninstall script"

    $installFolder = $usrFolder.substring(0,$usrFolder.LastIndexOf('\'))
    $UninstallScript = Get-Content -Path $UninstallPath
    Out-File -FilePath $UninstallPath -Encoding ascii -InputObject @"
@set installFolder=$installFolder
@set usrFolder=$usrFolder
@set Python=$PYTHON
@set StreamripperFolder=$STREAMRIPPER
"@
    for ($i=4; $i -lt $UninstallScript.Length ; $i++) {
        Out-File -FilePath $UninstallPath -Encoding ascii -Append -InputObject $UninstallScript[$i]
    }



    Remove-Item -Path $regPathCU\Streamtuner2 2> $null        
    New-Item $regPathCU -Name "Streamtuner2" > $null
    Set-Location -Path $regPathCU\Streamtuner2
    New-ItemProperty -Path . -Name DisplayName -PropertyType String -Value "Streamtuner2" > $null
    New-ItemProperty -Path . -Name DisplayVersion -PropertyType String -Value "2.2.0" > $null
    New-ItemProperty -Path . -Name DisplayIcon -PropertyType String -Value "$IconPath" > $null
    New-ItemProperty -Path . -Name UninstallString -PropertyType String -Value "$UninstallPath" > $null
................................................................................
}

#-- colorized Read-Host
function Ask($str) {
    if ($str -cmatch "^(.+?)(\[[a-z/]*)([A-Z]+)([\w/]*\])(.*)$") {
        Write-Host -n -f Yellow     $matches[1] # Want to install
        Write-Host -n -f Gray       $matches[2] # [n/
        Write-Host -n -f Green      $matches[3] # Y
        Write-Host -n -f Gray       $matches[4] # /a]
        Write-Host -n -f Yellow     $matches[5] # ?
    }
    else {
        Write-Host -n -f Yellow $str
    }
    Read-Host ; Write-Host ""
................................................................................
    ForEach ($task in $tasks) {
        $title, $url, $cmd, $args, $regkey, $checkpath, $is_optional, $presearch, $_found = $task;
        $checkpath = $checkpath -replace "{PYTHON}","$PYTHON"
        if (($is_optional -and !$optionalInstall) -or (!$regkey -and !$checkpath)) {
            continue
        }
        if ($presearch) {  # expression for e.g. registry → path lookup
            Invoke-Expression $presearch > $null # should set $_found + global $PLACEHOLDER variable
        }
        elseif ($checkpath) {
            if (Test-Path $checkpath) {
                $_found = $checkpath
            }
        }
        elseif ($regkey -and (Test-Path $regkey)) {
            $_found = "installer/registry"
        }
        if (!$_found) {
            Write-Host "   - $title not found"
            $result = 0;
        }
        else {
            Write-Host -n "   + $title found "  # and display shortened path:
................................................................................
}




#-- ask before running
Clear-Host
$host.ui.RawUI.BackgroundColor = ($bckgrnd = 'Black')
Console-MaxHeight
Display-Logo
Check-Package
$PYTHON = Check-PythonInstall
$reuseCachedFiles, $optionalInstall = Ask-First
Check-Prerequisites

................................................................................
    # print step
    if ($title -match "\d+\.\d+") { $title = "Installing $title" }
    Write-Host -b DarkBlue "`n $title `n"
    chdir($TEMP);

    # test if element (file path or registry key) already exists:
    if ($testpath -AND ($reinstall -ne "all") -AND (Test-Path -Path $testpath)) {
        Write-Host -f DarkGreen -NoNewline " → Is already present."
        if ($reinstall -eq "none") { continue tasks }
        Switch -regex ( Ask "   Reinstall [y/N/all/none]? " ) {
            "^all|always|re|^A" { $reinstall = "all"; break }
            "never|none|skip|^S" { $reinstall = "none"; continue tasks }
            "^y|yes|1|go|^R" { break } # YES
            ".*" { continue tasks } # everything else counts as NO
        }
................................................................................
            if (!($file)) {
                $cmd = "& `"$PYTHON\Scripts\easy_install.exe`" $url" #"
            }
            else {
                $cmd = "& `"$PYTHON\Scripts\easy_install.exe`" $TEMP\$file" #"
            }
        }
        Write-Host -f DarkGray   " → $cmd"
        Invoke-Expression "$cmd"
    }
    # msi
    elseif ($file -match ".+.msi$") {
        Write-Host -f DarkGray (" → msiexec /i " + "$file " + $args)
        Start-Process -Wait msiexec -ArgumentList /i,"$TEMP\$file", $args
        if ($regkey) {
            Set-ItemProperty -Path "$regkey" -Name "WindowsInstaller"  -Value "0"
        }
    }
    # exe
    elseif ($file -match ".+.exe$") {
        write-host -f DarkGray " → $file $args"
        if ($args) {
            Start-Process -Wait "$TEMP\$file" -ArgumentList $args
        }
        else {
            Start-Process -Wait "$TEMP\$file"
        }
    }

Modified dev/uninstall.cmd from [933b04b38b] to [3476a2c2b1].

1
2
3

4
5
6
7
8
9
10
..
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

65

66





67
68
69
70




71








72
73
74


75
76
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92
93
94
95
96
97
98
@set installFolder=Do_not_change
@set usrFolder=Do_not_change
@set Python=Do_not_change

@echo off

>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

if '%errorlevel%' NEQ '0' (
    goto goUAC
)	  else goto goADMIN
................................................................................
    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
    exit /B

:goADMIN
    pushd "%CD%"
    CD /D "%~dp0"



cls

echo  -----------------------------------------------------------------------------
echo ^|                                                                             ^|
echo ^|       _____/\\\\\\\\\\\____/\\\\\\\\\\\\\\\____/\\\\\\\\\_____              ^|
echo ^|        ___/\\\/////////\\\_\///////\\\/////___/\\\///////\\\___             ^|
echo ^|         __\//\\\______\///________\/\\\_______\///______\//\\\__            ^|
echo ^|          ___\////\\\_______________\/\\\_________________/\\\/___           ^|
echo ^|           ______\////\\\____________\/\\\______________/\\\//_____          ^|
................................................................................
echo.
echo.

setlocal enableextensions
cd /d "%~dp0"

if NOT "%cd%" == "%TEMP%" (
	copy "%UsrFolder%\share\streamtuner2\dev\uninstall.cmd" "%temp%\STuninst.cmd" 1>nul 2>&1
	"%temp%\STuninst.cmd"
)

echo | set /p=Do you want to uninstall Streamtuner2 for Windows? (y/n)
set /P INPUT=%=%
If /I NOT %INPUT% == Y exit

echo | set /p=Do you want to keep your Streamtuner2 settings? (y/n)
set /P INPUT=%=%
If /I %INPUT% == N (
	echo Deleting personal settings...
	del "%Userprofile%\AppData\Roaming\streamtuner2\*.*" /F /S /Q
)

 

echo | set /p=Do you want to keep your Python 2.7.12 installation? (y/n)





set /P INPUT=%=%
If /I %INPUT% == N (
	echo Removing LXML 2.3
	"%Python%\Removelxml.exe" -u "%Python%\lxml-wininst.log"




	REM reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\lxml-py2.7 /f 1>nul








	echo Removing PIL 1.1.7
	"%Python%\RemovePIL.exe" -u "%Python%\PIL-wininst.log"
	REM reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PIL-py2.7 /f 1>nul


	echo Removing requests
	"%Python%\scripts\pip.exe" uninstall requests -q <"%UsrFolder%\share\streamtuner2\dev\Y" 1>nul
	echo Removing pyquery 1.2.17
	"%Python%\scripts\pip.exe" uninstall pyquery -q <"%UsrFolder%\share\streamtuner2\dev\Y" 1>nul
	echo Removing cssselect
	"%Python%\scripts\pip.exe" uninstall cssselect -q <"%UsrFolder%\share\streamtuner2\dev\Y" 1>nul
	echo Removing PyGtk 2.24.2
	MsiExec.exe /x{09F82967-D26B-48AC-830E-33191EC177C8} /qb-!
	echo Removing Python 2.7.12
	MsiExec.exe /x{9DA28CE5-0AA5-429E-86D8-686ED898C665} /qb-!

	rd "%Python%"  /S /Q
)

echo Removing Streamtuner2
rd "%installFolder%" /S /Q

echo Removing shortcuts
rd "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Streamtuner2" /S /Q
del "%USERPROFILE%\Desktop\Streamtuner2.lnk" 1>nul

reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Streamtuner2 /f 1>nul

echo Finished uninstalling Streamtuner2
pause



>







 







<
<
<

<







 







|



|

|

|

|



>
|
>
|
>
>
>
>
>

<
<
<
>
>
>
>
|
>
>
>
>
>
>
>
>


<
>
>
|
|
|
|

|




>










|



1
2
3
4
5
6
7
8
9
10
11
..
17
18
19
20
21
22
23



24

25
26
27
28
29
30
31
..
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@set installFolder=Do_not_change
@set usrFolder=Do_not_change
@set Python=Do_not_change
@set StreamripperFolder=Do_not_change
@echo off

>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

if '%errorlevel%' NEQ '0' (
    goto goUAC
)	  else goto goADMIN
................................................................................
    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
    exit /B

:goADMIN
    pushd "%CD%"
    CD /D "%~dp0"



cls

echo  -----------------------------------------------------------------------------
echo ^|                                                                             ^|
echo ^|       _____/\\\\\\\\\\\____/\\\\\\\\\\\\\\\____/\\\\\\\\\_____              ^|
echo ^|        ___/\\\/////////\\\_\///////\\\/////___/\\\///////\\\___             ^|
echo ^|         __\//\\\______\///________\/\\\_______\///______\//\\\__            ^|
echo ^|          ___\////\\\_______________\/\\\_________________/\\\/___           ^|
echo ^|           ______\////\\\____________\/\\\______________/\\\//_____          ^|
................................................................................
echo.
echo.

setlocal enableextensions
cd /d "%~dp0"

if NOT "%cd%" == "%TEMP%" (
	copy "%UsrFolder%\share\streamtuner2\dev\uninstall.cmd" "%temp%\STuninst.cmd" 
	"%temp%\STuninst.cmd"
)

echo | set /p=Do you want to uninstall Streamtuner2 for Windows? [y/N]
set /P INPUT=%=%
If /I NOT '%INPUT%' == 'Y' exit

echo | set /p=Do you want to keep your Streamtuner2 settings? [Y/n]
set /P INPUT=%=%
If /I '%INPUT%' == 'N' (
	echo Deleting personal settings...
	del "%Userprofile%\AppData\Roaming\streamtuner2\*.*" /F /S /Q
)
set INPUT=

if '"%StreamripperFolder%"' NEQ '' ( 
	echo | set /p=Do you want to uninstall Streamripper? [y/N]
	goto uninstallSR
)
goto uninstallPython

:uninstallSR
set /P INPUT=%=%



If /I '%INPUT%' == 'Y'  (
	echo Uninstalling Streamripper...
	"%StreamripperFolder%\Uninstall.exe" /S
 	reg delete HKCU\SOFTWARE\Streamripper /f 1>nul 2>&1
 	reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Streamripper /f 1>nul 2>&1
 	reg delete HKLM\SOFTWARE\WoW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Streamripper /f 1>nul 2>&1
)
set INPUT=

:uninstallPython
echo | set /p=Do you want to keep your Python 2.7.12 installation? [Y/n]
set /P INPUT=%=%
If /I '%INPUT%' == 'N' (
	echo Removing PIL 1.1.7
	"%Python%\RemovePIL.exe" -u "%Python%\PIL-wininst.log"

	echo Removing pyquery 1.2.17
	"%Python%\scripts\pip.exe" uninstall pyquery -y -q
	echo Removing LXML 2.3
	"%Python%\scripts\pip.exe" uninstall lxml -y -q
	echo Removing requests
	"%Python%\scripts\pip.exe" uninstall requests -y -q
	echo Removing cssselect
	"%Python%\scripts\pip.exe" uninstall cssselect -y -q
	echo Removing PyGtk 2.24.2
	MsiExec.exe /x{09F82967-D26B-48AC-830E-33191EC177C8} /qb-!
	echo Removing Python 2.7.12
	MsiExec.exe /x{9DA28CE5-0AA5-429E-86D8-686ED898C665} /qb-!
	reg delete HKCU\SOFTWARE\Python\PythonCore\2.7 /f 1>nul 2>&1
	rd "%Python%"  /S /Q
)

echo Removing Streamtuner2
rd "%installFolder%" /S /Q

echo Removing shortcuts
rd "%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Streamtuner2" /S /Q
del "%USERPROFILE%\Desktop\Streamtuner2.lnk" 1>nul

reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Streamtuner2 /f 1>nul  2>&1

echo Finished uninstalling Streamtuner2
pause