POL_Install_dotnet40

Informations

Creator Message
GNU_Raziel

Information

This installer has been approved by the team.

Informations

Platforms:
Downloads: 1072820
Wine: System

Feedbacks

Description

Install .NET Framework 4.0

This component does not work in 64-bit virtual drives

Note : No advanced features supported, only basic .NET 4.0 usage.

Source code

#!/bin/bash
# PlayOnLinux Function
# Date : (2012-02-25 21:00)
# Last revision : (2013-04-15 21:00)
# Author : GNU_Raziel
# Only For : http://www.playonlinux.com

# Checking wine arch
if [ "$POL_ARCH" == "amd64" ]; then
        POL_Debug_Fatal "$(eval_gettext 'This package does not work on a 64-bit installation')"
fi

# Remove wine-mono if present
POL_Wine uninstaller --remove '{E45D8920-A758-4088-B6C6-31DBB276992E}' || true

# Ignore errors message
if VersionLower $(POL_Config_PrefixRead VERSION) 1.5.21 && [ ! -e "$WINEPREFIX"/drive_c/windows/Microsoft.NET/Framework/v3.5/MSBuild.exe ]; then
        POL_SetupWindow_message "$(eval_gettext 'If you see error messages during DotNet 4.0 installation, you can ignore them without issues')" "$TITLE"
fi

# Setting OS check Fix
Set_OS "winxp" "sp3"
cat << EOF > "dotnet40_fix.reg"
[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]
"ProductName"="Microsoft Windows XP"
"CSDVersion"="Service Pack 3"
"CurrentVersion"="5.3"
"CurrentBuildNumber"="2600"
[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Windows]
"CSDVersion"=dword:00000300
EOF
POL_Wine regedit "dotnet40_fix.reg"

mkdir -p "$POL_USER_ROOT/ressources/dotnet40"
cd "$POL_USER_ROOT/ressources/dotnet40"
# Downloading dotnet40
POL_Download_Resource "http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe" "251743dfd3fda414570524bac9e55381" "dotnet40"

# Downloading dotnet40 post-install fix - for wine 1.5.4 and older
if VersionLower $(POL_Config_PrefixRead VERSION) 1.5.5; then
        POL_Download_Resource "http://files.playonlinux.com/gacutil-net40.zip" "c6f6c18e70097538752b4e327b612846" "dotnet40"
fi

# Setting Fix 1
POL_Wine --ignore-errors reg delete "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4" /f
rm "$WINEPREFIX"/drive_c/windows/system32/mscoree.dll
WINEDLLOVERRIDES="fusion=b"
export WINEDLLOVERRIDES
wineserver -k

# Installing dotnet40 - it will hang with exit code 67, don't worry
POL_Wine_WaitBefore ".NET Framework 4.0"
POL_Wine --ignore-errors dotNetFx40_Full_x86_x64.exe /q /c:"install.exe /q"

# Overriding dll
POL_Wine_OverrideDLL "native" "mscoree"

# Setting Fix 2
POL_Wine --ignore-errors reg add "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full" /v Install /t REG_DWORD /d 0001 /f
POL_Wine --ignore-errors reg add "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full" /v Version /t REG_SZ /d "4.0.30319" /f

# Setting Fix 3 - for wine 1.5.4 and older
if VersionLower $(POL_Config_PrefixRead VERSION) 1.5.5; then
        cd "$WINEPREFIX/drive_c/windows/temp/"
        unzip -o "$POL_USER_ROOT/ressources/dotnet40/gacutil-net40.zip"
        cd "$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/"
        for assembly in *.[dD]ll
        do
                POL_Wine_WaitBefore "$assembly"
                POL_Wine start /unix "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\$assembly" /f
        done

        cd "$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/WPF/"
        for assembly in *.[dD]ll
        do
                POL_Wine_WaitBefore "$assembly"
                POL_Wine start /unix "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\WPF\\$assembly" /f
        done

        # Setting Fix 4 - for wine 1.5.4 and older
        mkdir -p "$WINEPREFIX/drive_c/windows/Microsoft.NET/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a"
        cp "$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/System.EnterpriseServices.dll" "$WINEPREFIX/drive_c/windows/Microsoft.NET/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a"
fi
unset WINEDLLOVERRIDES
wineserver -k

Contributions

Filters:

Contribute
Member Message
sasasa Sunday 24 April 2022 at 22:47
sasasa Anonymous

Message

i don't see a confiure button help

Replies

Anonymous
Wednesday 26 October 2022 at 23:37
where's download button
Anonymous
Wednesday 26 October 2022 at 23:37
where's download button
sasasa Sunday 24 April 2022 at 22:47
sasasa Anonymous

Message

i don't see a confiure button help

Replies

golyalpha Friday 5 October 2018 at 20:54
golyalpha Anonymous

Message

What are the issues making this script impossible to run/install on 64bit virtual drives?

Replies

Wednesday 6 November 2019 at 11:42
Manpower.
petch Sunday 17 May 2015 at 14:43
petch

Information

This update has been approved by the team.

Message

Revert, doesn't work

