memo33 / sc4pac-tools

Package manager for SC4
https://memo33.github.io/sc4pac/
GNU General Public License v3.0
9 stars 1 forks source link

Add support for clickteam installers #2

Closed sebamarynissen closed 6 months ago

sebamarynissen commented 7 months ago

I wanted to start adding metadata for Aaron Graham's content, but unfortunately most of his downloads are Clickteam installers, so sc4pac cannot work with them.

I found a tool called cicdec that is able to extract files from this kind of installers. Hence I suggest that support for it is added to sc4pac too. To support it in the metadata, I suggest that we add a field to the asset yaml file, something like

assetId: some-installer
version: 1.0.0
lastModified: "2024-03-22T00:00:00.000Z"
url: https://community.simtropolis.com/?do=download
type: clickteam-installer

I'd love to try and implement this, but I have no experience with Scala, so I'll see what I can do.

memo33 commented 7 months ago

Thanks for the suggestion and the PR. Currently sc4pac is completely cross-platform, which is why I'm a bit hesitant about this. Cicdec seems to be programmed in C# – I'm not sure about what the current state of running C# code natively on non-Windows platforms is (Linux specifically which I'm on). Do you have any experience with this? I need to play with your PR a bit, but I may need a few days for this.

If possible I'd like to preserve platform independence. A pragmatic alternative approach is to just subject the files to Project ZIP instead.

sebamarynissen commented 7 months ago

Ah I see. I'm no expert in C# (I'm a JavaScript and Node.js guy), so I can't really answer that I'm afraid.

As an alternative, it could be an option to just implement the functionality cicdec offers in Scala by porting the C# code. It doesn't seem too complicated: the code is only about 600 lines long so I guess it's doable. As mentioned, I'm not an expert in Scala though so I won't really be able to help here I fear.

Alternatively I could try to port the cicdec code to Node.js. As I love programming in JavaScript, I see this as a fun exercise. If we have a JavaScript implementation of cicdec, then we could instruct users to install it via npm (such as my sc4 tool), which would make it cross platform. On the downside this will require users to have Node.js installed though.

memo33 commented 7 months ago

Hold on, if we port it, I'm not sure Javascript is the best approach due to the Node dependency. With the cicdec implementation as reference, porting the code to Scala or Java does not seem to be entirely unreasonable though.

sebamarynissen commented 7 months ago

About this Project Zip thing. At first I didn't understand what it was, but I realise now that this is an effort to get rid of installers and replace them with regular zips on the various exchanges.

Do you know if I can find more information about this somewhere? I can't seem to find anything about it on Simtropolis or SC4evermore. I'd love to contribute here, for example by using cicded to programmatically extract installers and then create zip files from them.

memo33 commented 7 months ago

Do you know if I can find more information about this somewhere? I can't seem to find anything about it on Simtropolis or SC4evermore. I'd love to contribute here, for example by using cicded to programmatically extract installers and then create zip files from them.

It's probably best to get in touch with Tyberius06 as he's handling that. I've created a few ZIP files from installers for him to upload, but the whole process takes some time as there's some vetting involved.

Regarding programmatic extraction, from what I've seen with the NSIS installers, the intended folder structure may not be entirely preserved on extraction, so that's something to keep in mind at least. Also, installers with multiple options may require some additional thoughts, but that's not an issue for the majority of installers.