Permalink
Browse files

sysvar programData

- replaced all "C:\ProgramData%\ShokoServer" with "%ProgramData%\ShokoServer"
- added double-quotes across all ProgramData path references, to insure path validity for mkdir and icacls
- replaced redunent [if not exist...] statement with [ else ]
  • Loading branch information...
1ijack committed Feb 18, 2018
1 parent fa69c10 commit 7447f567555362f1cb9ca7a1ad54c94c9c1a98cc
Showing with 6 additions and 8 deletions.
  1. +6 −8 Installers/FixPermissions.bat
@@ -1,21 +1,19 @@
@echo off
title Setting Shoko Server Permissions

if exist "C:\ProgramData\ShokoServer" (
if exist "%ProgramData%\ShokoServer" (
echo Shoko Server folder found, no need to set permissions.
)

if not exist "C:\ProgramData\ShokoServer" (
) else (
netsh advfirewall firewall add rule name="Shoko Server Port" dir=in action=allow protocol=TCP localport=8111
netsh http add urlacl url=http://+:8111/JMMServerPlex sddl=D:(A;;GA;;;S-1-1-0)
netsh http add urlacl url=http://+:8111/JMMServerStreaming sddl=D:(A;;GA;;;S-1-1-0)
netsh http add urlacl url=http://+:8111/JMMServerImage sddl=D:(A;;GA;;;S-1-1-0)
netsh http add urlacl url=http://+:8111/ sddl=D:(A;;GA;;;S-1-1-0)
mkdir C:\ProgramData\ShokoServer
icacls C:\ProgramData\ShokoServer /inheritance:r
icacls C:\ProgramData\ShokoServer /grant *S-1-1-0:(OI)(CI)F /T /inheritance:e
mkdir "%ProgramData%\ShokoServer"
icacls "%ProgramData%\ShokoServer" /inheritance:r
icacls "%ProgramData%\ShokoServer" /grant *S-1-1-0:(OI)(CI)F /T /inheritance:e
)

echo.
echo.
echo Shoko Server permissions correctly applied.
echo Shoko Server permissions correctly applied.

0 comments on commit 7447f56

Please sign in to comment.