Most likely gacutil.exe doesn't work correctly, so when trying to fix it the whole script breaks more obviously than before

Differences

@@ -67,14 +67,14 @@
 	for assembly in *.[dD]ll
 	do
 		POL_Wine_WaitBefore "$assembly"
-		POL_Wine "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\$assembly" /f
+		POL_Wine start /unix "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\$assembly" /f
 	done
 
 	cd "$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/WPF/"
 	for assembly in *.[dD]ll
 	do
 		POL_Wine_WaitBefore "$assembly"
-		POL_Wine "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\WPF\\$assembly" /f
+		POL_Wine start /unix "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\WPF\\$assembly" /f
 	done
 
 	# Setting Fix 4 - for wine 1.5.4 and older

New source code

#!/bin/bash
# PlayOnLinux Function
# Date : (2012-02-25 21:00)
# Last revision : (2013-04-15 21:00)
# Author : GNU_Raziel
# Only For : http://www.playonlinux.com

# Checking wine arch
if [ "$POL_ARCH" == "amd64" ]; then
        POL_Debug_Fatal "$(eval_gettext 'This package does not work on a 64-bit installation')"
fi

# Remove wine-mono if present
POL_Wine uninstaller --remove '{E45D8920-A758-4088-B6C6-31DBB276992E}' || true

# Ignore errors message
if VersionLower $(POL_Config_PrefixRead VERSION) 1.5.21 && [ ! -e "$WINEPREFIX"/drive_c/windows/Microsoft.NET/Framework/v3.5/MSBuild.exe ]; then
        POL_SetupWindow_message "$(eval_gettext 'If you see error messages during DotNet 4.0 installation, you can ignore them without issues')" "$TITLE"
fi

# Setting OS check Fix
Set_OS "winxp" "sp3"
cat << EOF > "dotnet40_fix.reg"
[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]
"ProductName"="Microsoft Windows XP"
"CSDVersion"="Service Pack 3"
"CurrentVersion"="5.3"
"CurrentBuildNumber"="2600"
[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Windows]
"CSDVersion"=dword:00000300
EOF
POL_Wine regedit "dotnet40_fix.reg"

mkdir -p "$POL_USER_ROOT/ressources/dotnet40"
cd "$POL_USER_ROOT/ressources/dotnet40"
# Downloading dotnet40
POL_Download_Resource "http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe" "251743dfd3fda414570524bac9e55381" "dotnet40"

# Downloading dotnet40 post-install fix - for wine 1.5.4 and older
if VersionLower $(POL_Config_PrefixRead VERSION) 1.5.5; then
        POL_Download_Resource "http://files.playonlinux.com/gacutil-net40.zip" "c6f6c18e70097538752b4e327b612846" "dotnet40"
fi

# Setting Fix 1
POL_Wine --ignore-errors reg delete "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4" /f
rm "$WINEPREFIX"/drive_c/windows/system32/mscoree.dll
WINEDLLOVERRIDES="fusion=b"
export WINEDLLOVERRIDES
wineserver -k

# Installing dotnet40 - it will hang with exit code 67, don't worry
POL_Wine_WaitBefore ".NET Framework 4.0"
POL_Wine --ignore-errors dotNetFx40_Full_x86_x64.exe /q /c:"install.exe /q"

# Overriding dll
POL_Wine_OverrideDLL "native" "mscoree"

# Setting Fix 2
POL_Wine --ignore-errors reg add "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full" /v Install /t REG_DWORD /d 0001 /f
POL_Wine --ignore-errors reg add "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full" /v Version /t REG_SZ /d "4.0.30319" /f

# Setting Fix 3 - for wine 1.5.4 and older
if VersionLower $(POL_Config_PrefixRead VERSION) 1.5.5; then
        cd "$WINEPREFIX/drive_c/windows/temp/"
        unzip -o "$POL_USER_ROOT/ressources/dotnet40/gacutil-net40.zip"
        cd "$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/"
        for assembly in *.[dD]ll
        do
                POL_Wine_WaitBefore "$assembly"
                POL_Wine start /unix "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\$assembly" /f
        done

        cd "$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/WPF/"
        for assembly in *.[dD]ll
        do
                POL_Wine_WaitBefore "$assembly"
                POL_Wine start /unix "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\WPF\\$assembly" /f
        done

        # Setting Fix 4 - for wine 1.5.4 and older
        mkdir -p "$WINEPREFIX/drive_c/windows/Microsoft.NET/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a"
        cp "$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/System.EnterpriseServices.dll" "$WINEPREFIX/drive_c/windows/Microsoft.NET/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a"
fi
unset WINEDLLOVERRIDES
wineserver -k

Replies

petch Sunday 17 May 2015 at 14:24
petch

Warning

This update has not been approved yet by the team.
Use it at your own risk

Message

Remove start /unix so that gacutil.exe is not killed by the wineserver -k that ends the script

(should only affect Wine versions < 1.5.5)

Differences

@@ -67,14 +67,14 @@
 	for assembly in *.[dD]ll
 	do
 		POL_Wine_WaitBefore "$assembly"
