[Tutorial] Working with C# RimWorld Mods on Arch Linux (and ILSpy on WINE)

Started by Spdskatr, November 09, 2018, 03:40:02 AM

Previous topic - Next topic

Spdskatr

(NOTE: This guide was extracted from my Modding Resources GitHub page. I guess I should make another post about it, meh)

Working with C# RimWorld Mods on Arch Linux

Everything in this setup WorksOnMyMachineâ„¢, so I can't guarantee if it works on yours. A bit of ArchWiki and Google-fu might help solve any problems.

TL;DR

  • Set up MonoDevelop
  • Install MonoDevelop via Flatpak
  • Set up ILSpy
  • Download Zhentar's patch of ILSpy here
  • Install WINE, Winetricks and samba
  • winetricks dotnet40

Set up MonoDevelop
Install MonoDevelop
You can always get MonoDevelop via the AUR, but various community members have reported it to be somewhat buggy (citation needed).

I installed MonoDevelop via flatpak:


# Omit --user to install system-wide, needs root privileges for obvious reasons
$ flatpak install --user --from https://download.mono-project.com/repo/monodevelop.flatpakref


Once installed, run:


$ flatpak run com.xamarin.MonoDevelop


to start MonoDevelop.

MonoDevelop should be able to open .sln files made with Visual Studio with no problems whatsoever.

ArchWiki: Flatpak, Mono

Set up ILSpy
Getting a decompiler to work on Linux is hard, especially since there are no decompilers that have been built for Linux (as of November 2018). You can, however, run ILSpy under Wine.

Installing WINE and Winetricks
Follow the instructions on the ArchWiki.

Get ILSpy
You can get a release of ILSpy for Windows from the main repository, or Zhentar's fork that implements better decompilation of iterators.

Configuring WINE with Winetricks
You will need to install .NET Framework 4.0 to run ILSpy. Use this command to install .NET 4.0:


$ winetricks dotnet40


Make sure you also have the samba package installed from the official repositories to avoid the problem described in the section "ntlm_auth code vomit".

Once you have done both of these, try launching ILSpy with wine /path/to/ILSpy.exe.

ArchWiki: Wine, Samba

ntlm_auth code vomit
If you see something like this when you try to start up ILSpy:


System.Runtime.InteropServices.COMException: Unknown authentication source.
(Exception from HRESULT: 0x800706D3)


Chances are you'll probably also find a log message along the lines of:


0009:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.


For Arch, you will need to install the samba package.
My mods

If 666 is evil, does that make 25.8069758011 the root of all evil?

AileTheAlien

So, after these steps, follow the Windows-centric tutorial from this forum?

Spdskatr

Quote from: AileTheAlien on November 09, 2018, 07:16:57 AM
So, after these steps, follow the Windows-centric tutorial from this forum?
Yeah, granted MonoDevelop has a slightly different UI compared to Visual Studio, you should be able to follow along.
My mods

If 666 is evil, does that make 25.8069758011 the root of all evil?