WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   How to remove unused addons lua settings (https://www.wowinterface.com/forums/showthread.php?t=55399)

gmarco 05-15-17 11:13 PM

How to remove unused addons lua settings
 
Hi,
once there was the old curse client that have a function to delete the unused (not present anymore) addons setting *.lua and *.bak .
This very handy functionality was removed in the new Curse/Twitch client. I don't find in Minion either.

So I am here to ask if there is a program, a batch file, something that could do the job.

Thanks.

Fizzlemizz 05-15-17 11:21 PM

Sort by date modifed and delete the ones not updated when you last exited WoW + all the .bak files, as far as I know, they've never been used but they will come back for current addons.

Edit: I don't believe any Blizzard (non addon) information is stored in .lua files (.wtf, .txt and .md5) so a search in Explorer from the WTF\Account level for *.lua and *.bak should get them all in two sweeps.

Kanegasi 05-16-17 08:36 AM

I deleted an addon several weeks ago using the Twitch-branded Curse Client and it asked me about the saved variables as usual. I may have to double check if they were actually deleted or something very recently changed.

jeffy162 05-16-17 03:33 PM

The " Curse Client" never did delete ALL saved variables. If the addon created SV's per character, also, the Client never deleted them. It was pretty good otherwise. I don't know anything at all about the Twitch Client as my computer got fried in late August of last year (2016) and I don't know when I'll have the resources to replace it.

SDPhantom 05-16-17 10:24 PM

I wrote this Windows Command script a long time ago to get rid of extraneous backup files and abandoned saved variables.

Code:

@echo off
pushd "C:\Program Files (x86)\World of Warcraft\WTF\Account"

del /s *.bak
del /s *.old

for /d %%i in (*) do (
        if exist %%i\SavedVariables\ (
                echo Account: %%i

                for %%j in ("%%i\SavedVariables\*.lua") do (
                        echo %%~nj | findstr /r /i "^Blizzard_" > nul
                        if errorlevel 1 (
                                echo GlobalSV: %%~nj
                                if not exist ..\..\Interface\AddOns\%%~nj\ (
                                        echo Delete: %%~nj
                                        del "%%j"
                                )
                        )
                )

                for /d %%j in ("%%i\*") do (
                        for /d %%k in ("%%j\*") do (
                                echo Character: %%k
                                for %%l in ("%%k\SavedVariables\*.lua") do (
                                        echo %%~nl | findstr /r /i "^Blizzard_" > nul
                                        if errorlevel 1 (
                                                echo CharSV: %%~nl
                                                if not exist ..\..\Interface\AddOns\%%~nl\ (
                                                        echo Delete: %%~nl
                                                        del "%%l"
                                                )
                                        )
                                )
                        )
                )
        )
)

popd
pause

It scans through the SavedVar directories and checks if each Lua file has a matching addon folder name. If it doesn't, the file is deleted.
Make sure the initial pushd is pointing to your WoW account directory. The path I used is the default.

Kanegasi 05-16-17 10:38 PM

That is fantastic. Just tested it, cleaned a few files out but everything else is still there. Good work.

gmarco 05-17-17 12:18 AM

I agree.

This is reaaaallly fantastic :)

P.s.
Probably we could avoid the delete of the Blizzard related settings ?

CharSV: Blizzard_ClientSavedVariables
Delete: Blizzard_ClientSavedVariables
CharSV: Blizzard_RaidUI
Delete: Blizzard_RaidUI
CharSV: Blizzard_TimeManager
Delete: Blizzard_TimeManager

Or it is safe to delete ? :)

SDPhantom 05-17-17 10:13 AM

Quote:

Originally Posted by gmarco (Post 323428)
Probably we could avoid the delete of the Blizzard related settings ?

CharSV: Blizzard_ClientSavedVariables
Delete: Blizzard_ClientSavedVariables
CharSV: Blizzard_RaidUI
Delete: Blizzard_RaidUI
CharSV: Blizzard_TimeManager
Delete: Blizzard_TimeManager

In my experience, Blizzard keeps recreating empty folders for internal LoD addons, so they shouldn't be marked for deletion. I modified the script I posted earlier to run a regex match and skip Blizzard addons.

myrroddin 05-17-17 03:03 PM

That looks like an old DOS script. Would I save that as something.bat or somesuch?

Cidrei 05-17-17 04:06 PM

There's actually a utility called WoWClean on this very site that was uploaded back in 2006 that does this. I've used it for years and never had a problem with it. Also comes with the source if anyone wanted to modify/check it out.

VincentSDSH 05-17-17 07:54 PM

Quote:

Originally Posted by myrroddin (Post 323432)
That looks like an old DOS script. Would I save that as something.bat or somesuch?

Yes, it's just a happy little batch file.

SDPhantom 05-18-17 07:41 AM

Quote:

Originally Posted by myrroddin (Post 323432)
That looks like an old DOS script. Would I save that as something.bat or somesuch?

.cmd is technically the extension to use in WinNT-derived (2000, XP, and newer) systems, though .bat still works for legacy support with no real difference between them. The Windows Command interface does work a lot like DOS, but has very limited support for DOS programs.



Quote:

Originally Posted by Cidrei (Post 323434)
There's actually a utility called WoWClean on this very site that was uploaded back in 2006 that does this. I've used it for years and never had a problem with it. Also comes with the source if anyone wanted to modify/check it out.

I might take a look at the source. The author commented that it has couple known issues.

myrroddin 06-01-17 05:20 AM

I finally got around to using SDPhantom's script, which I modified the path to my WoW directory. It worked flawlessly, as far as I can tell.

myrroddin 11-15-17 09:20 PM

Random improvement thought for SDPhantom's script, although I have long forgotten how it would be done: is there a way to @echo which SV files were deleted?

aallkkaa 11-16-17 11:01 AM

Quote:

Originally Posted by myrroddin (Post 325824)
Random improvement thought for SDPhantom's script, although I have long forgotten how it would be done: is there a way to :: echo which SV files were deleted?

Do you mean you want to supress the echoing of files that were deleted? If that's the case, then change line 30 to
Code:

:: echo Delete: %%~nl
Otherwise it will print the deleted variable as It already does. Example:
Code:

CharSV: ZZZ
Delete: ZZZ

EDIT: Sorry, I'd made a mistake regarding how to prevent the "Delete: " message from showing up. @ would prevent 'echo Delete: %%~nl' from being printed on screen (which is already handled by @echo off at the start of the script). The correct prefix to prevent the output of echo in that line would be :: (similar to Lua's -- ). Fixed it above now.

VXBlade 02-11-20 08:02 AM

Code in this Thread still works Great
 
Finally cleaned up years of add-ons I tried and deleted and tried and deleted. Over 1500 files and 40mb of useless data.:D Works with Retail and Classic with the respective paths entered in the first line. Thanks for this!


All times are GMT -6. The time now is 11:17 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI