SharpGMad - gma explorer

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. :slight_smile: )
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 o\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!


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.
    [DEL]+ Fixes apparent issue caused by previous release[/DEL]
    • 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
    [DEL]v1.1.2.2 (released: 2014. 10. 01.)
  • Updated whitelist patterns to match with newest GMad.
  • Fixes apparent issue caused by previous release[/DEL]
    [DEL]v1.1.2.1 (released: 2014. 09. 29.)
  • Updated whitelist patterns to match with newest GMad.[/DEL]
    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! :smile:

Fancy, good job.

This would probably be better suited for the release section, but nice job!

GCFScape but for GMad’s nice work!

This is sick, thanks!

Love it! Thanks!

It would be cool if you added the capability of multiple file extracting. Other than that, great application. Good 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.

:wink: I think you pretty much summed it up!

[del]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.[/del]
[editline]Implemented.[/editline]
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. :slight_smile:

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. :eng101:

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.

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.

Implemented Drag and Drop, waiting for you to accept (or decline :P) it :zoid:

With it, it should be more user-friendly and faster to operate with.

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.

–snip, unnecessary

–We were late. Sorry.–

Can someone compile a version for mac and/or linux?

Would it be possible to somehow bulk extract files to the old format?

A new release has been pusblished. v1.1.1 brings the following changes:



- 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.

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.

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.

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.

Modified a few stuff for Mono. While the GUI seems to work…

http://i.imgur.com/EUF8CJp.png[/T]

It dies horribly at the export functionality.
[T]http://i.imgur.com/Hi8FZBP.png

(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.)

[editline].[/editline]

This will happen in the next release.