Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -47,11 +47,11 @@ 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 + --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" \ Index: dev/install_python_gtk.bat ================================================================== --- dev/install_python_gtk.bat +++ dev/install_python_gtk.bat @@ -1,8 +1,23 @@ +@echo off @setlocal enableextensions @cd /d "%~dp0" -@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 ^| 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 -pause Index: dev/install_python_gtk.ps1 ================================================================== --- dev/install_python_gtk.ps1 +++ dev/install_python_gtk.ps1 @@ -54,11 +54,11 @@ "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", + "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" @@ -126,19 +126,17 @@ "", "", "" ), @( - "FINISHED", "", 'Any-Key Green', "", "", "" + "FINISHED", "", 'Display-Logo ; Any-Key Green', "", "", "" ) ) #-- startup messages function Display-Logo { - Clear-Host - Console-MaxHeight Write-Host -b DarkBlue @" _____________________________________________________________________________ | | | _____/\\\\\\\\\\\____/\\\\\\\\\\\\\\\____/\\\\\\\\\_____ | | ___/\\\/////////\\\_\///////\\\/////___/\\\///////\\\___ | @@ -317,10 +315,12 @@ } #-- ask before running +Console-MaxHeight +Clear-Host Display-Logo Warn-NonElevated Ask-First @@ -335,11 +335,11 @@ # 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." + 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 @@ -348,11 +348,11 @@ # get "filename" part from url $file = [regex]::match($url, "/([^/]+?)([\?\#]|$)").Groups[1].Value; # download - if (($url -match "https?://.+") -AND ($keepdownloads -OR !(Test-Path "$TEMP\$file"))) { + 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"); } ADDED dev/uninstall.cmd Index: dev/uninstall.cmd ================================================================== --- dev/uninstall.cmd +++ dev/uninstall.cmd @@ -0,0 +1,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