1. Post #1
    whisperity's Avatar
    July 2011
    95 Posts
    SharpGMad


    SharpGMad is a tool to manipulate your most loved gma packages. Written in C#, it started from a simple reimplementation of Garry's gmad code, but ended up having a lot of useful features.

    The most prominent of all is the realtime mode. But what do I mean by realtime mode?

    gmad is a nice tool for quickly packaging and extracting your addons, but when having to poke at single files inside the archive, we are left without a tool... until today! (Well... not today, but you get it. :) )
    Realtime mode means that SharpGMad opens any ordinary (and not-so-ordinary...) gma file with ease and you get an interface very similar to any other archiver's out there. If you are used to managing your ZIP, RAR or TAR files via 7zip or anything else, you will love SharpGMad.

    In this realtime mode, you can add a file, delete a file, extract a file. If you need to simply edit one file inside, you can export them somewhere on your filesystem, edit it, click the Update button and have it updated inside your gma.

    If you are more savvy with the command-line, you can use your terminal with SharpGMad too. Starting the program with the realtime argument (and optionally, -file C:\path\to\file.gma to specify a file to be automatically opened) will load a shell where you can do everything you could on the graphical interface. Type help to see the available commands.

    If you don't have a gmad.exe handy, SharpGMad can also be used because it exposes gmad's interface. This means, that commands like gmad.exe create -folder "C:\myaddon" -out "C:\addon.gma" work, just type SharpGMad.exe as the binary.

    DISCLAIMER!
    Code:
    The program SharpGMad is provided "AS IS" without any expressed or implied warranties.
    While this is just the usual legal small talk, you should really heed the warning. A general rule of thumb is that we never start meddling with files we don't have backups of. If you are going to edit an unrecoverable addon of yours, make a copy of it somewhere safe.
    I did my best to try to avoid bugs, but bugs are bugs for a reason... when they strike, they mess up everything.

    Requirements, download
    Windows: .NET 4.0 is required. This usually means that operating systems below Windows XP Service Pack 3 are not supported.
    Mono: Cross-platform release is beta! With Mono, SharpGMad can be ran on Linux or OS X. Make sure you download the Mono version below.
    CAUTION! Most Linux distributions tend to install Mono 2.10 by default, which has compatibility issues. Please use a newer runtime. By the time of release, the latest version 3.2.5 seems to work fine with SharpGMad.

    Release (v1.2): Windows, Mono

    Feedback, contributions
    Feedback is appreciated. If you have anything to say, please say it here. In terms of bug reports and suggestions, please file an issue on GitHub. Please provide as much information (related to the issue happening) as you can, including what platform you're running on when filing a report so I can reproduce and fix problems more easily.

    Changelog:
    v1.2 (released: 2014. 10. 29.)
    + Added a folder tree for easier browsing of files
    + Addons will now automatically reopen if whitelist override is enabled
    + Fixed metadata handling when creating addons from loose structures
    + Fixed description JSON not supporting newlines
    + Fixed adding files to archive failing if outer path didn't match whitelist.
    v1.1.2.3 (released: 2014. 10. 03.)
    + Updated whitelist patterns to match with newest GMad.
    + Fixes apparent issue caused by previous release
    - Reverted this change because it was not a fix after all
    + Added the ability to force open whitelist non-conforming addons by hand if the user requests
    v1.1.2.2 (released: 2014. 10. 01.)
    + Updated whitelist patterns to match with newest GMad.
    + Fixes apparent issue caused by previous release

    v1.1.2.1 (released: 2014. 09. 29.)
    + Updated whitelist patterns to match with newest GMad.

    v1.1.2 (released 2014. 01. 05.)
    + Added cross-platform compatibility for Mono
    + Various small typo and execution fixes
    + Added ability to write legacy info.txt files when extracting
    + Added automatic discovery of info.txt files when creating
    v1.1.1 (released 2013. 12. 21.)
    - Removed not used Author field from showing until gmad supports it.
    + Added Drag and Drop support in the GUI
    + Added support for opening files currently in use by a running Garry's Mod process
    v1.1 (released 2013. 07. 25.)
    + Added ability to automatically pack old (gmod12) addon folders using info.txt or addon.txt
    + You can shell-execute a file from the archive by double-clicking it
    + Pressing the DELETE key on a file in the list will remove it
    + Fixed a typo resulting in StackOverflow
    + Reworked the way addon contents are stored fixing crashes due to running out of available memory
    + Internal changes to make debugging and development easier and the code cleaner
    + Will no longer read the file contents (consuming memory) if the file cannot be added (due to whitelist malcompliance) later on
    + Merged the functionality of "Update metadata" window into the main form
    + Improved the user-friendlyness of the graphical interface
    + Prompts to save the addon will now only show if there are unsaved modifications
    v1.0.1 (released 2013. 06. 12.)
    + Implemented the "ServerContent" tag to match the specifications dictated by gmad
    + Added multiple file extract and remove capability
    + Fixed exceptions when opening the Update metadata form for addons with less than two tags or invalid/empty values set
    + Fixed automatically selecting the addon file's folder when using the form for the legacy extractor
    v1.0 (released 2013. 06. 09.)
    + Initial release

    Enjoy!
    Reply With Quote Edit / Delete Reply Hungary Show Events Winner Winner x 40Useful Useful x 7Lua King Lua King x 1 (list)

  2. Post #2
    EvacX's Avatar
    July 2010
    2,851 Posts
    Fancy, good job.
    Reply With Quote Edit / Delete Reply Windows 7 Sweden Show Events Agree Agree x 1 (list)

  3. Post #3
    Dennab
    May 2012
    478 Posts
    This would probably be better suited for the release section, but nice job!

  4. Post #4
    taste the salty dong
    Remscar's Avatar
    September 2009
    1,825 Posts
    GCFScape but for GMad's nice work!
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Zing Zing x 1 (list)

  5. Post #5
    My Blog
    Spencer Sharkey's Avatar
    July 2009
    1,961 Posts
    This is sick, thanks!

  6. Post #6
    Awesome Gmod Servers!
    Dannyman's Avatar
    March 2013
    520 Posts
    Love it! Thanks!

  7. Post #7
    I'm Solo.
    Chief Tiger's Avatar
    April 2010
    467 Posts
    It would be cool if you added the capability of multiple file extracting. Other than that, great application. Good job.

  8. Post #8
    whisperity's Avatar
    July 2011
    95 Posts
    This would probably be better suited for the release section, but nice job!
    If a mod seems it sufficient, they can move it of course. I thought to put it here instead because it's not likely a gamemode or addon (as in a Lua addon), and more likely just a dev tool. And garry's topic about his tool is in this subforum too.

    GCFScape but for GMad's nice work!
    I think you pretty much summed it up!

    It would be cool if you added the capability of multiple file extracting. Other than that, great application. Good job.
    In case you have a GitHub account, could you post it as an issue on the source repository? I would see it later on when I develop. But thanks for the suggestion, I'll try to keep it in mind.
    Edited:
    I have implemented it. It should be available in the next release.

    For the rest of you not quoted: thank you for the kind words. I hope it'll be useful. :)

  9. Post #9
    whisperity's Avatar
    July 2011
    95 Posts
    A new release version, v1.1 has been published. I advise everyone using my tool to switch to this version as (apart from being eye-candy updates like user-interface friendliness increase and the usage of keyboard-mouse in the GUI), it introduces a new way of handling addon contents and memory fixing the previous severe memory over-usage.

    You can find the full release notes and download link in the opening post.
    Reply With Quote Edit / Delete Reply Hungary Show Events Winner Winner x 1 (list)

  10. Post #10
    whisperity's Avatar
    July 2011
    95 Posts
    Bumpity boo. Is anyone still using this, or did my little project die? Feature requests? Bugs? Anything to say? It's been a time since I last heard about this project, let alone touched it.

    I admit I would have implemented some sort of workshop support; adding GMPublish functionality like how I did it with GMad, but gmpublish's code is not disclosed.

  11. Post #11
    danielga's Avatar
    July 2007
    292 Posts
    With Workshop addons being corrupted and what not, everything's kind of at a standstill.

    About file uploading, your best bet is to make use of the gmpulish executable as a child process. Otherwise, I would venture in the official Steamworks SDK as there seems to be some interfaces for the Workshop.

  12. Post #12
    johnnyaka's Avatar
    January 2012
    272 Posts
    Implemented Drag and Drop, waiting for you to accept (or decline :P) it

    With it, it should be more user-friendly and faster to operate with.
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Useful Useful x 1 (list)

  13. Post #13
    whisperity's Avatar
    July 2011
    95 Posts
    Thanks for the request, but by drag and drop, I meant that users could drop files into the archive, without needing to click on the Add file button.

    But it only needs some small changes to make it work that way. I'll do them soon.

  14. Post #14
    johnnyaka's Avatar
    January 2012
    272 Posts
    --snip, unnecessary

  15. Post #15
    whisperity's Avatar
    July 2011
    95 Posts
    --We were late. Sorry.--

  16. Post #16
    BFG9000's Avatar
    April 2011
    5,397 Posts
    Can someone compile a version for mac and/or linux?

  17. Post #17

    April 2009
    161 Posts
    Would it be possible to somehow bulk extract files to the old format?

  18. Post #18
    whisperity's Avatar
    July 2011
    95 Posts
    A new release has been pusblished. v1.1.1 brings the following changes:
    Code:
    - Removed not used Author field from showing until gmad supports it.
    + Added Drag and Drop support in the GUI
    + Added support for opening files currently in use by a running Garry's Mod process
    Download link in the opening post.
    Thanks to johnnyaka for contributing to the project.

    Can someone compile a version for mac and/or linux?
    Apart from a simple P/Invoke which makes the program able for both CLI and GUI usage, MoMA reported that the application is fully portable. I will see what a real test run can show me.

    Would it be possible to somehow bulk extract files to the old format?
    As I can see, this would only require an extra option in the LegacyExtract part creating a new info.txt... Will keep this in mind too.
    Reply With Quote Edit / Delete Reply Windows 7 Hungary Show Events Winner Winner x 1 (list)

  19. Post #19
    sacleocheater's Avatar
    February 2010
    242 Posts
    Would it be possible to somehow bulk extract files to the old format?
    This. It would make lives so much easier if that were possible.
    Doing every single addon one by one does make me want to kill myself.

  20. Post #20
    whisperity's Avatar
    July 2011
    95 Posts
    Can someone compile a version for mac and/or linux?
    Modified a few stuff for Mono. While the GUI seems to work...


    It dies horribly at the export functionality.


    (And because that VirtualBoxed Ubuntu lags horribly (pardon me, the server computer doesn't have a VGA card) I think I'll need to install a full Mono development environment somewhere.)

    Edited:
    Would it be possible to somehow bulk extract files to the old format?
    This will happen in the next release.

  21. Post #21
    skeleto's Avatar
    October 2008
    41 Posts
    Bumpity boo. Is anyone still using this, or did my little project die? Feature requests? Bugs? Anything to say? It's been a time since I last heard about this project, let alone touched it.

    I admit I would have implemented some sort of workshop support; adding GMPublish functionality like how I did it with GMad, but gmpublish's code is not disclosed.
    I always use it! S2
    It's great to see that this project stills alive (and that it's being ported to Linux, my main system). Keep going =D

  22. Post #22
    JamieH is a retarded bitch <3
    Pantho's Avatar
    July 2008
    2,272 Posts
    I had no idea someone made something so damned handy for GMA manipulation.

    <3 I shall start using it.

  23. Post #23
    whisperity's Avatar
    July 2011
    95 Posts
    Well, after a lot of annoyment with how Mono tends to handle some stuff, v1.1.2 and cross-platform support is here! Apart from that, there are only small changes (mostly typod words) and Mono-related fixes in the current patch.

    Download link and full changelog in the opening post, as usual. ;)

  24. Post #24
    Captain Westcliff: Thinks Wales is an Island
    NeoDement's Avatar
    January 2006
    18,608 Posts
    the "Legacy" convert folder to addon doesn't seem to do anything. Create is greyed out forever.

  25. Post #25
    whisperity's Avatar
    July 2011
    95 Posts
    You need to select (or type in the path of) a valid source folder (that is: it contains either an addon.json or an info.txt) for it to be enabled.
    Reply With Quote Edit / Delete Reply Hungary Show Events Informative Informative x 1 (list)

  26. Post #26
    whisperity's Avatar
    July 2011
    95 Posts
    I know, nothing really new in this update. Sorry, but life has been rather busy around...
    Anyway, have an update: I put the new whitelist from the latest GMad update into SharpGMad. :)
    Reply With Quote Edit / Delete Reply Show Events Useful Useful x 1 (list)

  27. Post #27
    BFG9000's Avatar
    April 2011
    5,397 Posts
    Havent visited this thread in a while but i noticed you added cross plat! Time to finally use this >:D

  28. Post #28
    Zombiezomber's Avatar
    June 2013
    2 Posts
    The new whitelist thing has absolutely destroyed my ability to open .gma files, because most of the .gma s I try to open contain .png files.
    Reply With Quote Edit / Delete Reply Show Events Dumb Dumb x 1Agree Agree x 1 (list)

  29. Post #29
    Google first. ( Wiki )
    Robotboy655's Avatar
    May 2008
    9,085 Posts
    How the hell upload whitelist can affect EXTRACTING?
    Reply With Quote Edit / Delete Reply Show Events Agree Agree x 2Optimistic Optimistic x 1 (list)

  30. Post #30

    March 2014
    412 Posts
    How the hell upload whitelist can affect EXTRACTING?
    It doesn't let you open the file, throws up the whitelist error and that's it.

  31. Post #31
    whisperity's Avatar
    July 2011
    95 Posts
    Use the previous version in the meantime: 1.1.2.

    Apparently, something is wrong when the code checks a path against the wildcard.
    It will require more testing... I will get to it as soon as I get back to the testing environment.

    Edit:
    I have tested with as many GMAs I could, and I think it is saved now.
    If the problem still persists, please, send me more information, most specifically the GMA you try to open and you can't.
    Reply With Quote Edit / Delete Reply Show Events Friendly Friendly x 1 (list)

  32. Post #32
    Zombiezomber's Avatar
    June 2013
    2 Posts
    Nope.avi. Still getting it whenever I try to open a .gma with .png files in them.

  33. Post #33
    whisperity's Avatar
    July 2011
    95 Posts
    You should upload that file somewhere and link it to me so I can check it.
    Maybe chances are that the GMA in question is in fact invalid and against the whitelist.

    Edit 2:

    (Obviously, I am using a "disallow everything" whitelist for the sake of this picture to create an error with a perfectly fine GMA.)

    Guys, really. I've compiled an on-the-fly guide how to use the program in terminal mode to find which file makes it throw the error only to realize that what I remembered is true: SharpGMad doesn't just print "hurr whitelist mismatch" but the file which causes the error. Just as in the picture above.

    Please, when an error happens with a program which is very environmental/situational (happens for certain files and configurations only), show the developer everything you can so they can pinpoint the error.

    The bottom line is: what is the file which makes SharpGMad resist opening the file? Type it into a post or screenshot the error message... whatever works.

  34. Post #34

    March 2014
    412 Posts
    Trying to open http://steamcommunity.com/sharedfile.../?id=186139871

    I get


    Why can't you just remove the whitelist checking when trying to open files?
    Only do the check when saving.
    Reply With Quote Edit / Delete Reply Show Events Agree Agree x 3 (list)

  35. Post #35
    whisperity's Avatar
    July 2011
    95 Posts
    Well, I can do so, but it will require some more refactoring to how the "realtime" access to addons are handled.

    Also, please look at the following:
    Code:
    "maps/*.bsp",
    "maps/*.nav",
    "maps/*.ain",
    and
    Code:
    "gamemodes/*/content/maps/*.bsp",
    "gamemodes/*/content/maps/*.nav",
    "gamemodes/*/content/maps/*.ain",
    This is the code from garry's whitelist stating what type of files (.bsp, .nav and .ain) can be in the maps folder (or a gamemode-content maps folder).
    So... even if I remove the whitelist restrictions (or add a "Force read-only open" mode... yeah, that sounds a bit more possible), the addon you wish to use is NOT valid according to the official whitelist.

    (So if there's a way, please contact the original creator. :) )

    Update:
    Did the latter thing. You can now trade your ability of modifying and saving addons for the ability to open those which are disrespecting the whitelist. ;)


    Download link in OP, as usual.
    Reply With Quote Edit / Delete Reply Show Events Informative Informative x 1 (list)

  36. Post #36
    whisperity's Avatar
    July 2011
    95 Posts
    GCFScape but for GMad's nice work!


    Hardest enemy (lazyness and other things to do) is neutralized.
    Hardest part is figured out.

    It will be happening soon...
    Reply With Quote Edit / Delete Reply Show Events Optimistic Optimistic x 1 (list)

  37. Post #37
    whisperity's Avatar
    July 2011
    95 Posts
    Hey, hey, it is done!

    Version 1.2 is released! Download link in OP, as usual. ;)
    While the changelog is short, it is quite the heaviest so far. The biggest addition today is tree view, a feature that was on schedule since June 10, 2013 (that's almost one and a quarter year)
    People using the Windows release have a treat! SharpGMad will try to load file icons and definitions from your computer. So if you have some sort of program installed to handle, let's say, Lua files and it gave your Lua files a custom icon, those custom icons will appear in SharpGMad too. (Damn it, this was one hell of a ride in WinAPI...)
    (People with Mono, I am to beg your pardon. This logic above uses stuff heavily tied within Windows simply not available on other platforms.)
    (This also means that if you want not to use this addition, run the Mono release on your Windows computer. It works that way, just not the other way around.)

    There are just some small changes added to the mix, too.
    * I have fixed how the legacy info.txt conversion handles itself (the regular expressions over-fired and you got things like "Addon name: author_email") and also given it newline support (like Garry's Mod is using the GMA descriptions...)
    * It hit me that noone reported it so far, but the file adding method was also a bit crappy. You always had to have lua/subfolder/somefile.luaexternally on your disk so that it is added the same way inside the open GMA. No more! The program will now try to do some auto-out-figuring where the file should go. (Of course if it can't decide, you will be asked.)
    * A while ago, I implemented the whitelist override thingie in a quick rush. I guess having to reopen the addon manually after you clicked "Force override" is not user friendly, so I got rid of it.
    Addons will now automatically reopen with the whitelist disabled. And if you close the addon, you don't have to restart SharpGMad, as the next addon you open will be opened with the whitelist on (if it can be, of course)
    * Pressing the Application (right-click) button on your keyboard will now also bring up the right click menu properly.
    * I have also changed the opening post a little bit.

    Well, that's it for now. I hope you still love this. ;)