Closed APMichael closed 5 years ago
I've completed the FileKey portion of this work in https://github.com/MoscaDotTo/Winapp2/commit/148a46010ec25116dad285ba713b6f07f1ed20ea
Please test it out :)
FWIW it is included as part of the normal trim process (for now?) with no way to enable/disable it, as it seems quite in line with the general concept of the trim anyway (removing entries that don't apply to your system)
I don't think I'd take it the logical next step (removing keys that point to places that don't exist) since many FileKeys may be "volatile" (to use Alan_B's nomenclature.)
While there's no performance overhead (that I'm aware of) with any application regarding number of/unneeded filekeys, after trimming with the virtualstore trimming enabled on filekeys, my trimmed file is ~3.2% smaller than without trimming virtualstore (161.4KB vs 166.8)
Wow, that was fast! Thank you very much. The improved Trim version works great and flawless and I didn't notice any speed loss. 👍
I noticed you reversed my logic: My original intention was that we could remove all FileKeys and RegKeys for the VirtualStore positions from the main Winapp2.in file on GitHub. Anyway, the result is almost the same.
I noticed this too, I'm in the process of reimplementing it the way you originally asked (but still part of the trim).
I pushed a new build that implements this new behavior (adding keys where there are none)
Feel free to test by removing all the FileKeys and RegKeys pointing to VirtualStore from your local file and see what (if anything) is recreated. I have not yet tested ExcludeKeys to make sure they work
https://github.com/MoscaDotTo/Winapp2/commit/37e1a63fbe8852fce03b91d989528bbda42b90ee
ExcludeKeys appear to be working now that I've told the program to operate on them ;)
Awesome! It works perfectly. 😃
Just two things I noticed:
I'll check into the Reg ExcludeKeys
The header text is hardcoded and always has been more or less. Trimmed files have their # of entries updated and the header restored because winapp2ool's internals don't allow for saving the positions of the comments it reads so I have no way of restoring them. (This is a shortcoming of the design that I have plans to address at a later date).
I think it has some minor differences from the current one, but I had planned on opening a pull for that.
https://github.com/MoscaDotTo/Winapp2/blob/master/winapp2ool/components/winapp2handler.vb#L293
Sorry that's the wrong branch
https://github.com/MoscaDotTo/Winapp2/blob/Branch1/winapp2ool/components/winapp2handler.vb#L293
Thanks for the clarification.
Did you change something on the alphabetization check? In this new version WinappDebug reports alphabetization errors.
If you removed the virtualstore keys there will be many alphabetization errors, winapp2ool can fix them :) See the main winapp2.ini on branch1
ExcludeKeys pointing to VirtualStore locations in the registry should now be generated
Yes, it's working now! 👍 Thanks again for your great work.
If you removed the virtualstore keys there will be many alphabetization errors, ...
The new version shows some errors that are not shown in the release version of winapp2ool. Just download winapp2.ini (don't use Trim) and run WinappDebug. When you compare the .ini files, you will notice that there is a changed order. For example:
Release version:
RegKey2=HKLM\Software\Microsoft\Microsoft Games\Age of Empires|Zone
RegKey3=HKLM\Software\Microsoft\Microsoft Games\Age of Empires Expansion\1.0|Zone
RegKey4=HKLM\Software\Microsoft\Microsoft Games\Age of Empires II: The Conquerors Expansion\1.0|Zone
New version:
RegKey2=HKLM\Software\Microsoft\Microsoft Games\Age of Empires Expansion\1.0|Zone
RegKey3=HKLM\Software\Microsoft\Microsoft Games\Age of Empires II: The Conquerors Expansion\1.0|Zone
RegKey4=HKLM\Software\Microsoft\Microsoft Games\Age of Empires|Zone
It should be fixed. I removed a leading space from a parameter in a call to replaceAndSort
thinking it to be a typo but I see now why I had it that way :)
Confirmed! Thank you very much for the fast fix.
Great, after the release of the new winapp2ool version we can finally remove all VirtualStore Keys! 😃
What I noticed when using WinappDebug: It seems that WinappDebug overlooks incorrectly numbered ExcludeKeys.
ExcludeKeys were accidentally left out of the winappdebug process when I rewrote the way the keys are processed internally. should be fixed in the most recent build(s), I neglected to resync after I fixed this.
Works with the latest build! 👍 Thank you very much for another quick fix. 😄
Closing this since the work is done
An idea for a new feature:
Could we possibly add a VirtualStore Checker? This feature would check if a FileKey or RegKey also exists in the VirtualStore location and if so, it would create a new entry for it. For example:
Now VirtualStore Checker expands the variable %ProgramFiles% from FileKey1 to... %LocalAppData%\VirtualStore\Program Files %LocalAppData%\VirtualStore\Program Files (x86) ...and checks whether the directory exists on the system. I think the directory is enough, there is no need to check for the specified files.
If the directory exists, VirtualStore Checker creates a new entry. Either in a custom.ini or at the end of winapp2.ini.
With this feature we could remove all VirtualStore Keys from winapp2.ini, because most of them are not necessary. And for legacy software users, the VirtualStore would still be cleaned.
Download > Trim > VirtualStore Checker and you have the perfect winapp2.ini. :smile:
VirtualStore locations: