Skip to content

Instantly share code, notes, and snippets.

@bmaupin
Last active April 11, 2024 01:38
Show Gist options
  • Save bmaupin/93d31e1b2d738ae656b9d3617e19622b to your computer and use it in GitHub Desktop.
Save bmaupin/93d31e1b2d738ae656b9d3617e19622b to your computer and use it in GitHub Desktop.
Run New Super Ultimate Injector with Wine

Installation

Prerequisites

Install NSUI

  1. Download NSUI from https://gbatemp.net/threads/discussion-new-super-ultimate-injector-nsui.500376/

  2. Create a new Wine prefix and install .NET 4.6

    export WINEARCH=win32
    export WINEPREFIX=~/.local/share/wineprefixes/nsui
    winetricks -q dotnet46
    

    ⓘ If dotnet46 installation fails, try dotnet48 instead:

    winetricks -q dotnet48
    

    ⚠️ .NET 4.6 or greater is required for the image download feature to work

  3. Apply a registry fix to force .NET to use TLS 1.2

    echo 'Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319]
    "SchUseStrongCrypto"=dword:00000001
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]
    "SchUseStrongCrypto"=dword:00000001' > sslfix.reg
    wine regedit sslfix.reg
    rm sslfix.reg
    
  4. Extract NSUI to Wine prefix

    unzip Release_beta27.zip
    mv Release $WINEPREFIX/drive_c/NSUI
    
  5. Change the language, e.g.

    sed -i.bak 's/language=.*/language=en/' $WINEPREFIX/drive_c/NSUI/config.ini
    

    Available languages are: de, en, es, ru

Create desktop entry

  1. (Optional) Extract application icon

    cd ~/.local/share/wineprefixes/nsui/drive_c/NSUI/
    7z x New\ Super\ Ultimate\ Injector\ for\ 3DS.exe .rsrc/ICON -aoa
    cd -
    
  2. Create the desktop entry

    echo "[Desktop Entry]
    Type=Application
    Name=New Super Ultimate Injector for 3DS
    Exec=env WINEPREFIX=/home/$USER/.local/share/wineprefixes/nsui wine \"/home/$USER/.local/share/wineprefixes/nsui/drive_c/NSUI/New Super Ultimate Injector for 3DS.exe\"
    Icon=/home/$USER/.local/share/wineprefixes/nsui/drive_c/NSUI/.rsrc/ICON/5.ico
    Terminal=false" > ~/.local/share/applications/nsui.desktop
    

Open NSUI

Open with the desktop entry, or:

export WINEPREFIX=~/.local/share/wineprefixes/nsui; wine $WINEPREFIX/drive_c/NSUI/New\ Super\ Ultimate\ Injector\ for\ 3DS.exe

Troubleshooting

The request was aborted: Could not create SSL/TLS secure channel.

Make sure you're using .NET 4.6 or greater. See here for more information:

Could not find Wine Gecko. HTML rendering will be disabled.

Install Wine Gecko (this should not be needed on newer versions of Wine (6+?) as Wine will automatically prompt you to install Gecko as needed)

wget http://dl.winehq.org/wine/wine-gecko/2.47.1/wine-gecko-2.47.1-x86.msi
wget http://dl.winehq.org/wine/wine-gecko/2.47.1/wine-gecko-2.47.1-x86_64.msi
WINEPREFIX=~/.local/share/wineprefixes/nsui wine msiexec /i wine-gecko-2.47.1-x86.msi
WINEPREFIX=~/.local/share/wineprefixes/nsui wine msiexec /i wine-gecko-2.47.1-x86_64.msi
@jbaiter
Copy link

jbaiter commented Jun 26, 2021

I'm getting an "Unhandled exception" whenever I try to create a new project :-/

