Crash while uninstalling winter background mod
linkanon opened this issue · 8 comments
This is the most bizarre bug I've encountered in the development of this program.
I've replicated it, and I had a look through the subfiles in memory and this caught my eye:
That file doesn't exist anywhere in the mod or backup .7z, so I thought it was an issue with the wrapper for 7za.exe to index the mods. But this couldn't be right, since it only happens to this mod. I looked around more, and found this:
Apparently the modder threw in some junk files into the mod, and since this one had a space in it it confused the program. To fix it in the program, it would require a complete rewrite of how the program handles 7z files because 7za.exe isn't consistent enough in its console output for the program to read it correctly so I have to cut corners for it to work.
I'm not sure if I want to do all that since subfiles aren't supposed to have spaces in them (why would this issue only show up now?), so I'll leave it for now.
To fix it manually, just delete the AA2_PLAY\jg2p08_00_00\MP14_00_W copy.bmp
file in the actual mod 7z, flush cache and try to uninstall it again. Might have to get the modder to release a v1.2.1 of the mod that removes the junk files.
On an unrelated note, did you ever do anything with your fork of AA2Install? I saw you fork it but you haven't pushed a commit to it at all yet.
Will this happen every time there's a space in the filename? That's unfortunate. I uninstalled it by removing the backup and overwriting the bg .pp with another mod's (Halloween bg). Don't think its author will ever release the updated version since he is MIA. I might host the fixed version myself.
Also sometimes a mod that i install is not recognized as such. Happened with the orc faces. It installed fine but wasn't highlighted in the modlist. Might be because the author made a quickfix and I already had it selected(not installed though) so it cached the previews/readme. Then i replaced the mod with the fixed one, installed and it didn't recognize it. Maybe check mods hash to see if you need to update its previews.
I forked the repo but had troubles building it. Most likely because of SB3U's dependencies.
I might end up doing the complete rewrite anyway since 7za is slow in it's indexing, and it causes a considerable lag when launching for the first time/after flushing cache with 50 or so mods.
When you install a mod and it's not highlighted afterwards, it means it failed installation because it couldn't find any files that are in the proper format for installation. I should probably include a popup for this, but if I do end up doing the rewrite I would be able to give the user a warning that it's not a wizzard-ready mod in the first place. I'll consider CRC checks if it doesn't slow down the startup (1.1gb of hashing every launch/refresh on an average use case)
You need SlimDX for .NET 4.0 to build it. I didn't mention this since I thought I would be able to remove the dependency from the SB3Utility library, but every attempt has failed so far. I'll try again, but if I still can't remove it I'll properly list it as a build requirement.
The mod installed fine after I flushed cache though. Tried it 2 times before that and it moved the files but still didn't highlight it as installed. I meant you should check hash when you select a mod, before you decide if you want to take out the preview/readme. As I understand it you display those in cache unless there's none, in which case you take them out the archive. You should check if it's the same file and if not do it anyway.
The SlimDX and DirectX in general are probably there to allow it to render the 3d models.
That would be a better way to do it, but might cause incompatibilities with previous versions. I don't think it should be too much of an issue since no-one downgrades without an explicit reason to do so.
AA2Install and .pp manipulation have nothing to do with rendering 3d models, which is why I want to remove the dependencies. Plus it generates 20+mb debugging files with every build which slows everything down.
I've cleaned up the SB3Utility library so you should be able to update that fork and it should build nicely now. Doesn't depend on SlimDX anymore.
Great, It builds now, thanks. Had to change execution policy and install Newtonsoft.Json and it worked.
Should be fixed in commit 2ed4b77.