1. wyatt8740

    OP wyatt8740 Member
    Newcomer

    Joined:
    Mar 15, 2017
    Messages:
    24
    Country:
    United States
    I've ported 3DNUS (the 3DS CDN software downloader) to run in native mono on linux/unix systems. This means most GNU/Linux distros, Mac OS X, most BSD systems, Solaris, etc. can now run the program, regardless of CPU architecture and regardless of if Wine is installed.

    Note that for non-Windows/Linux i386/Linux amd64 systems, you will have to compile your own version of "make_cdn_cia" and name it accordingly.

    You can download the latest release here:
    https://github.com/wyatt8740/3DNUS/releases

    And the GPLv3 source code here:
    https://github.com/wyatt8740/3DNUS

    I have what led me to do this and a full list of things that made it not portable in this spoiler:
    I was trying to download old3DS 10.7.0 firmware the other week from a linux install. I found everyone pointing to 3DNUS as the correct way to download firmware updates; I found it was a windows program. I tried running it in mono since it was written in .NET, to no avail. This fails to run on linux with wine for a number of tiny, incredibly stupid design choices - namely, the author of the modded version (dr.hacknik) did this:

    • He felt the need to play music when you start the program, like it's some warez keygen or something. Doing this he decided to make the program use windows media player libraries, which are only partially implemented in wine and not implemented at all in mono. Wine has stub functions for changing the system volume, which this app decides to do for some reason, because god forbid you keep your computer silent.
    • He felt the need to use native windows kernel calls in the 'localization' (translation) portion of the app. (e.g., he includes the "System" library - instant game-over for anything cross platform)
    • He did something strange with the EULA dialogue that stops it from operating properly. Can't remember what that was.
    Anyway, the app was still pretty much portable except for all the little annoying bells and whistles he added for some reason. I had source code, so I hacked and slashed out most of the platform-specific code.

    Old information:
    I recommend anyone reading this to use 3.0.1 native; the other downloads are left purely for posterity. 2.8 is very unstable in Wine with WineMono, 3.0.1 "non-native" looks nicer than native but has no useful additional functionality and requires Wine as well, and 3.0.1 Native should work basically anywhere with Mono installed - it does not require Wine.

    Even older info:
    I also can't use native linux mono still on account of the localization that I didn't want to touch. But at this point, it runs fine in Wine 2.0 (possibly lower versions, too). It would have ran fine before this using wine, but windows media player functions for volume control are not implemented.

    Also added an empty file, Config/setup_completed.cfg, to stop the EULA from popping up and crashing the app when it launches.

    So anyway, it worked enough that I was able to make it download my old3DS firmware without installing windows, so I thought I'd share the result. Note that it still hangs on my system if you try to enter its "settings" menu, so I'd recommend editing settings via the config files instead if you need to. I didn't have to change anything to get my firmware downloaded, though.

    Run it in wine and it should be fine now. WineMono is adequate to run the app to the degree above; it is probable that it is more functional if you can get winetricks to install the microsoft .NET 4.5.2 runtime or higher (I built it targeting 4.5.2). Additionally, IMO it works better than the original mod on windows, too, because it's not got all those little annoying extras. It should also work on OS X via Wine, but I have not tested this.
    (edit: I tried this, it works extremely well in a 32-bit WINEPREFIX with .NET 4.6 installed via winetricks.)

    Old releases:
    NOTE: There are now three versions of this app; 2.8.0.1,, 3.0.1, and 3.0.1 Native. 2.8.0.1 is vastly different than 3.0.1 in terms of interface, but both "work" - I believe 3.0.1 is a little less buggy.
    3.0.1 differs from 3.0.1 Native in that "regular" 3.0.1 looks nicer but requires Wine.
    3.0.1 Native should work on any system with Mono installed, as well as on Windows with .NET, but looks less pretty. It is the version I will use as the base for all future updates, due to its more "robust" nature.



    3.0.2 Native
    Works in Mono without Wine. If you run OS X, you'll need to compile make_cdn_cia yourself or run it in Wine anyway, though. I don't have a mac to compile it on, or a cross-toolchain for it, and I have to be at work in 20 minutes.
    Contains a new fix for a strange update for Taiwanese New3DSes without a version number ("N/A").

    If you download the precompiled binaries, and run linux/unix/OSX, you will want to make the make_cdn_cia programs executable. To do this, run:
    Code:
    chmod 755 make_cdn_cia32 make_cdn_cia64
    If you use info-ZIP's command-line "unzip" program, I think you don't have to do this.
    Binary (runnable program, compiled):

    https://www.dropbox.com/s/rkw1ua1vtwvj19b/3DNUS_3.0.2_nativeMono.zip?dl=0
    Or:
    https://mega.nz/#!K9xFAC4L!mVr4OWGt4NEu_FLrmuP50L4NTicsYBgwMOVqAODAEzM

    Source code:

    https://www.dropbox.com/s/pvyzashq03ttt1e/3DNUS_mod_src-3.0.2_nativeMono.tar.xz?dl=0
    Or:
    https://mega.nz/#!Cp5gnZLD!CmX7yJ5Nmvocw7tXRanBTL6zwz1hu9h9rlD-h8qnIRI




    old version downloads:
    3.0.1 Native
    https://www.dropbox.com/s/tsxpni9svokicda/3DNUS_3.0.1_nativeMono.zip?dl=0
    Source code:
    https://www.dropbox.com/s/kibahxc6qmg1mf7/3DNUS_mod_src_3.0.1_nativeMono.tar.xz?dl=0


    2.8.0.1

    Zip file with runnable program (pre-compiled binary):
    I just checked, and the app works more or less perfectly in wine with these changes when you use a 32-bit WINEPREFIX and install the .NET 4.6 runtime with winetricks.
    (link to pic)
    3DNUS_2.8.0.1_wineMono-v2.zip
    https://www.dropbox.com/s/1bbwf0alrvdifp6/3DNUS_2.8.0.1_wineMono-v2.zip?dl=0
    Or:
    https://mega.nz/#!y55k0DAY!92rRR-ZFl_AkVAo5ZXkVC2NsJhgWRDQiQW6k5AiD1II

    Source code (.tar.xz):
    3DNUS_src-2.8.0.1_wineMono.tar.xz
    https://www.dropbox.com/s/42r6nn8ul5rhjvs/3DNUS_src-2.8.0.1_v2_wineMono.tar.xz?dl=0
    Or:
    https://mega.nz/#!3l5gnYyJ!K4-RHhuj0cWC3iea55qnpCK_Vohl5PV53mssoCw6lP0

    3.0.1
    Zip file with runnable program (pre-compiled binary):
    3DNUS_3.0.1_wineMono.zip
    https://www.dropbox.com/s/8rmv2pljj045k23/3DNUS_3.0.1_wineMono.zip?dl=0
    Or:
    https://mega.nz/#!u0BVTbYK!4601YxzK1Z-pkoE4WRsMjk8FIvzaaiTJTnADlWhEBPo

    Source code (.tar.xz):
    3DNUS_src-3.0.1_wineMono.tar.xz
    https://www.dropbox.com/s/f8qdwgpwqd5luk8/3DNUS_src-3.0.1_wineMono.tar.xz?dl=0
    Or:
    https://mega.nz/#!2k4kDSYZ!PSXrANoaXcW2jgZodrBFRd5D2mBi1eKDO-XG5Bu002M
    I also am linking to the original unmodified source code, since the git repo's "source" for 3.0.1 appears to actually be 2.6.
    https://www.dropbox.com/s/sdw08mp4zkjmm1p/3DNUS_Material_Source.zip?dl=0

    The files are too big to attach here, unfortunately.
    I know that this is my first post here and it reads a little like a rant, sorry about that. I have a history on some IRC channels relating to console development, particularly nesdev, where you will find people to vouch for me if you're concerned about downloading random files from mega.

    I also have fixed tools that should be portable but aren't for linux/OSX in the past (I'm "dragonite trainer" on this forum), in case you want a reference to prior work.
    https://www.pokecommunity.com/showthread.php?p=8058961#post8058961

    Have a screenshot, too.
    [​IMG]
     
    Last edited by wyatt8740, Apr 3, 2017
  2. wyatt8740

    OP wyatt8740 Member
    Newcomer

    Joined:
    Mar 15, 2017
    Messages:
    24
    Country:
    United States
    [accidentally doubleposted, can't figure out how to delete this, sorry]
     
    Last edited by wyatt8740, Mar 16, 2017
  3. wyatt8740

    OP wyatt8740 Member
    Newcomer

    Joined:
    Mar 15, 2017
    Messages:
    24
    Country:
    United States
    I've updated the app; it now has had the mp3 audio files replaced with silent one second stubs (which I kept in case there's some other esoteric code I wasn't counting on that depends on the MP3's being embedded), drastically reducing the download size from around 10 megabytes to around 2.3 megabytes.

    I also removed the "this app is a development version" warning dialogue (making the app start much faster) and added my name to the credits list in the main window.

    The updated versions are now linked to in the OP.
    [​IMG]
     
    Last edited by wyatt8740, Mar 16, 2017
  4. hobbledehoy899

    hobbledehoy899 GBAtemp Addict
    Member

    Joined:
    Nov 13, 2015
    Messages:
    2,829
    Country:
    Antarctica
    Good work! It may not be truly native, but it's much better!
     
  5. wyatt8740

    OP wyatt8740 Member
    Newcomer

    Joined:
    Mar 15, 2017
    Messages:
    24
    Country:
    United States
    Thanks.
    I would love to make it closer to native (even if I still rely on mono, which I'd love to get away from in favor of C or something), but for the present (given how much I actually use this tool) I'm satisfied with this solution.

    Windows-only tools tend to infuriate me, especially when written in languages with the potential for cross-platform operability like C# (or other CIL languages).
    At least it doesn't use Windows Presentation Framework. If it had, this "port"/hack would probably have never happened, since mono doesn't really support WPF at all. I'd have just used winetricks to install a MS .NET runtime in the first place, despite the ~600MB overhead from a wineprefix with .NET.
     
    Last edited by wyatt8740, Mar 16, 2017
  6. hobbledehoy899

    hobbledehoy899 GBAtemp Addict
    Member

    Joined:
    Nov 13, 2015
    Messages:
    2,829
    Country:
    Antarctica
    Yeah, that always pisses me off.
     
    CuriousTommy likes this.
  7. gnmmarechal

    gnmmarechal GBAtemp Guru
    Member

    Joined:
    Jul 13, 2014
    Messages:
    5,893
    Country:
    Portugal
    Well done.
     
    hobbledehoy899 likes this.
  8. wyatt8740

    OP wyatt8740 Member
    Newcomer

    Joined:
    Mar 15, 2017
    Messages:
    24
    Country:
    United States
    Thanks again. I saw a notable lack of anyone even asking about making 3DNUS work on Linux, so I did what I could.
     
  9. Dr.Hacknik

    Dr.Hacknik Ashley | Developer | Trans
    Member

    Joined:
    Mar 26, 2014
    Messages:
    1,773
    Country:
    United States
    And why are you using 2.8? 3.0.1 has been here for a while. Also, I like offering customization. Music was something to be soothing, and is optional. Also, thanks for getting this working in Linux. I'll try it.

    EDIT:

    Also, 2.8's code was sloppy. 3.0.1 is de-bloated and is optimized.
     
    Last edited by Dr.Hacknik, Mar 16, 2017
  10. wyatt8740

    OP wyatt8740 Member
    Newcomer

    Joined:
    Mar 15, 2017
    Messages:
    24
    Country:
    United States
    2.8 was the last version I knew to be reliable.
    I will try 3.x as soon as the git clone finishes and I've gotten it to a usable state in WineMono.

    The music was enabled by default in 2.8, and runs on first startup in the setup wizard. it's impossible to launch the program due to about a billion "exception" errors trying to change the system volume.

    If I want soothing music, I personally like to just play my own music.

    Edit: looking at git master now, looks like all the source was moved to the 'old' directory for some reason?
     
    Last edited by wyatt8740, Mar 16, 2017
    gnmmarechal likes this.
  11. wyatt8740

    OP wyatt8740 Member
    Newcomer

    Joined:
    Mar 15, 2017
    Messages:
    24
    Country:
    United States
    @Dr.Hacknik it appears to me that the source code is not sorted in the git repo in any logical manner. '3DNUS_Material_Source' does not in fact contain any source code whatsoever, only binaries and a .suo file. There are sources in 'old/' but they appear to be for 2.6.x.

    I'm currently 180 megabytes (!) into downloading the .tar.gz release for 3.0.1 alpha. This repo is HUGE for a supposedly "Light as Air" program.
     
    Last edited by wyatt8740, Mar 16, 2017
    gnmmarechal likes this.
  12. Dr.Hacknik

    Dr.Hacknik Ashley | Developer | Trans
    Member

    Joined:
    Mar 26, 2014
    Messages:
    1,773
    Country:
    United States
    Strange, I'll send you a zip file instead. Sorry for the inconveniences.
     
  13. wyatt8740

    OP wyatt8740 Member
    Newcomer

    Joined:
    Mar 15, 2017
    Messages:
    24
    Country:
    United States
    I'm downloading an old 'release' archive now. Really should be more careful when sorting that source code out though. I'm sure if I jump back a couple commits I'll find it, at any rate

    Sorry if I'm being too hard on you, I'm really not trying to get anyone aggravated.

    300MB in, now, on that .tar.gz.

    I just checked the size of the cloned git repo; it's 1.7 GiB. Hope the tarball isn't that large.

    Edit: ok, the tarball's 338 MiB.
     
    Last edited by wyatt8740, Mar 16, 2017
    Dr.Hacknik likes this.
  14. wyatt8740

    OP wyatt8740 Member
    Newcomer

    Joined:
    Mar 15, 2017
    Messages:
    24
    Country:
    United States
    Aaah, I remember why I disabled the EULA now that I'm re-doing everything for 3.x.
    The 'next' button doesn't close the dialogue.

    Also I remember now that I had to remove the debugger visualizer portion because that depends on visual studio.

    AAAND NOPE, the build in the .tar.gz for 3.x is STILL 2.6.
     
  15. Dr.Hacknik

    Dr.Hacknik Ashley | Developer | Trans
    Member

    Joined:
    Mar 26, 2014
    Messages:
    1,773
    Country:
    United States
    I have PM'd you the Source Zip file mate.

    It is 3.0.1
     
  16. GerbilSoft

    GerbilSoft GBAtemp Addict
    Member

    Joined:
    Mar 8, 2012
    Messages:
    2,376
    Country:
    United States
    I would like to point out that a program that attempts to change the system volume (and isn't e.g. a media player) should be classified as actively user-hostile. Programs should not be changing system settings unless explicitly requested by the user.
     
    wyatt8740, gnmmarechal and bayleef like this.
  17. Dr.Hacknik

    Dr.Hacknik Ashley | Developer | Trans
    Member

    Joined:
    Mar 26, 2014
    Messages:
    1,773
    Country:
    United States
    Wait, what? How's that hostile. That (should be) for only the Media Player. Although, that was a long time ago. I didn't know how to just play an mp3 or wav in a good way. Therefore I used WMPLib.
     
  18. wyatt8740

    OP wyatt8740 Member
    Newcomer

    Joined:
    Mar 15, 2017
    Messages:
    24
    Country:
    United States
    Alright, source code received.
    There was a lot more in terms of windows media player calls to comment out in this one, and I must say it took me about two minutes to figure out where the text box was supposed to be.

    But after that (and struggling for about 20 minutes to make the zip library the new version uses compile in mono), it's done, I think. I'll add modded 3.0.1 and source to the OP, as well as the original source for 3.0.1 since it appears it's kind of hard to find.

    [​IMG]
     
    Last edited by wyatt8740, Mar 17, 2017
    uyjulian and gnmmarechal like this.
  19. schnitz

    schnitz Newbie
    Newcomer

    Joined:
    Sep 17, 2009
    Messages:
    1
    Country:
    Gambia, The
    Could I also get a link to the working 3.0.1 tarball? Would like to make a .net core compatible commandline version out of this. (Im using linux for 3ds development, but It's a virtual machine without any gui running)
    Also, It seems kind of weird to run a program on linux that emulates a commandline output.

    Edit: Nvm, I guess i can just use the source here that is already cleaned up a bit
     
    Last edited by schnitz, Mar 17, 2017
  20. wyatt8740

    OP wyatt8740 Member
    Newcomer

    Joined:
    Mar 15, 2017
    Messages:
    24
    Country:
    United States
    @schnitz: the original unmodified 3.0.1 source is above, in the zip file dr.hacknik sent to me.

    I'd love a command-line version, if you make one!
    Yeah, it is weird to have a command-line app running in wine. I have done this before though, particularly when I used Adobe AIR a while back - I ran the command-line tools in wine.

    I'd make a CLI app myself, but I'm:
    a) relatively lazy (I run an X11 desktop)
    b) not very skilled with C#.
    I'm a regular C programmer at heart. If I look at the code some more and think I get it all, I might do a python port or something, though.

    Note that unless you ditch C# completely you're going to be emulating in the command-line, though; the Mono/.NET runtimes are virtual machines, a lot like Java.
     
    Last edited by wyatt8740, Mar 17, 2017
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - 3DNUS, Linux,