SpotiWall, Spotify Ad Blocker. Little tool to automatically configure your Windows Firewall to block banners and audio ads in Spotify for Windows.

RequireAdmin

Func IntroText() Local $line1 = "SpotiWall is an ad-blocker for Spotify on Windows." & @CRLF Local $line2 = "It aims to eliminate all banners and audio ads in Spotify." & @CRLF & @CRLF Return $line1 & $line2 EndFunc Func InstallText() Local $line1 = "To do this, SpotiWall will add a rule to" & @CRLF Local $line2 = "the Windows Firewall, which is part of Windows." & @CRLF Local $line3 = "The added rule won't affect any programs other than Spotify." & @CRLF & @CRLF Local $line4 = "Installing SpotiWall is completely safe and the installation" & @CRLF Local $line5 = "can easily be undone by running this installer again." & @CRLF & @CRLF Local $line6 = "Do you want to install SpotiWall?" & @CRLF Return $line1 & $line2 & $line3 & $line4 & $line5 & $line6 EndFunc Func FirewallDisabledText() Local $line1 = "WARNING:" & @CRLF Local $line2 = "Windows Firewall is disabled, probably by some" & @CRLF Local $line3 = "third party firewall/security suite on your computer." & @CRLF Local $line4 = "SpotiWall wil NOT funtion when Windows Firewall is turned off." & @CRLF Local $line5 = "Disabling your third party firewall should cause Windows" & @CRLF Local $line6 = "to prompt you to turn Windows Firewall back on again." & @CRLF & @CRLF Return $line1 & $line2 & $line3 & $line4 & $line5 & $line6 EndFunc Func SpotifyNotFoundText() Local $line1 = "WARNING:" & @CRLF Local $line2 = "Spotify was not found in its default install location." & @CRLF Local $line3 = "Most likely because you haven't installed it yet." & @CRLF Local $line4 = "Just beware that SpotiWall won't work if Spotify was relocated." & @CRLF & @CRLF Return $line1 & $line2 & $line3 & $line4 EndFunc Func CombiWarningText() Local $CombiWarningText = "" If FirewallEnabled() = False Then $CombiWarningText = FirewallDisabledText() EndIf If SpotifyFound() = False Then $CombiWarningText = $CombiWarningText & SpotifyNotFoundText() EndIf Return $CombiWarningText EndFunc Func RebootText() Local $line1 = "Your computer needs to be restarted for the changes to take effect." & @CRLF Local $line2 = "Click ""No"" if you plan to restart later." & @CRLF & @CRLF Local $line3 = "Restart your computer now?" Return $line1 & $line2 & $line3 EndFunc

Func SpotiWallExist() RegRead("HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules","[SpotiWall by ries]") If @error then Return False Else Return True EndIf EndFunc Func SpotifyFound() If FileExists(@AppDataDir & "\Spotify\Spotify.exe") Then Return True Else Return False EndIf EndFunc Func FirewallEnabled() If RegRead("HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile","EnableFirewall")=1 Then Return True Else Return False EndIf EndFunc

Func InstallSpotiWall() Return RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules","[SpotiWall by ries]", "REG_SZ", "v2.25|Action=Block|Active=TRUE|Dir=Out|RA4=2.16.4.0-2.16.4.255|RA4=74.125.136.0-74.125.136.255|RA4=173.194.65.0-173.194.65.255|RA4=23.235.43.0-23.235.43.255|RA4=194.68.165.0-194.68.165.255|App=" & @AppDataDir & "\Spotify\Spotify.exe|Name=SpotiWall by ries|") EndFunc Func RemoveSpotiWall() Return RegDelete("HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules","[SpotiWall by ries]") EndFunc

If Not IsAdmin() then ;prompt to run SpotiWall as an admin MsgBox(0,"SpotiWall v1.0 by ries", "Well, that didn't work." & @CRLF & @CRLF & "Try right-clicking and ""Run as administrator"".") Exit EndIf

If SpotiWallExist() Then ;ask to remove SpotiWall If MsgBox(4, "SpotiWall v1.0 by ries", IntroText() & "SpotiWall is already installed on this computer." & @CRLF & "Do you want to remove it?")=6 Then If RemoveSpotiWall() Then If MsgBox (4, "SpotiWall v1.0 by ries", "SpotiWall was successfully removed." & @CRLF & @CRLF & RebootText()) = 6 Then Shutdown (6) EndIf EndIf Else ;ask to install SpotiWall If MsgBox(4, "SpotiWall v1.0 by ries", IntroText() & InstallText())=6 Then If FirewallEnabled()=False Or SpotifyFound()=False Then ;warn that SpotiWall is not found/Firewall is disabled If MsgBox(4,"SpotiWall v1.0 by ries", CombiWarningText() & @CRLF & "Continue anyway?")=6 Then If InstallSpotiWall() Then If MsgBox (4, "SpotiWall v1.0 by ries", "Nice! SpotiWall was succesfully installed." & @CRLF & @CRLF & RebootText()) = 6 Then Shutdown (6) EndIf EndIf Else If InstallSpotiWall() Then If MsgBox (4, "SpotiWall v1.0 by ries", "Nice! SpotiWall was succesfully installed." & @CRLF & @CRLF & RebootText()) = 6 Then Shutdown (6) EndIf EndIf EndIf EndIf

;MsgBox (0, "SpotiWall Debugger", "SpotiWallExist=" & SpotiWallExist() & @CRLF & "SpotifyFound=" & SpotifyFound() & @CRLF & "FirewallEnabled=" & FirewallEnabled() & @CRLF & @CRLF & CombiWarningText())

/r/Piracy Thread Parent Link - mediafire.com