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

⌈⌋ branch:  streamtuner2


Check-in [8740bd6fa0]

Overview
Comment:Add uninstall.cmd / minor changes to win install scripts.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8740bd6fa062306a0b867d80470c23198b6e816d
User & Date: mario on 2016-11-25 00:03:36
Other Links: manifest | tags
Context
2016-11-27
20:42
List windows apps specifically. check-in: eb8bc76a8a user: mario tags: trunk
2016-11-25
00:03
Add uninstall.cmd / minor changes to win install scripts. check-in: 8740bd6fa0 user: mario tags: trunk
2016-11-24
02:07
Merged in new changes, made some defaults into script options. New funcs: Display-Logo, Warn-NonElevated, Ask-First, Console-MaxHeight, Create-UninstallScript, Any-Key, Check-Package. Some colorization fixes. check-in: 94e2f12883 user: mario tags: trunk
Changes

Modified Makefile from [8107f8766f] to [c9ad809e5f].

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
rpm:
	$(PACK) -t $@ $(OPTS) $(DEPS) -p "$(NAME)-VERSION.rpm" st2.py
tar:
	$(PACK) -t $@ $(OPTS) $(DEPS) -p "$(NAME)-VERSION.bin.txz" st2.py
exe:
	$(PACK) -t $@ $(OPTS) $(DEPS) -p "$(NAME)-VERSION.exe" \
	--exe-exec 'usr\share\streamtuner2\dev\install_python_gtk.bat' \
	--exe-dest c:/ --version $(VERSION) help/help.chm dev/install_python_gtk.* dev/*ico st2.py
arch:
	$(PACK) -t $@ $(OPTS) $(DEPS_A) -p "$(NAME)-VERSION.arch.txz" st2.py
pyz:
        #@BUG: relative package references leave a /tmp/doc/ folder
	$(PACK) -u packfile -s src -t zip --zip-shebang "/usr/bin/env python"	\
		-f -p "$(NAME)-$(VERSION).pyz" --prefix=./  .zip.py st2.py
src:







|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
rpm:
	$(PACK) -t $@ $(OPTS) $(DEPS) -p "$(NAME)-VERSION.rpm" st2.py
tar:
	$(PACK) -t $@ $(OPTS) $(DEPS) -p "$(NAME)-VERSION.bin.txz" st2.py
exe:
	$(PACK) -t $@ $(OPTS) $(DEPS) -p "$(NAME)-VERSION.exe" \
	--exe-exec 'usr\share\streamtuner2\dev\install_python_gtk.bat' \
	--exe-dest c:/ --version $(VERSION) help/help.chm dev/{un,}install*.* dev/*ico st2.py
arch:
	$(PACK) -t $@ $(OPTS) $(DEPS_A) -p "$(NAME)-VERSION.arch.txz" st2.py
pyz:
        #@BUG: relative package references leave a /tmp/doc/ folder
	$(PACK) -u packfile -s src -t zip --zip-shebang "/usr/bin/env python"	\
		-f -p "$(NAME)-$(VERSION).pyz" --prefix=./  .zip.py st2.py
src:

Modified dev/install_python_gtk.bat from [e35e73322c] to [78e7dec5ce].


1
2
















3
4
5
6
7
8

@setlocal enableextensions
@cd /d "%~dp0"
















@echo off
cls
PowerShell Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope CurrentUser
PowerShell -File install_python_gtk.ps1
PowerShell Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope CurrentUser
pause
>


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



<
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

21
22
23

@echo off
@setlocal enableextensions
@cd /d "%~dp0"
echo  -----------------------------------------------------------------------------
echo ^|                                                                             ^|
echo ^|       _____/\\\\\\\\\\\____/\\\\\\\\\\\\\\\____/\\\\\\\\\_____              ^|
echo ^|        ___/\\\/////////\\\_\///////\\\/////___/\\\///////\\\___             ^|
echo ^|         __\//\\\______\///________\/\\\_______\///______\//\\\__            ^|
echo ^|          ___\////\\\_______________\/\\\_________________/\\\/___           ^|
echo ^|           ______\////\\\____________\/\\\______________/\\\//_____          ^|
echo ^|            _________\////\\\_________\/\\\___________/\\\//________         ^|
echo ^|             __/\\\______\//\\\________\/\\\_________/\\\/___________        ^|
echo ^|              _\///\\\\\\\\\\\/_________\/\\\________/\\\\\\\\\\\\\\\_       ^|
echo ^|               ___\///////////___________\///________\///////////////__      ^|
echo ^|                                                                             ^|
echo ^|    Streamtuner2 for Windows                               Version 2.2.0     ^|
echo ^|                                                                             ^|
echo ^|    Installer for Python 2.7.12 ^& Gtk 2.24.2                                 ^|
echo  ----------------------------------------------------------------------------- 
echo.

PowerShell Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope CurrentUser
PowerShell -File install_python_gtk.ps1
PowerShell Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope CurrentUser

Modified dev/install_python_gtk.ps1 from [33023cddd1] to [32f46f8f60].

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
...
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
...
315
316
317
318
319
320
321


322
323
324
325
326
327
328
...
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
    "http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/pygtk-all-in-one-2.24.2.win32-py2.7.msi",
    "",
    "TARGETDIR=C:\Python27 ADDLOCAL=ALL REMOVE=PythonExtensionModulePyGtkSourceview2,PythonExtensionModulePyGoocanvas,PythonExtensionModulePyRsvg,DevelopmentTools /qb-!",
    "$regPathLM\{09F82967-D26B-48AC-830E-33191EC177C8}",
    "$regPathLM\{09F82967-D26B-48AC-830E-33191EC177C8}"
  ),
  @(
    "Python requests",
    "requests", # no download url, pip handles this
    "easy_install",
    "",
    "",
    "$PYTHON\Lib\site-packages\requests-2.12.1-py2.7.egg"
  ),
  @(
................................................................................
    "",
    'Make-Shortcut -dir "$StartMenu\Streamtuner2" -name Help.lnk -target "$UsrFolder\share\streamtuner2\help\help.chm"',
    "",
    "",
    ""
  ),
  @(
    "FINISHED", "", 'Any-Key Green', "", "", ""
  )
)


#-- startup messages
function Display-Logo {
    Clear-Host
    Console-MaxHeight
    Write-Host -b DarkBlue @"
 _____________________________________________________________________________ 
|                                                                             |
|       _____/\\\\\\\\\\\____/\\\\\\\\\\\\\\\____/\\\\\\\\\_____              |
|        ___/\\\/////////\\\_\///////\\\/////___/\\\///////\\\___             |
|         __\//\\\______\///________\/\\\_______\///______\//\\\__            |
|          ___\////\\\_______________\/\\\_________________/\\\/___           |
................................................................................
        Write-Host -f Yellow "`nAll required Python components are already installed. You can use 'none' or 'skip' or 'S' to skip them. Or just press ENTER on each following prompt. If you want to reinstall them though, use 'all' or 'reinstall' or 'R'.`n"
    }
}



#-- ask before running


Display-Logo
Warn-NonElevated
Ask-First


#-- process
ForEach ($task in $tasks) {
................................................................................
    Write-Host -b DarkBlue "`n $title `n"
    chdir($TEMP);
    
    # test if element (file path or registry key) already exists:
    if ($reinstall -eq "all") {
    }
    elseif ($testpath -AND (Test-Path -Path $testpath)) {
        echo -f Yellow " → Is already present."
        if ($reinstall -eq "none") { continue }
        Write-Host -f Yellow -NoNewline "   Reinstall [y/N/all/none]? " ; $y = Read-Host ; Write-Host ""
        if ($y -match "^all|always|re|^A") { $reinstall = "all" }
        elseif ($y -match "never|none|skip|^S") { $reinstall = "none"; continue }
        elseif ($y -match "^y|yes|1|go|^R") { } # YES
        else { continue } # everything else counts as NO
    }

    # get "filename" part from url
    $file = [regex]::match($url, "/([^/]+?)([\?\#]|$)").Groups[1].Value;

    # download
    if (($url -match "https?://.+") -AND ($keepdownloads -OR !(Test-Path "$TEMP\$file"))) {
        Write-Host -f DarkGreen  " ← $url"
        $wget = New-Object System.Net.WebClient
        $wget.DownloadFile($url, "$TEMP\$file");
    }

    # run shorthand or custom command
    if ($cmd) {







|







 







|






<
<







 







>
>







 







|












|







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
...
124
125
126
127
128
129
130
131
132
133
134
135
136
137


138
139
140
141
142
143
144
...
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
...
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
    "http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/pygtk-all-in-one-2.24.2.win32-py2.7.msi",
    "",
    "TARGETDIR=C:\Python27 ADDLOCAL=ALL REMOVE=PythonExtensionModulePyGtkSourceview2,PythonExtensionModulePyGoocanvas,PythonExtensionModulePyRsvg,DevelopmentTools /qb-!",
    "$regPathLM\{09F82967-D26B-48AC-830E-33191EC177C8}",
    "$regPathLM\{09F82967-D26B-48AC-830E-33191EC177C8}"
  ),
  @(
    "Python requests 2.12.1",
    "requests", # no download url, pip handles this
    "easy_install",
    "",
    "",
    "$PYTHON\Lib\site-packages\requests-2.12.1-py2.7.egg"
  ),
  @(
................................................................................
    "",
    'Make-Shortcut -dir "$StartMenu\Streamtuner2" -name Help.lnk -target "$UsrFolder\share\streamtuner2\help\help.chm"',
    "",
    "",
    ""
  ),
  @(
    "FINISHED", "", 'Display-Logo ; Any-Key Green', "", "", ""
  )
)


#-- startup messages
function Display-Logo {


    Write-Host -b DarkBlue @"
 _____________________________________________________________________________ 
|                                                                             |
|       _____/\\\\\\\\\\\____/\\\\\\\\\\\\\\\____/\\\\\\\\\_____              |
|        ___/\\\/////////\\\_\///////\\\/////___/\\\///////\\\___             |
|         __\//\\\______\///________\/\\\_______\///______\//\\\__            |
|          ___\////\\\_______________\/\\\_________________/\\\/___           |
................................................................................
        Write-Host -f Yellow "`nAll required Python components are already installed. You can use 'none' or 'skip' or 'S' to skip them. Or just press ENTER on each following prompt. If you want to reinstall them though, use 'all' or 'reinstall' or 'R'.`n"
    }
}



#-- ask before running
Console-MaxHeight
Clear-Host
Display-Logo
Warn-NonElevated
Ask-First


#-- process
ForEach ($task in $tasks) {
................................................................................
    Write-Host -b DarkBlue "`n $title `n"
    chdir($TEMP);
    
    # test if element (file path or registry key) already exists:
    if ($reinstall -eq "all") {
    }
    elseif ($testpath -AND (Test-Path -Path $testpath)) {
        Write-Host -f Green " → Is already present."
        if ($reinstall -eq "none") { continue }
        Write-Host -f Yellow -NoNewline "   Reinstall [y/N/all/none]? " ; $y = Read-Host ; Write-Host ""
        if ($y -match "^all|always|re|^A") { $reinstall = "all" }
        elseif ($y -match "never|none|skip|^S") { $reinstall = "none"; continue }
        elseif ($y -match "^y|yes|1|go|^R") { } # YES
        else { continue } # everything else counts as NO
    }

    # get "filename" part from url
    $file = [regex]::match($url, "/([^/]+?)([\?\#]|$)").Groups[1].Value;

    # download
    if (($url -match "https?://.+") -AND ((!(Test-Path "$TEMP\$file")) -OR (!$keepdownloads))) {
        Write-Host -f DarkGreen  " ← $url"
        $wget = New-Object System.Net.WebClient
        $wget.DownloadFile($url, "$TEMP\$file");
    }

    # run shorthand or custom command
    if ($cmd) {

Added dev/uninstall.cmd version [e2a42cbf23].

















































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
@set installFolder=Do_Not_Change
@set usrFolder=Do_Not_Change
@set Python=Do_Not_Change
@echo off
cls

echo  -----------------------------------------------------------------------------
echo ^|                                                                             ^|
echo ^|       _____/\\\\\\\\\\\____/\\\\\\\\\\\\\\\____/\\\\\\\\\_____              ^|
echo ^|        ___/\\\/////////\\\_\///////\\\/////___/\\\///////\\\___             ^|
echo ^|         __\//\\\______\///________\/\\\_______\///______\//\\\__            ^|
echo ^|          ___\////\\\_______________\/\\\_________________/\\\/___           ^|
echo ^|           ______\////\\\____________\/\\\______________/\\\//_____          ^|
echo ^|            _________\////\\\_________\/\\\___________/\\\//________         ^|
echo ^|             __/\\\______\//\\\________\/\\\_________/\\\/___________        ^|
echo ^|              _\///\\\\\\\\\\\/_________\/\\\________/\\\\\\\\\\\\\\\_       ^|
echo ^|               ___\///////////___________\///________\///////////////__      ^|
echo ^|                                                                             ^|
echo ^|    Streamtuner2 for Windows                               Version 2.2.0     ^|
echo ^|                                                                             ^|
echo ^|    Uninstall                                                                ^|
echo  ----------------------------------------------------------------------------- 
echo.
echo.

setlocal enableextensions
cd /d "%~dp0"

echo Please wait, checking access permission...
echo.
netstat /b >nul
if errorlevel 1 (
	color 0C
	prompt $
	echo You must run the uninstall with administrative privileges
	pause
	exit
)

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

echo This will uninstall Streamtuner2
echo.
echo Do you want to keep your Streamtuner2 settings? (y/n)

set INPUT=
set /P INPUT= %=%
If /I %INPUT%==N (
	echo Deleting personal settings...
	del "%Userprofile%\AppData\Roaming\streamtuner2\*.*" /F /S /Q
)
 
echo Do you want to uninstall Python? (y/n)
set INPUT=
set /P INPUT= %=%
If /I %INPUT%==Y (
	echo Removing LXML
	"%Python%\Removelxml.exe" -u "C:\Python27\lxml-wininst.log"
	echo Removing PIL
	"%Python%\RemovePIL.exe" -u "C:\Python27\PIL-wininst.log"
	echo Removing requests
	"%Python%\scripts\pip.exe" uninstall requests -q <"%UsrFolder%\share\streamtuner2\dev\Y" 1>nul
	echo Removing pyquery
	"%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
	MsiExec.exe /x{09F82967-D26B-48AC-830E-33191EC177C8} /qb-!
	echo Removing Python 27
	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 HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Streamtuner2 /f 1>nul

echo Finished uninstalling Streamtuner2
pause