Homebrew RELEASE TinWoo Installer

Status
Not open for further replies.

mrdude

Developer
OP
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,238
Version updated, fixed index range bug on http install, this was an error in the code from Atmo-XL where it would join your http address to the download link - doh, no wonder people were having issues with the http servers - sorry about that.

Plus added to url install to remember the last url you typed.

You can use the index.php in the attached zip file - on raspberry pi or whatever.

Change these lines:

$Host = "http://192.168.0.51:80/"; //use your http servers own ip address or dns address
$rootFolder = $_SERVER['DOCUMENT_ROOT'] . "/";
$Folder = "nsp"; //Where the games file are stored, can contain subfolders
$cacheFolder = "cache/"; //the cache Folder where to store the cache file. MUST Have write permission.
$cacheFile = "cache.json"; //the cache File MUST Have write permission.

Also currently NSP/XCI files stored on the server should not have spaces in the file names - (I'll fix this later).

Ki8wiUa.png
 

Attachments

  • index.zip
    3.1 KB · Views: 66
Last edited by mrdude,

mrdude

Developer
OP
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,238
FYI - index.php in attachment above fixes installing games with spaces in the names. If I get time later I'll adjust the code in the app to replace spaces as well, but the php file above sorts that out for now. If you are using alternative php files make sure the file path in the php is using "rawurlencode".
 
  • Like
Reactions: binkinator

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,157
Country
United States
Version updated, fixed index range bug on http install, this was an error in the code from Atom-XL where it would join your http address to the download link - doh, no wonder people were having issues with the http servers - sorry about that.

Plus added to url install to remember the last url you typed.

You can use the index.php in the attached zip file - on raspberry pi or whatever.

Change these lines:

$Host = "http://192.168.0.51:80/"; //use your http servers own ip address or dns address
$rootFolder = $_SERVER['DOCUMENT_ROOT'] . "/";
$Folder = "nsp"; //Where the games file are stored, can contain subfolders
$cacheFolder = "cache/"; //the cache Folder where to store the cache file. MUST Have write permission.
$cacheFile = "cache.json"; //the cache File MUST Have write permission.

Also currently NSP/XCI files stored on the server should not have spaces in the file names - (I'll fix this later).

Bottom Line On Top: The new version of Tinwoo works perfectly with the index.zip provided above. Full stop.

(ungrateful consumer drivel continues below)


Built from src and ftp’d just the .nro to my switch. Didn't work using the previously configured PHPinfoil server ran some tests...

Did some stop/start of the web server and poor man’s network capture using Netcat on the server side and I see chrome and AtmoXL fetch a proper URL when I click on a game however Tinwoo doesn’t even make a request?

image.jpg

NOTE: This is likely due to me fiddling with the original PHP code to get the $_SERVER HOST bit to work properly. I'm going to fetch the default PHPinfoil server .php again (and of course try with the .php file you posted.)

1651753932953.png


Here's what's going on above:

clean cache (turn on web server and refresh page then turn off webserver)
capture request of one .nsp from chrome using nc
clean cache (turn on web server and refresh page then turn off webserver)
capture request from AtmoXL using nc
clean cache (turn on web server and refresh page then turn off webserver)
attempt to request from latest Tinwoo using nc (and it hangs indefinitely)

e: Success using the provided index.php file.

I grabbed a fresh copy of PHPinfoil and it throws the undefined index error again.

(but works with AtmoXL still)

image.jpg

image.jpg

I'm hovering above the Othello link and the URL it's serving seems to be legit.

The undefined index error is from PHPinfoil and I worked around it before by equating it to "" but either way the results are the same.

1651756466777.png

Summary: I can download via chrome and AtmoXL but not Tinwoo.

You would be within your rights to say fuck it and fork the .php file and call it THE Official Tinwoo HTTP Server but it sure would be neat if it could behave like a bone stock tinfoil client (up to and including passing ?tinfoil to NSPIndexer in order to get the text based tinfoil reponse.) Totally up to you...your brew...your call.
 

mrdude

Developer
OP
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,238
Bottom Line On Top: The new version of Tinwoo works perfectly with the index.zip provided above. Full stop.

(ungrateful consumer drivel continues below)
I couldn't get atmosxl to download using with the original php file - I debugged the app and the url would give me this when it tried to download a game:

"http://192.168.0.51/http://192.168.0.51/nsp/test.nsp"

I removed the bit that called for the server address, that's all - check the commit in the dev build for info. The changed php file only changes empty spaces in the url and replaces them with %20.

See screenshots for info:
Orig - can't download due to spaces in the url
FI99SFP.png


Mod: modded php replaces spaces with %20
QZvKHm0.png



I could add an option in the config page to swap between php files.
 
Last edited by mrdude,
  • Like
Reactions: binkinator

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,157
Country
United States
Very tolerant http server.
Tolerant is certainly one word for them…💩
I couldn't get atmosxl to download using with the original php file - I debugged the app and the url would give me this when it tried to download a game:

"http://192.168.0.51/http://192.168.0.51/nsp/test.nsp"

I removed the bit that called for the server address, that's all - check the commit in the dev build for info. The changed php file only changes empty spaces in the url and replaces them with %20.

See screenshots for info:
Orig - can't download due to spaces in the url

Mod: modded php replaces spaces with %20
Totally agree. Hence the previous “fuck it” clause.

Frankly these php game servers are all over the map and make the installers look bad due to lack of any standard.
Would like to see apps will work with nut.exe and NSPindexer…soooo tinfoil standard?
(is that even a thing and if it is, should it even be something to aspire to? Dunno.)

Full disclosure: I have some sunken cost in NSPIndexer because it will do recursion and has a really pretty web UI. It will spew text if you add ?tinfoil or ?DBI as part of the request.
 

mrdude

Developer
OP
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,238
Full disclosure: I have some sunken cost in NSPIndexer because it will do recursion and has a really pretty web UI. It will spew text if you add ?tinfoil or ?DBI as part of the request.
If you look at how the page looks once loaded in html format - another elseif statement can be added to netinstall.cpp file:

Current href looks like this:

Code:
else if (response[0] == '<') {
                              std::size_t index = 0;
                              while (index < response.size()) {
                                  std::string link;
                                  auto found = response.find("href=\"", index);
                                  if (found == std::string::npos)
                                      break;
                                  
                                  index = found + 6;
                                  while (index < response.size()) {
                                      if (response[index] == '"') {
                                          if (link.find("../") == std::string::npos)
                                              if (link.find(".nsp") != std::string::npos || link.find(".nsz") != std::string::npos || link.find(".xci") != std::string::npos || link.find(".xcz") != std::string::npos)
                                                  urls.push_back(link);
                                          break;
                                      }
                                      link += response[index++];
                                  }

                              }

It wouldn't be difficult to add another elseif - for any href style format tbh.
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,157
Country
United States
If you look at how the page looks once loaded in html format - another elseif statement can be added to netinstall.cpp file:

Current href looks like this:

Code:
else if (response[0] == '<') {
                              std::size_t index = 0;
                              while (index < response.size()) {
                                  std::string link;
                                  auto found = response.find("href=\"", index);
                                  if (found == std::string::npos)
                                      break;
                                 
                                  index = found + 6;
                                  while (index < response.size()) {
                                      if (response[index] == '"') {
                                          if (link.find("../") == std::string::npos)
                                              if (link.find(".nsp") != std::string::npos || link.find(".nsz") != std::string::npos || link.find(".xci") != std::string::npos || link.find(".xcz") != std::string::npos)
                                                  urls.push_back(link);
                                          break;
                                      }
                                      link += response[index++];
                                  }

                              }

It wouldn't be difficult to add another elseif - for any href style format tbh.
I’ll take this on. Will be slow on my end but it will shut me up in your thread. Will send you a PR when I get it!
 
  • Like
Reactions: mrdude

mrdude

Developer
OP
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,238
I’ll take this on. Will be slow on my end but it will shut me up in your thread. Will send you a PR when I get it!
If you compile the dev build from github, I've added an option to the options page so you can switch between php files and it will work with how atomxl works. (remember and change your php files as well).
 
  • Like
Reactions: binkinator

mrdude

Developer
OP
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,238
Here you go, an NRO forwarder for Tinwoo so you can launch from your home screen.
 

Attachments

  • NRO-Forwarder-Tinwoo.zip
    317.7 KB · Views: 49
  • Like
Reactions: peteruk

BigOtaku2118

Member
Newcomer
Joined
Oct 30, 2021
Messages
7
Trophies
0
Age
33
XP
42
Country
United States
So, I manage to make my game into both XCI AND NSP format. I have LOTS of space on my Card (over 200 GB according to my computer reading), but it says the file, not even 11 GB, is too big to put on by itself. Is there a way to use TinWoo to put the game on the system without needing to be on the card? Again, the card has PLENTY of space, but my computer says it's too big...
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,157
Country
United States
So, I manage to make my game into both XCI AND NSP format. I have LOTS of space on my Card (over 200 GB according to my computer reading), but it says the file, not even 11 GB, is too big to put on by itself. Is there a way to use TinWoo to put the game on the system without needing to be on the card? Again, the card has PLENTY of space, but my computer says it's too big...
Is your card formatted as FAT32? It has a limit of 4G per file so double copying (from pc to card and then from card to switch) wont work.

Try installing NS-USBLoader on your computer then connect a USB cable and push your files that way. The installer knows how to handle large files on FAT32 and will only entail one transaction so it will be much faster than your previous method. Here it is in action…33MB/s with a 7G+ .xci to a FAT32 partition.

image.jpg

image.jpg

image.jpg

@mrdude saw the new nand and sd card space gauges. 1.0.9 looks 😎
 
Last edited by binkinator,

mrdude

Developer
OP
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,238
@mrdude saw the new nand and sd card space gauges. 1.0.9 looks 😎
I was thinking I might add an entry to the config page so if you want to do a http install from your own server you can store the address in the config page, that will save you having to enter the keyboard screen each time you want to do an own server install. If I get some time this week I'll add that.
 

binkinator

Garfield’s Fitness Coach
Member
GBAtemp Patron
Joined
Mar 29, 2021
Messages
6,511
Trophies
2
XP
6,157
Country
United States
I was thinking I might add an entry to the config page so if you want to do a http install from your own server you can store the address in the config page, that will save you having to enter the keyboard screen each time you want to do an own server install. If I get some time this week I'll add that.

That would be very cool! It is a chore to keep typing it.


I’m still dinking around with these PHP servers.

It’s not so much on the Tinwoo side.
Your stuff is pretty straightforward to follow.

The various PHP servers on the other hand are all over the place with how they produce data.

I’ve had varied success at consolidating server types either by creating another config (less desirabl) or just making it have a preference for tinfoil style (with exceptions for those that don’t follow it).

Trying to please them all is…frustrating.

Then there‘s the actual catalog handling. They either won’t recurse directory structures or if they do they are to slow to respond back in time for a web query. Even my fave, NSPIndexer, takes way too long to respond with anything more than a few hundred files.

More as I keep digging…
 
  • Like
Reactions: mrdude and peteruk

mrdude

Developer
OP
Developer
Joined
Dec 11, 2015
Messages
3,071
Trophies
1
Age
56
XP
8,238
That would be very cool! It is a chore to keep typing it.
Done, v1.0.10 added to the github. Just add http server source url to the config page, uncheck "use keyboard during http server installs", if you leave that enabled and type a url with the OSK, it will overwrite the url entered in the options page - this is not a bug, I did this purposely so you can also set the url from the install page if the OSK is enabled.

As for php files, these are dependant on the users own website - some people use logins and store those on a sql database etc - so you will never really get a standard php file as everyone just makes their own. Obviously the code in tinwoo can't cater to every website so it just uses the basic php file posted earlier.

The switch only needs basic file name and url information to download the game -so when the index php contains lots of extra info (as in NSPindexer), this is not needed for the switch as it will never display this. What you should do in NSPindexer for using with a computer web browser, have one of the simple index.php files posted in this thread in a different directory on your server and then have a button added to NSPindexer where you can call that php file if you want - and on the switch just point to the directory where you stored the simple php index file. That will solve your issues and that way you can use NSPindexer and tinwoo will work without any code mods.

As for NSPindexer onthe github page is just says to do this to be tinfoild/dbi compatible - example:

http://192.168.0.51/index.php/?tinfoil
or
http://192.168.0.51/index.php/?DBI

I've not tried NSPindexer as I don't need it, but surely this is just a simple thing to do to change the URL. Also max url is set to 256 in netinstall.cpp (const unsigned int MAX_URLS = 256).
 
Last edited by mrdude,

Adventurer

Well-Known Member
Newcomer
Joined
Jan 25, 2016
Messages
71
Trophies
0
Age
36
XP
166
Country
United States
I don't see it addressed anywhere, but does TinWoo yet support decompressing the new block-based compression method that eShop NSPs now frequently employ?
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BigOnYa @ BigOnYa: Where do I sign up?