-		POL_Wine start /unix "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\$assembly" /f
+		POL_Wine "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\$assembly" /f
 	done
 
 	cd "$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/WPF/"
 	for assembly in *.[dD]ll
 	do
 		POL_Wine_WaitBefore "$assembly"
-		POL_Wine start /unix "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\WPF\\$assembly" /f
+		POL_Wine "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\WPF\\$assembly" /f
 	done
 
 	# Setting Fix 4 - for wine 1.5.4 and older

New source code

#!/bin/bash
# PlayOnLinux Function
# Date : (2012-02-25 21:00)
# Last revision : (2013-04-15 21:00)
# Author : GNU_Raziel
# Only For : http://www.playonlinux.com

# Checking wine arch
if [ "$POL_ARCH" == "amd64" ]; then
        POL_Debug_Fatal "$(eval_gettext 'This package does not work on a 64-bit installation')"
fi

# Remove wine-mono if present
POL_Wine uninstaller --remove '{E45D8920-A758-4088-B6C6-31DBB276992E}' || true

# Ignore errors message
if VersionLower $(POL_Config_PrefixRead VERSION) 1.5.21 && [ ! -e "$WINEPREFIX"/drive_c/windows/Microsoft.NET/Framework/v3.5/MSBuild.exe ]; then
        POL_SetupWindow_message "$(eval_gettext 'If you see error messages during DotNet 4.0 installation, you can ignore them without issues')" "$TITLE"
fi

# Setting OS check Fix
Set_OS "winxp" "sp3"
cat << EOF > "dotnet40_fix.reg"
[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]
"ProductName"="Microsoft Windows XP"
"CSDVersion"="Service Pack 3"
"CurrentVersion"="5.3"
"CurrentBuildNumber"="2600"
[HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Windows]
"CSDVersion"=dword:00000300
EOF
POL_Wine regedit "dotnet40_fix.reg"

mkdir -p "$POL_USER_ROOT/ressources/dotnet40"
cd "$POL_USER_ROOT/ressources/dotnet40"
# Downloading dotnet40
POL_Download_Resource "http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe" "251743dfd3fda414570524bac9e55381" "dotnet40"

# Downloading dotnet40 post-install fix - for wine 1.5.4 and older
if VersionLower $(POL_Config_PrefixRead VERSION) 1.5.5; then
        POL_Download_Resource "http://files.playonlinux.com/gacutil-net40.zip" "c6f6c18e70097538752b4e327b612846" "dotnet40"
fi

# Setting Fix 1
POL_Wine --ignore-errors reg delete "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4" /f
rm "$WINEPREFIX"/drive_c/windows/system32/mscoree.dll
WINEDLLOVERRIDES="fusion=b"
export WINEDLLOVERRIDES
wineserver -k

# Installing dotnet40 - it will hang with exit code 67, don't worry
POL_Wine_WaitBefore ".NET Framework 4.0"
POL_Wine --ignore-errors dotNetFx40_Full_x86_x64.exe /q /c:"install.exe /q"

# Overriding dll
POL_Wine_OverrideDLL "native" "mscoree"

# Setting Fix 2
POL_Wine --ignore-errors reg add "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full" /v Install /t REG_DWORD /d 0001 /f
POL_Wine --ignore-errors reg add "HKLM\\Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full" /v Version /t REG_SZ /d "4.0.30319" /f

# Setting Fix 3 - for wine 1.5.4 and older
if VersionLower $(POL_Config_PrefixRead VERSION) 1.5.5; then
        cd "$WINEPREFIX/drive_c/windows/temp/"
        unzip -o "$POL_USER_ROOT/ressources/dotnet40/gacutil-net40.zip"
        cd "$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/"
        for assembly in *.[dD]ll
        do
                POL_Wine_WaitBefore "$assembly"
                POL_Wine "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\$assembly" /f
        done

        cd "$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/WPF/"
        for assembly in *.[dD]ll
        do
                POL_Wine_WaitBefore "$assembly"
                POL_Wine "$WINEPREFIX/drive_c/windows/temp/gacutil.exe" /i "c:\\windows\\Microsoft.NET\\Framework\\v4.0.30319\\WPF\\$assembly" /f
        done

        # Setting Fix 4 - for wine 1.5.4 and older
        mkdir -p "$WINEPREFIX/drive_c/windows/Microsoft.NET/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a"
        cp "$WINEPREFIX/drive_c/windows/Microsoft.NET/Framework/v4.0.30319/System.EnterpriseServices.dll" "$WINEPREFIX/drive_c/windows/Microsoft.NET/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a"
fi
unset WINEDLLOVERRIDES
wineserver -k

Replies

Edited by petch

gordon24186 Thursday 21 August 2014 at 23:21
gordon24186 Anonymous

Message

How do you install this?  No button to install??

Replies

Thursday 21 August 2014 at 23:23
Configure button > (select virtual drive) > Install components tab
Anonymous
Sunday 5 October 2014 at 1:25
could you install on 64bit host os?
Sunday 5 October 2014 at 2:48
I suppose not
Thursday 7 May 2015 at 19:13
Actually I misread you, you can install it on a 64bit host OS, but not in a 64bit virtual drive

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com