LiquidFenrir / MultiUpdater

or µpdtr for short, is an updater for 3ds applications/a9lh/b9s payloads rewritten in C++
MIT License
140 stars 18 forks source link

How to add boot9strap in config.json #32

Closed apo126 closed 7 years ago

apo126 commented 7 years ago

Hi, I tried to add boot9strap in config.json as below:

{
        "name": "Boot9strap latest release",
        "url": "https://github.com/SciresM/boot9strap",
        "inrelease": "boot9strap-*.zip",
        "inarchive": "boot9strap.firm",
        "inarchive": "boot9strap.firm.sha",
        "path": "/boot9strap/boot9strap.firm",
        "path": "/boot9strap/boot9strap.firm.sha"
    }

Then, MultiUpdater says it could not find the matching zip file. And how to extract two files from a single zip file?

Please help. Thank you in advance for your help!

LiquidFenrir commented 7 years ago

First of all, it can't find the matching file because the . after the * (what it looks for) matches with the one in the version number, and not the one before the extension. That one will be hard to do using this, you'd be better off hardcoding it to 1.2 or wait until a better pattern matching system is achieved

Second, why would you want this? It's not like boot9strap gets an update every month

Third (and last), you can't extract more than 1 file from an archive for now

Sorry, but I can't help you on this

apo126 commented 7 years ago

@LiquidFenrir The reason is that I want MultiUpdater to update the things such as SafeB9SInstaller, Boot9strap, GodMode9... So I donot need to copy files from a computer to 3DS.

apo126 commented 7 years ago

@LiquidFenrir After using "inrelease": "boot9strap-*zip", boot9strap-1.2-devkit.zip will be downloaded. You know there are four files there boot9strap-1.2-devkit.zip, boot9strap-1.2-ntr-devkit.zip, boot9strap-1.2-ntr.zip, and boot9strap-1.2.zip. What we need is boot9strap-1.2.zip. Is there a way?

LiquidFenrir commented 7 years ago

Yes, this is why I said it would be hard and that a better matching system would be used later on. You could also use ftpd to transfer the files, for eample

apo126 commented 7 years ago

@LiquidFenrir Glad to hear you will improve. Thank you for developing MultiUpdater!

kageurufu commented 7 years ago

Its just regex right? Would "boot9strap-\\d+\\.\\d+\\.zip" not work?

LiquidFenrir commented 7 years ago

Tried it in regexr, doesnt seem to work however boot9strap-[^-]*\.zip does, for just catching the "normal" (not devkit, not ntr) release. since you need to escape backslashes in the config file, that would be "inrelease": "boot9strap-[^-]*\\.zip" the [^-]* means "any character that isn't - any number of times (even 0), until you match the next part (which is \.zip, so exactly ".zip")

kageurufu commented 7 years ago

I had escaped the slashes there, try "boot9strap-\d+\.\d+\.zip" for regexr

matches properly against

boot9strap-1.3-devkit.zip
boot9strap-1.3-ntr-devkit.zip
boot9strap-1.3-ntr.zip
boot9strap-1.3.zip
boot9strap-1.2-devkit.zip
boot9strap-1.2-ntr-devkit.zip
boot9strap-1.2-ntr.zip
boot9strap-1.2.zip
boot9strap-1.1-dev.zip
boot9strap-1.1.zip
boot9strap-1.0-dev.zip
boot9strap-1.0.zip

\d is a number selector, so \d+ matches one or more numbers.

Heres selectors for all the boot9strap release types

boot9strap-\d+\.\d+\.zip
boot9strap-\d+\.\d+-ntr\.zip
boot9strap-\d+\.\d+-devkit\.zip
boot9strap-\d+\.\d+-ntr-devkit\.zip
LiquidFenrir commented 7 years ago

Ah right, I forgot to unescape those, sorry. unfortunately that wouldn't work if they used a version number like 1.3.1 boot9strap-[^-]*\.zip works for anything, and just like yours it only needs to be appended -ntr or -devkit to match it boot9strap-\d+(\.\d+)*\.zip would also work. regex is awesome :P