Skip to content

Instantly share code, notes, and snippets.

@kedodrill
Created January 10, 2020 01:20
Show Gist options
  • Save kedodrill/12449d5d6e7ae5b00b206a9e56c94add to your computer and use it in GitHub Desktop.
Save kedodrill/12449d5d6e7ae5b00b206a9e56c94add to your computer and use it in GitHub Desktop.
IL2 Recompile LParser bash script
#!/bin/bash
WINEPREFIX=""
IL2_INSTALL_DIR=""
LPARSER=""
export DOTNET_INSTALL_DIR=$WINEPREFIX/drive_c/ilspycmd
export DOTNET_ROOT=$DOTNET_INSTALL_DIR
OLD_HOME=$HOME # prevent dotnet from placing any files in it's default location
HOME=$DOTNET_ROOT
mkdir -p $DOTNET_INSTALL_DIR
cd $DOTNET_INSTALL_DIR
wget 'https://dot.net/v1/dotnet-install.sh'
chmod +x dotnet-install.sh
./dotnet-install.sh -Channel 2.1
./dotnet tool install ilspycmd --tool-path $DOTNET_ROOT/tools
HOME=$OLD_HOME
mkdir recompile-lparser
./tools/ilspycmd -p -o recompile-lparser "$LPARSER"
cd recompile-lparser
sed -i 's/Debug<\/Configuration>/Release<\/Configuration>/' BoS.LogParser.Offline.csproj
sed -i 's/^.*TargetFrameworkVersion.*$/<TargetFrameworkVersion>v4\.0<\/TargetFrameworkVersion>/' BoS.LogParser.Offline.csproj
sed -i 's/ilspycmd\/shared\/Microsoft\.NETCore\.App\/[0-9]\.[0-9]\.[0-9]*\//windows\/Microsoft\.NET\/Framework\/v4\.0\.30319\//' BoS.LogParser.Offline.csproj
../dotnet build -p:FrameworkPathOverride="$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/"
if [[ -f "bin/Release/BoS.LogParser.Offline.exe" ]]; then
mv "$LPARSER" "$LPARSER.orig"
cp "bin/Release/BoS.LogParser.Offline.exe" "$LPARSER"
fi
cd $DOTNET_INSTALL_DIR/../
rm -r $DOTNET_INSTALL_DIR
@LevitatingBusinessMan
Copy link

What should the LPARSER value be?

@kedodrill
Copy link
Author

kedodrill commented Jun 28, 2020

What should the LPARSER value be?

It has been awhile since I played...here is the original script that I made edits to.
Basically, LPARSER="$IL2_INSTALL_DIR/data/Lparser/BoS.LogParser.Offline.exe". That should work, but it's possible that the filename is slightly different - I can't remember.

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