Skip to content

Instantly share code, notes, and snippets.

@gourytch
Created January 16, 2019 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gourytch/ec318ee99a0a0892e9fe2b917fb54d13 to your computer and use it in GitHub Desktop.
Save gourytch/ec318ee99a0a0892e9fe2b917fb54d13 to your computer and use it in GitHub Desktop.
Create WoW Linked Environment for new sirus account
@echo off
SET "name_uc=%1"
SET "name_lc=%1"
setlocal EnableDelayedExpansion
for %%b in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do set "name_uc=!name_uc:%%b=%%b!"
for %%b in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do set "name_lc=!name_lc:%%b=%%b!"
SET REF=c:\toys\wow-sirus
SET DST=c:\toys\sirus-%name_lc%
SET SHORTCUTS=%USERPROFILE%\Desktop\sirus
SET SHARED=%REF%-shared
SET WINSIZE=1366x768
SET PWS=powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile
MKDIR %DST%
FOR %%F IN (Battle.net.dll dbghelp.dll DivxDecoder.dll ijl15.dll msvcr80.dll Scan.dll unicows.dll) DO MKLINK %DST%\%%F %REF%\%%F
FOR %%F IN (Data Interface) DO MKLINK /D %DST%\%%F %REF%\%%F
REM FOR %%F IN (NoLauncherStart.exe run.exe START.exe) DO COPY %REF%\%%F %DST%\%%F
FOR %%F IN (NoLauncherStart.exe) DO COPY %REF%\%%F %DST%\%%F
MKDIR %DST%\WTF
MKDIR %DST%\WTF\Account
MKDIR %DST%\WTF\Account\%name_uc%
MKLINK /D %DST%\WTF\Account\%name_uc%\SavedVariables %SHARED%\SavedVariables
FOR %%F IN (SavedVariables.lua binding-cache.wtf config-cache.wtf macros-cache.wtf) DO MKLINK %DST%\WTF\Account\%name_uc%\%%F %SHARED%\%%F
REM COPY %SHARED%\Config.wtf %DST%\WTF\Config.wtf
%PWS% -Command "(Get-Content -encoding UTF8 %SHARED%\Config.wtf) -replace 'SET accountName .*','SET accountName ""%name_lc%||false""' -replace 'SET gxWindow .*','SET gxWindow ""1""' -replace 'SET gxMaximize .*','SET gxMaximize ""0""' -replace 'SET windowResizeLock .*','SET windowResizeLock ""1""' -replace 'SET gxResolution .*','SET gxResolution ""%WINSIZE%""' | Out-File -encoding UTF8 %DST%\WTF\Config.wtf"
IF NOT EXIST "%SHORTCUTS%" MKDIR "%SHORTCUTS%"
set TARGET='%DST%\NoLauncherStart.exe'
set SHORTCUT='%SHORTCUTS%\sirus-%name_lc%.lnk'
%PWS% -Command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut(%SHORTCUT%); $S.TargetPath = %TARGET%; $S.Save()"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment