FROM scottyhardy/docker-wine:stable ENV WINEDEBUG "fixme-all" ENV RUN_AS_ROOT "yes" ENV USE_XVFB "yes" ENV XVFB_SERVER ":95" ENV XVFB_SCREEN "0" ENV XVFB_RESOLUTION "1024x768x8" ENV DISPLAY ":95" ENV WINEARCH win32 COPY tools/* /root/.wine/drive_c/windows/system32/ RUN set -x -e; \ # Install dotnet entrypoint wineboot --init; \ # get latest version and its hash from https://dotnet.microsoft.com/en-us/download/dotnet wget https://download.visualstudio.microsoft.com/download/pr/7ce6d94a-13c1-4102-bb1b-b0f7ea5afb6e/0764c80c81c16ab927c0a7321f7c07cf/dotnet-sdk-8.0.303-win-x86.exe --no-check-certificate -O /tmp/dotnet.exe; \ echo af52649a05bb3c8ba494291234d67f3385446a8a08eaefcbe9fbc4e766ae97a6a13253060a798ce076511fa59086b1d9fa638b51a5e748bcfc79d36ddc7991ca /tmp/dotnet.exe > /tmp/chk; \ sha512sum -c /tmp/chk; \ while pgrep wineserver >/dev/null; do echo "Waiting for wineserver"; sleep 1; done; \ while true; do \ if timeout 30m wine z:\\tmp\\dotnet.exe /q; then \ break; \ fi \ done; \ # Install proper NET Framework so that tlbexp.exe works winetricks -q dotnet472; \ # Install obfuscator # Note: We use the executables from nuget as it allows EAZFUSCATOR_NET_LICENSE. There is no # alternative to set the license key in the MSI delivered binaries using command line. wget https://www.nuget.org/api/v2/package/Gapotchenko.Eazfuscator.NET/2021.1.553 -O /tmp/eaz.zip; \ unzip /tmp/eaz.zip -d /tmp/eaz; \ mv /tmp/eaz/tools /root/.wine/drive_c/users/root/Eazfuscator; \ PATH_QUERY_RES=`wine reg query "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment" /v PATH`; \ # extract value PATH_DIRTY=${PATH_QUERY_RES#*REG_EXPAND_SZ}; \ # trim start PATH_TRIMMED_LEFT=${PATH_DIRTY#${PATH_DIRTY%%[![:space:]]*}}; \ # trim end PATH_VALUE=${PATH_TRIMMED_LEFT%${PATH_TRIMMED_LEFT##*[![:space:]]}}; \ wine reg add "HKLM\\SYSTEM\\CurrentControlSet\\Control\Session Manager\\Environment" /v PATH /t REG_EXPAND_SZ /d "C:\\Users\\root\\Eazfuscator;$PATH_VALUE" /f; \ wine reg add "HKLM\\SYSTEM\\CurrentControlSet\\Control\Session Manager\\Environment" /v EAZFUSCATOR_NET_LICENSE /t REG_SZ /d "4SY9QB68-3WD55J3Y-XWCD7DFF-UPZVRNXJ-PWFEH4P5-YHJFCGQP-AGTBM5GF-JSK8JN35"; \ # HACK: Wait for the registry writes to complete in Wine # (see more at https://serverfault.com/questions/1082578/wine-in-docker-reg-add-only-keeps-effects-temporarily) sleep 20; \ # Clean-up rm -rf /tmp/eaz.zip /tmp/eaz /tmp/dotnet.exe /tmp/chk; \ # Install obfuscator #wget https://cloud.ivasoft.cz/remote.php/dav/public-files/JsuXwhbcRRDnHUx/Eazfuscator.NET%202019.1%20Setup.msi --no-check-certificate -O /tmp/obf.msi; \ #echo ac9388d48c17c75d9b5146d46d9dcbfdab4008fe5b992a4a08767c4691cb626b7c4b4c46c5ba0bf31754bc0d1fc8fa2a65a280c83ce03794424e04be10f8b9ca /tmp/obf.msi > /tmp/chk; \ #sha512sum -c /tmp/chk; \ #wine msiexec.exe /i /tmp/obf.msi /qn; \ #rm /tmp/obf.msi /tmp/chk; \ # Complete echo Usage: wine "c:\program files\dotnet\dotnet.exe" build --configuration Release --no-dependencies Test.wixproj # DEBUG Windows apps # xhost +local:docker # docker run --rm -it --env DISPLAY=$DISPLAY --volume /tmp/.X11-unix:/tmp/.X11-unix bash # wine explorer