Traceback
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at New_Super_Ultimate_Injector_for_3DS.SNES.SNESProjectProperties.set_InjectionMethod(SNESInjectionMethod value) in C:\workspace\cs\New-Super-Ultimate-Injector-for-3DS\New Super Ultimate Injector for 3DS\New Super Ultimate Injector for 3DS\ProjectProperties.cs:line 3692
   at New_Super_Ultimate_Injector_for_3DS.SNES.frmSNESInject..ctor() in C:\workspace\cs\New-Super-Ultimate-Injector-for-3DS\New Super Ultimate Injector for 3DS\New Super Ultimate Injector for 3DS\SNES\frmSNESInject.cs:line 659
   at New_Super_Ultimate_Injector_for_3DS.Library.LibraryGui.<>c__DisplayClass4_0.<AddConsoleToTable>b__1(Object s, EventArgs d) in C:\workspace\cs\New-Super-Ultimate-Injector-for-3DS\New Super Ultimate Injector for 3DS\New Super Ultimate Injector for 3DS\Library\LibraryGui.cs:line 110
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
New Super Ultimate Injector for 3DS
    Assembly Version: 0.27.0.0
    Win32 Version: 0.27.0.0
    CodeBase: file:///C:/NSUI/New%20Super%20Ultimate%20Injector%20for%203DS.exe
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
MdiTabControl
    Assembly Version: 1.1.3159.34934
    Win32 Version: 1.1.3159.34934
    CodeBase: file:///C:/NSUI/MdiTabControl.DLL
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 14.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Ionic.Zip
    Assembly Version: 1.9.1.8
    Win32 Version: 1.9.1.8
    CodeBase: file:///C:/NSUI/Ionic.Zip.DLL
----------------------------------------

@bmaupin
Copy link
Author

bmaupin commented Jun 28, 2021

I'm getting an "Unhandled exception" whenever I try to create a new project :-/

I'm sorry to hear that. Unfortunately there are so many factors that make this challenging to troubleshoot, such as:

  • What distro are you using? I only tested on Ubuntu 20.04
  • What version of Wine are you using? I tested with Wine 5 and 6
  • What version of NSUI are you using? I tested with version 27
  • Does it fail with all projects or just certain ones? You could try a different type of project
  • Does it fail with all games or just certain ones? You could try a different game
  • Did you install it in its own Wine prefix (as indicated in the instructions)?

If all else fails you could try creating an Ubuntu 20.04 VM and follow the instructions as above. It's not ideal of course, but it might help you figure out what the differences are and how to get it working on your own machine.

And here are a couple places you could ask for help:

Good luck!

@jbaiter
Copy link

jbaiter commented Jun 28, 2021

Wow, didn't expect to get an answer, thank you! I'm running Wine 5 on Debian unstable, same NSUI version .)
I think I'll just run it in a Windows VM, but thank you for the help!!!

@matheusflavio
Copy link

matheusflavio commented Sep 1, 2021

Thanks for the guide man, you're a life saver!
By now I'm trying to make it work with version 28 of nsui that I had saved on my windows. Only changed destination folder and tried to run. I've gotten 'you need .net 4.5.2', and pretty sure that it's easy to make it work. Maybe I could never use this on my linux (Mint 20.2) without your guide. Thank you so much

@matheusflavio
Copy link

It was quit easy making this work for version 28, just replaced that line:
winetricks -q dotnet46
for this one:
winetricks -q dotnet452
Can't actually use image download feature, though, but I'm not sure if it works even on windows.

@bmaupin
Copy link
Author

bmaupin commented Sep 1, 2021

It was quit easy making this work for version 28, just replaced that line:
winetricks -q dotnet46
for this one:
winetricks -q dotnet452
Can't actually use image download feature, though, but I'm not sure if it works even on windows.

The image download feature will only work with .NET 4.6 and above as per https://gist.github.com/bmaupin/981c496ca35093dcbccb7c365c76bbfc

Cheers!

@Bisc0tt1
Copy link

Bisc0tt1 commented Mar 9, 2024

Followed these instructions to a tee and the program is in a mostly functional state, except for creating the virtual console banner, which does not display anything in the preview despite entering text. I thought that it might've been a font rendering issue, but even after installing allfonts into the prefix the issue remains. It probably goes beyond a simple display issue, even the exported .cia has an empty banner.
Using wine 9.3 and installed dotnet48

@rileyJones
Copy link

This fixes the empty banner:

winetricks -q gdiplus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment