Genshin Impact

Informations

Creator Message
Dadu042
Moderator

Information

This installer has been approved by the team.

Informations

Platforms:
Downloads: 2724
Wine: 5.19-staging

Feedbacks

Description

Free to play MMORPG, 2020. Wikipedia, website.  Size to download: 12 GB.

Known issues:

1. Anti cheat feature: when clicking 'Play' (yellow button) the window just does reduce in the task bar. Fix: do install the specific patch we made.

2. Bad 3D rendering: installing the component DXVK (after the game) can help.

3. Crashes as soon as the game tries to launch. Upgrading Wine version can help (ie: 5.19-staging).

PCGamingWiki, Appdb.winehq.org 

Screenshots

MiniatureMiniatureMiniatureMiniature

Source code

#!/bin/bash
# Date : (2020-09-29)
# Last revision : see the changelog below
# Wine version used : see the changelog below
# Distribution used to test : XUbuntu 18.04 64 bits (Linux kernel v5.4.0). GPU: AMD Vega 11.
# Author : Dadu042
# Licence : Retail
# Only For : http://www.playonlinux.com
#
# TESTED Editions: Launcher v2.3.3.0 (GenshinImpact_install_20200911204035.exe)
#                           v2.3.4.0 (GenshinImpact_install_20201014173947.exe). Game (login screen): OSRELWin1.0.1_R1135452_S1135452_D1135370.
#
# Middlewares used by this software : Unity 2017, vcrun2013, vcrun2015, QT5, DirectX 11.
#
#
# CHANGELOG
# [Dadu042] (2020-09-29 10-00). 
#   Initial script. Game fail to run because of the anti cheat software (mhyprot2.sys), that want admin rights.
# [Dadu042] (2020-10-25 10-00).
#   Update the file installer URL.
# [Dadu042] (2020-10-25 20-00).
#   Wine 5.0.2 -> 5.19-staging (because I have got some crashes some seconds afeer the game did start).
#
# KNOWN ISSUES :

#  Anti-cheat issue:
#  - Wine amd64 4.21, 5.0.2, 5.11-staging, 5.16, 5.18-staging: when clicking 'Play' (yellow button) the window just does reduce in the task bar. Tried: set OS to Win7/8/10. Enable game auto update, wininet.
#    Download file from: http://www.dll-found.com/wdfldr.sys_download.html  copy to  /home/YourUserName/PlayOnLinux's virtual drives/Genshin_Impact/drive_c/users/theuser/Temp/   and into the game folder, copied also in uppercase.
#
#    Tried: copying wdfldr.sys (set as Native) and WDFLDR.SYS into '/drive_c/windows/system32/'.
#
#    Immediate Wine 5.0.2 debug log is:
#    0198:fixme:heap:RtlSetHeapInformation 0x570000 0 0x22db80 4 stub
#    0198:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0198:fixme:heap:RtlSetHeapInformation 0x790000 0 0x22f1b0 4 stub
#    019c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    01a2:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    01a2:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0199:fixme:ver:GetCurrentPackageId (0x99fb00 (nil)): stub
#
#    Wine 5.16:
#    0790:fixme:heap:RtlSetHeapInformation 0000000000890000 0 000000000021DFC0 4 stub
#    0790:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0790:fixme:heap:RtlSetHeapInformation 0000000000AB0000 0 000000000021F080 4 stub
#    079c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    07b8:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    07b8:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0794:fixme:ver:GetCurrentPackageId (0000000000CBFBA0 0000000000000000): stub
#
# KNOWN ISSUES (FIXED):
#  - Wine amd64 5.0.2, 5.19: on the account creation screen (if you want to use Facebook nor Twitter), display is bad and the characters typed are not displayed. Fix: Wine 5.19-staging
#  - Wine amd64 5.19-staging: missing textures (displayed as blue areas). Fix: DXVK.

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="Genshin Impact"
PREFIX="Genshin_Impact"
EDITOR="miHoYo"
GAME_URL="https://en.wikipedia.org/wiki/Genshin_Impact"
AUTHOR="Dadu042"
STEAM_ID=""
GAME_VMS="512"
SHORTCUT_FILENAME="launcher.exe"
SOFTWARE_CATEGORIES="Game;RolePlaying;"
# http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_9:_Standardization#Advanced_Standardization
DOCUMENT_FILE=""


# Starting the script
POL_SetupWindow_Init
                         
# Starting debugging API
POL_Debug_Init
        
# Open dialogue box 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

POL_RequiredVersion "4.3.0" || POL_Debug_Fatal "$APPLICATION_TITLE $VERSION is required to install $TITLE"

# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"

############################################
#  Choose architecture: 32 bits or 64 bits #
############################################

# POL_SetupWindow_menu "$(eval_gettext 'What architecture do you want to use ?')" "$TITLE" "$(eval_gettext '64 bits (recommended)')~$(eval_gettext '32 bits')" "~"
 
# if [ "$APP_ANSWER" == "32 bits" ]; then
#        POL_System_SetArch "x86"
# elif [ "$APP_ANSWER" == "$(eval_gettext '64 bits (recommended)')" ]; then
#        POL_System_SetArch "amd64"
# fi

POL_System_SetArch "amd64"

# Download Wine if necessary then create prefix
POL_Wine_PrefixCreate "5.19-staging"
# POL_Wine_PrefixCreate

# POL_System_TmpCreate "$PREFIX"
             
Set_OS "win7"

#######################################
#  Hacks                              #
#######################################



#######################################
#  Installing mandatory dependencies  #
#######################################

# Avoid game freeze when doing ALT+TAB
POL_Wine_DirectInput "MouseWarpOverride" "force"


# POL_Call POL_Install_vcrun2013
# POL_Call POL_Install_d3dx11

# Disable DirectX 11
# POL_Wine_OverrideDLL "" "d3d11"


################
#      GPU     #
################

# Set Graphic Card information keys for wine
POL_Wine_SetVideoDriver

# Minimum memory size requiered for the graphic card.
POL_SetupWindow_VMS $GAME_VMS

# Asking about memory size of graphic card
# POL_SetupWindow_menu_list "How much memory does your graphics board have?" "$TITLE" "64-128-256-320-384-512-640-768-896-1024-1536-1792-2048-3072-4096" "-" "256"
# VRAM="$APP_ANSWER"
# POL_Wine_Direct3D "VideoMemorySize" "$VRAM"

# Useful for Nvidia GPUs
# POL_Call POL_Install_physx



#######################################
# Create a 'virtual desktop' (window) #
#######################################
  
POL_SetupWindow_menu_list "$(eval_gettext "Choose the game resolution")" "$TITLE" "800x600-1152x864-1024x768-1280x720-1280x800-1280x900-1280x1024-1360x768-1368x768-1440x900-1400x1050-1600x900-1600x1024-1680x1050-1920x1080" "-" "800x600"
    
resolution="$APP_ANSWER"
WIDTH="$(echo $resolution | cut -d"x" -f1)"
HEIGHT="$(echo $resolution | cut -d"x" -f2)"
  
Set_Desktop "On" "$WIDTH" "$HEIGHT"
  
Set_WineWindowTitle "$TITLE"


#############################################
#  Sound problem fix - pulseaudio related   #
#############################################
# [ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
# [ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
## End Fix


#######################################
#  Main part of this script           #
#######################################
                 
# Choose between Steam and other Digital Download versions
# POL_SetupWindow_InstallMethod "STEAM,DVD,LOCAL,DOWNLOAD"
POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"

# POL_SetupWindow_message "Warning: do not install Punk Buster nor DirectX." "$TITLE"
# POL_SetupWindow_message "Warning: do not install DirectX (nor the icons)." "$TITLE"
# POL_SetupWindow_message "Warning: do not install Visual C++ 2013 redistribuable\n nor Direct X." "$TITLE"
# POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"

# POL_SetupWindow_message "$(eval_gettext 'Note: at the end of the first installer (it does installs the downloader program), do not click RUN, instead close the window, then you will run the game from POL/POM.')" "$TITLE"


# Begin game installation
if [ "$INSTALL_METHOD" == "STEAM" ]; then
        POL_Call POL_Install_steam
        # Mandatory pre-install fix for steam
        POL_Call POL_Install_steam_flags "$STEAM_ID"
        # Shortcut done before install for steam version
        POL_Shortcut "steam.exe" "$TITLE" "" "steam://rungameid/$STEAM_ID"
        # Steam install
        POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue')" "$TITLE"
        cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
        POL_Wine start /unix "steam.exe" steam://install/$STEAM_ID
        POL_Wine_WaitExit "$TITLE"
                      
elif [ "$INSTALL_METHOD" == "DVD" ]; then
        POL_SetupWindow_cdrom
                      
        # POL_Call POL_Function_NoCDWarning
               
        POL_SetupWindow_check_cdrom "setup.exe"
        POL_Wine start /unix "$CDROM/setup.exe"
                     
        POL_Wine_WaitExit "$TITLE"
                  
        # Restore screen resolution (game's default is 800x600 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                     
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"

elif [ "$INSTALL_METHOD" == "DOWNLOAD" ]; then
        cd "$WINEPREFIX/drive_c"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: this script will download the demo .')" "$TITLE"
        # POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20200911204035.exe"
        POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20201014173947.exe"
           
        mv GenshinImpact_install_20201014173947.exe GameInstaller.exe
        # mv X.rar gameinstaller.rar
        # mv X.zip gameinstaller.zip
           
        # POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        # POL_System_unrar x "gameinstaller.rar" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        # POL_System_unzip "gameinstaller.zip" -d "$WINEPREFIX/drive_c/game/"
             
        # Extract without sub-folder.
        # unzip "gameinstaller.zip" -j -d "$WINEPREFIX/drive_c/"
             
        # POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"
         
        cd  "$WINEPREFIX/drive_c/game/"
        POL_Wine "GameInstaller.exe" # "/SILENT"
        POL_Wine_WaitBefore "$TITLE"
     
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: do NOT install DirectX.')" "$TITLE"
  
        # cd "$WINEPREFIX/drive_c"
        # rm GameInstaller.exe
             
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        # Restore screen resolution (game's default is 1024x768)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
             
elif [ "$INSTALL_METHOD" == "LOCAL" ]; then
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.EXE')~$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.MSI')~$(eval_gettext '.EXE')" "~"
           
        APP_ANSWER=".EXE"
     
if [ "$APP_ANSWER" == ".EXE" ]; then
        # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the installation file (.EXE)')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
   
        # POL_SetupWindow_message "Note: please answer NO to all the questions that will appear." "$TITLE"
   
        POL_Wine start /unix "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                 
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"


elif [ "$APP_ANSWER" == "$(eval_gettext '.MSI')" ]; then
       # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        POL_Wine msiexec /i  "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                   
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
      
elif [ "$APP_ANSWER" == "$(eval_gettext '.ZIP')" ]; then
        cd "$HOME"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nWARNING: the file name must not have SPACES in its name !.')" "$TITLE"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .ZIP file')" "$TITLE"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unzip "$APP_ANSWER" -d "$WINEPREFIX/drive_c/game/"
           
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
           
elif [ "$APP_ANSWER" == "$(eval_gettext '.RAR')" ]; then
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .RAR file')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unrar x "$APP_ANSWER" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
            
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
fi
fi

################
# Patch update #
################
 
# POL_SetupWindow_menu "$(eval_gettext 'Do you have a official patch-update to install ?')" "$TITLE" "$(eval_gettext 'No')~$(eval_gettext 'Yes')" "~"      
             
if [ "$APP_ANSWER" == "$(eval_gettext 'Yes')" ]; then
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .EXE file to run')" "$TITLE"
        PATCH_EXE="$APP_ANSWER"
        POL_Wine start /unix "$PATCH_EXE"
        POL_Wine_WaitExit "$PATCH_EXE"
fi

#######################################
#  Hacks                              #
#  Editing configuration files        #
#######################################




POL_SetupWindow_message "$(eval_gettext 'Installation is finished.')" "$TITLE"

POL_SetupWindow_message "$(eval_gettext 'WARNING: to avoid to have a huge log file, you should type \ninto Debug flags: fixme-all')" "$TITLE"
             
# POL_System_TmpDelete
POL_SetupWindow_Close
exit 0

Contributions

Filters:

Contribute
Member Message
davidcowboy Tuesday 27 October 2020 at 1:54
davidcowboy Anonymous

Message

Installed with the recommended Wine 5.19-staging version. After following the fixes for the known issues, installing the DXVK component and the patch available for the game after installing, everything is fine. I've had a problem with the hold left-alt to show cursor in-game, after the cursor appeared the game no longer acknowledged my keyboard. After I turned off virtual desktop emulation and disabled window decoration by the window manager in the wine prefix configuration, the problem ceased. Also had some problems with performance, couldn't find a solution for that other than setting the render scale from 1.1 to 0.8 which drastically improved the framerates. Amazing work guys, thank you!
heart

The system I tested the game on for 2+ hours:

OS: Linux Mint 20 x86_64 
Kernel: 5.4.0-52-generic 
Resolution: 1920x1080 
DE: Cinnamon 
WM: Mutter (Muffin) 
CPU: Intel i5-7300HQ (4) @ 3.500GHz 
GPU: NVIDIA GeForce GTX 1050 Mobile 3815MiB
Memory: 7826MiB 

 

Replies

Edited by davidcowboy

FichteFoll Tuesday 27 October 2020 at 0:49
FichteFoll Anonymous

Message

I am able to get the game to start with DXVK (also without) and the patch from the other page applied, but after showing the "Please read this" screen where it loads my character or something, I don't get any refreshes for graphics anymore. DXVK's HUD isn't updated anymore either, but the music starts playing regardless and I have CPU consumption. The only errors I can see on the console are:

00c0:err:seh:RtlCaptureStackBackTrace invalid frame 220178 (0000000000122000-0000000000220000)

which happen a few seconds before the visual freeze. Without DXVK, I get:

0184:err:d3d:wined3d_debug_callback 0x13a29f30: "GL_INVALID_OPERATION in glGetUniformLocation(program not linked)".
0184:err:d3d:wined3d_debug_callback 0x13a29f30: "GL_INVALID_OPERATION in glGetUniformLocation(program not linked)".
0184:err:d3d:wined3d_debug_callback 0x13a29f30: "GL_INVALID_OPERATION in glGetUniformLocation(program not linked)".
0184:err:d3d:wined3d_debug_callback 0x13a29f30: "GL_INVALID_OPERATION in glUseProgram(program 264 not linked)".

I'm on Arch and tried 5.9 and 5.8.5 kernel, with and without DXVK and with wine 5.19 and 5.19-staging, all with the same symptoms. I also tried capturing the mouse and configuring a virtual desktop.

Interestingly, it used to work *once*, where I managed to login, after which it crashed while inactive and I never got that far again.

Replies

Anonymous
Tuesday 27 October 2020 at 0:55
Since it says wined3d I think it doesn't use dxvk, do you have the vulkan drivers installed on your system? https://wiki.archlinux.org/index.php/Vulkan
EDIT: Missed the "Without DXVK", sorry. Then I sadly don't know why that is.
Anonymous
Wednesday 28 October 2020 at 23:56
Interestingly, installing into a new prefix worked.

However, I'm now getting a Error code: 31-4302 in wine-staging 5.19, 5.20 and in Proton 5.13 (which uses wine 5.12)

 
Anonymous
Thursday 29 October 2020 at 11:34
We all getting the same 31-4302 now.
Dadu042 Monday 26 October 2020 at 10:22
Dadu042
Moderator

Information

This update has been approved by the team.

Message

Back because I had issues with virtualdesktop (no keyboard).

Differences

@@ -20,12 +20,9 @@
 #   Update the file installer URL.
 # [Dadu042] (2020-10-25 20-00).
 #   Wine 5.0.2 -> 5.19-staging (because I have got some crashes some seconds afeer the game did start).
-# [Dadu042] (2020-10-26 20-00).
-#   Add virtual desktop and mouse override.
 #
 # KNOWN ISSUES :
-#  - Wine amd64 5.19-staging: missing textures (displayed as blue areas).
-#
+
 #  Anti-cheat issue:
 #  - Wine amd64 4.21, 5.0.2, 5.11-staging, 5.16, 5.18-staging: when clicking 'Play' (yellow button) the window just does reduce in the task bar. Tried: set OS to Win7/8/10. Enable game auto update, wininet.
 #    Download file from: http://www.dll-found.com/wdfldr.sys_download.html  copy to  /home/YourUserName/PlayOnLinux's virtual drives/Genshin_Impact/drive_c/users/theuser/Temp/   and into the game folder, copied also in uppercase.
@@ -52,6 +49,7 @@
 #
 # KNOWN ISSUES (FIXED):
 #  - Wine amd64 5.0.2, 5.19: on the account creation screen (if you want to use Facebook nor Twitter), display is bad and the characters typed are not displayed. Fix: Wine 5.19-staging
+#  - Wine amd64 5.19-staging: missing textures (displayed as blue areas). Fix: DXVK.
 
 [ "$PLAYONLINUX" = "" ] && exit 0
 source "$PLAYONLINUX/lib/sources"

New source code

#!/bin/bash
# Date : (2020-09-29)
# Last revision : see the changelog below
# Wine version used : see the changelog below
# Distribution used to test : XUbuntu 18.04 64 bits (Linux kernel v5.4.0). GPU: AMD Vega 11.
# Author : Dadu042
# Licence : Retail
# Only For : http://www.playonlinux.com
#
# TESTED Editions: Launcher v2.3.3.0 (GenshinImpact_install_20200911204035.exe)
#                           v2.3.4.0 (GenshinImpact_install_20201014173947.exe). Game (login screen): OSRELWin1.0.1_R1135452_S1135452_D1135370.
#
# Middlewares used by this software : Unity 2017, vcrun2013, vcrun2015, QT5, DirectX 11.
#
#
# CHANGELOG
# [Dadu042] (2020-09-29 10-00). 
#   Initial script. Game fail to run because of the anti cheat software (mhyprot2.sys), that want admin rights.
# [Dadu042] (2020-10-25 10-00).
#   Update the file installer URL.
# [Dadu042] (2020-10-25 20-00).
#   Wine 5.0.2 -> 5.19-staging (because I have got some crashes some seconds afeer the game did start).
#
# KNOWN ISSUES :

#  Anti-cheat issue:
#  - Wine amd64 4.21, 5.0.2, 5.11-staging, 5.16, 5.18-staging: when clicking 'Play' (yellow button) the window just does reduce in the task bar. Tried: set OS to Win7/8/10. Enable game auto update, wininet.
#    Download file from: http://www.dll-found.com/wdfldr.sys_download.html  copy to  /home/YourUserName/PlayOnLinux's virtual drives/Genshin_Impact/drive_c/users/theuser/Temp/   and into the game folder, copied also in uppercase.
#
#    Tried: copying wdfldr.sys (set as Native) and WDFLDR.SYS into '/drive_c/windows/system32/'.
#
#    Immediate Wine 5.0.2 debug log is:
#    0198:fixme:heap:RtlSetHeapInformation 0x570000 0 0x22db80 4 stub
#    0198:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0198:fixme:heap:RtlSetHeapInformation 0x790000 0 0x22f1b0 4 stub
#    019c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    01a2:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    01a2:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0199:fixme:ver:GetCurrentPackageId (0x99fb00 (nil)): stub
#
#    Wine 5.16:
#    0790:fixme:heap:RtlSetHeapInformation 0000000000890000 0 000000000021DFC0 4 stub
#    0790:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0790:fixme:heap:RtlSetHeapInformation 0000000000AB0000 0 000000000021F080 4 stub
#    079c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    07b8:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    07b8:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0794:fixme:ver:GetCurrentPackageId (0000000000CBFBA0 0000000000000000): stub
#
# KNOWN ISSUES (FIXED):
#  - Wine amd64 5.0.2, 5.19: on the account creation screen (if you want to use Facebook nor Twitter), display is bad and the characters typed are not displayed. Fix: Wine 5.19-staging
#  - Wine amd64 5.19-staging: missing textures (displayed as blue areas). Fix: DXVK.

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="Genshin Impact"
PREFIX="Genshin_Impact"
EDITOR="miHoYo"
GAME_URL="https://en.wikipedia.org/wiki/Genshin_Impact"
AUTHOR="Dadu042"
STEAM_ID=""
GAME_VMS="512"
SHORTCUT_FILENAME="launcher.exe"
SOFTWARE_CATEGORIES="Game;RolePlaying;"
# http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_9:_Standardization#Advanced_Standardization
DOCUMENT_FILE=""


# Starting the script
POL_SetupWindow_Init
                         
# Starting debugging API
POL_Debug_Init
        
# Open dialogue box 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

POL_RequiredVersion "4.3.0" || POL_Debug_Fatal "$APPLICATION_TITLE $VERSION is required to install $TITLE"

# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"

############################################
#  Choose architecture: 32 bits or 64 bits #
############################################

# POL_SetupWindow_menu "$(eval_gettext 'What architecture do you want to use ?')" "$TITLE" "$(eval_gettext '64 bits (recommended)')~$(eval_gettext '32 bits')" "~"
 
# if [ "$APP_ANSWER" == "32 bits" ]; then
#        POL_System_SetArch "x86"
# elif [ "$APP_ANSWER" == "$(eval_gettext '64 bits (recommended)')" ]; then
#        POL_System_SetArch "amd64"
# fi

POL_System_SetArch "amd64"

# Download Wine if necessary then create prefix
POL_Wine_PrefixCreate "5.19-staging"
# POL_Wine_PrefixCreate

# POL_System_TmpCreate "$PREFIX"
             
Set_OS "win7"

#######################################
#  Hacks                              #
#######################################



#######################################
#  Installing mandatory dependencies  #
#######################################

# Avoid game freeze when doing ALT+TAB
POL_Wine_DirectInput "MouseWarpOverride" "force"


# POL_Call POL_Install_vcrun2013
# POL_Call POL_Install_d3dx11

# Disable DirectX 11
# POL_Wine_OverrideDLL "" "d3d11"


################
#      GPU     #
################

# Set Graphic Card information keys for wine
POL_Wine_SetVideoDriver

# Minimum memory size requiered for the graphic card.
POL_SetupWindow_VMS $GAME_VMS

# Asking about memory size of graphic card
# POL_SetupWindow_menu_list "How much memory does your graphics board have?" "$TITLE" "64-128-256-320-384-512-640-768-896-1024-1536-1792-2048-3072-4096" "-" "256"
# VRAM="$APP_ANSWER"
# POL_Wine_Direct3D "VideoMemorySize" "$VRAM"

# Useful for Nvidia GPUs
# POL_Call POL_Install_physx



#######################################
# Create a 'virtual desktop' (window) #
#######################################
  
POL_SetupWindow_menu_list "$(eval_gettext "Choose the game resolution")" "$TITLE" "800x600-1152x864-1024x768-1280x720-1280x800-1280x900-1280x1024-1360x768-1368x768-1440x900-1400x1050-1600x900-1600x1024-1680x1050-1920x1080" "-" "800x600"
    
resolution="$APP_ANSWER"
WIDTH="$(echo $resolution | cut -d"x" -f1)"
HEIGHT="$(echo $resolution | cut -d"x" -f2)"
  
Set_Desktop "On" "$WIDTH" "$HEIGHT"
  
Set_WineWindowTitle "$TITLE"


#############################################
#  Sound problem fix - pulseaudio related   #
#############################################
# [ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
# [ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
## End Fix


#######################################
#  Main part of this script           #
#######################################
                 
# Choose between Steam and other Digital Download versions
# POL_SetupWindow_InstallMethod "STEAM,DVD,LOCAL,DOWNLOAD"
POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"

# POL_SetupWindow_message "Warning: do not install Punk Buster nor DirectX." "$TITLE"
# POL_SetupWindow_message "Warning: do not install DirectX (nor the icons)." "$TITLE"
# POL_SetupWindow_message "Warning: do not install Visual C++ 2013 redistribuable\n nor Direct X." "$TITLE"
# POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"

# POL_SetupWindow_message "$(eval_gettext 'Note: at the end of the first installer (it does installs the downloader program), do not click RUN, instead close the window, then you will run the game from POL/POM.')" "$TITLE"


# Begin game installation
if [ "$INSTALL_METHOD" == "STEAM" ]; then
        POL_Call POL_Install_steam
        # Mandatory pre-install fix for steam
        POL_Call POL_Install_steam_flags "$STEAM_ID"
        # Shortcut done before install for steam version
        POL_Shortcut "steam.exe" "$TITLE" "" "steam://rungameid/$STEAM_ID"
        # Steam install
        POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue')" "$TITLE"
        cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
        POL_Wine start /unix "steam.exe" steam://install/$STEAM_ID
        POL_Wine_WaitExit "$TITLE"
                      
elif [ "$INSTALL_METHOD" == "DVD" ]; then
        POL_SetupWindow_cdrom
                      
        # POL_Call POL_Function_NoCDWarning
               
        POL_SetupWindow_check_cdrom "setup.exe"
        POL_Wine start /unix "$CDROM/setup.exe"
                     
        POL_Wine_WaitExit "$TITLE"
                  
        # Restore screen resolution (game's default is 800x600 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                     
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"

elif [ "$INSTALL_METHOD" == "DOWNLOAD" ]; then
        cd "$WINEPREFIX/drive_c"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: this script will download the demo .')" "$TITLE"
        # POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20200911204035.exe"
        POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20201014173947.exe"
           
        mv GenshinImpact_install_20201014173947.exe GameInstaller.exe
        # mv X.rar gameinstaller.rar
        # mv X.zip gameinstaller.zip
           
        # POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        # POL_System_unrar x "gameinstaller.rar" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        # POL_System_unzip "gameinstaller.zip" -d "$WINEPREFIX/drive_c/game/"
             
        # Extract without sub-folder.
        # unzip "gameinstaller.zip" -j -d "$WINEPREFIX/drive_c/"
             
        # POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"
         
        cd  "$WINEPREFIX/drive_c/game/"
        POL_Wine "GameInstaller.exe" # "/SILENT"
        POL_Wine_WaitBefore "$TITLE"
     
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: do NOT install DirectX.')" "$TITLE"
  
        # cd "$WINEPREFIX/drive_c"
        # rm GameInstaller.exe
             
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        # Restore screen resolution (game's default is 1024x768)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
             
elif [ "$INSTALL_METHOD" == "LOCAL" ]; then
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.EXE')~$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.MSI')~$(eval_gettext '.EXE')" "~"
           
        APP_ANSWER=".EXE"
     
if [ "$APP_ANSWER" == ".EXE" ]; then
        # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the installation file (.EXE)')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
   
        # POL_SetupWindow_message "Note: please answer NO to all the questions that will appear." "$TITLE"
   
        POL_Wine start /unix "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                 
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"


elif [ "$APP_ANSWER" == "$(eval_gettext '.MSI')" ]; then
       # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        POL_Wine msiexec /i  "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                   
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
      
elif [ "$APP_ANSWER" == "$(eval_gettext '.ZIP')" ]; then
        cd "$HOME"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nWARNING: the file name must not have SPACES in its name !.')" "$TITLE"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .ZIP file')" "$TITLE"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unzip "$APP_ANSWER" -d "$WINEPREFIX/drive_c/game/"
           
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
           
elif [ "$APP_ANSWER" == "$(eval_gettext '.RAR')" ]; then
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .RAR file')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unrar x "$APP_ANSWER" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
            
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
fi
fi

################
# Patch update #
################
 
# POL_SetupWindow_menu "$(eval_gettext 'Do you have a official patch-update to install ?')" "$TITLE" "$(eval_gettext 'No')~$(eval_gettext 'Yes')" "~"      
             
if [ "$APP_ANSWER" == "$(eval_gettext 'Yes')" ]; then
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .EXE file to run')" "$TITLE"
        PATCH_EXE="$APP_ANSWER"
        POL_Wine start /unix "$PATCH_EXE"
        POL_Wine_WaitExit "$PATCH_EXE"
fi

#######################################
#  Hacks                              #
#  Editing configuration files        #
#######################################




POL_SetupWindow_message "$(eval_gettext 'Installation is finished.')" "$TITLE"

POL_SetupWindow_message "$(eval_gettext 'WARNING: to avoid to have a huge log file, you should type \ninto Debug flags: fixme-all')" "$TITLE"
             
# POL_System_TmpDelete
POL_SetupWindow_Close
exit 0

Replies

Anonymous
Wednesday 28 October 2020 at 18:07
Just open wine registry and put in HKEY_CURRENT_USER\Software\Wine\X11 Driver 'UseTakeFocus' REG_SZ with value N. After that no virtual desktop is needed.

Edited by Dadu042

Dadu042 Monday 26 October 2020 at 9:42
Dadu042
Moderator

Warning

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

Differences

@@ -16,8 +16,12 @@
 # CHANGELOG
 # [Dadu042] (2020-09-29 10-00). 
 #   Initial script. Game fail to run because of the anti cheat software (mhyprot2.sys), that want admin rights.
-# [Dadu042] (2020-10-25 10-00). 
+# [Dadu042] (2020-10-25 10-00).
 #   Update the file installer URL.
+# [Dadu042] (2020-10-25 20-00).
+#   Wine 5.0.2 -> 5.19-staging (because I have got some crashes some seconds afeer the game did start).
+# [Dadu042] (2020-10-26 20-00).
+#   Add virtual desktop and mouse override.
 #
 # KNOWN ISSUES :
 #  - Wine amd64 5.19-staging: missing textures (displayed as blue areas).
@@ -58,7 +62,7 @@
 GAME_URL="https://en.wikipedia.org/wiki/Genshin_Impact"
 AUTHOR="Dadu042"
 STEAM_ID=""
-GAME_VMS="1024"
+GAME_VMS="512"
 SHORTCUT_FILENAME="launcher.exe"
 SOFTWARE_CATEGORIES="Game;RolePlaying;"
 # http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_9:_Standardization#Advanced_Standardization
@@ -94,7 +98,7 @@
 POL_System_SetArch "amd64"
 
 # Download Wine if necessary then create prefix
-POL_Wine_PrefixCreate "5.0.2"
+POL_Wine_PrefixCreate "5.19-staging"
 # POL_Wine_PrefixCreate
 
 # POL_System_TmpCreate "$PREFIX"
@@ -107,11 +111,13 @@
 
 
 
-
 #######################################
 #  Installing mandatory dependencies  #
 #######################################
 
+# Avoid game freeze when doing ALT+TAB
+POL_Wine_DirectInput "MouseWarpOverride" "force"
+
 
 # POL_Call POL_Install_vcrun2013
 # POL_Call POL_Install_d3dx11
@@ -139,6 +145,22 @@
 # POL_Call POL_Install_physx
 
 
+
+#######################################
+# Create a 'virtual desktop' (window) #
+#######################################
+  
+POL_SetupWindow_menu_list "$(eval_gettext "Choose the game resolution")" "$TITLE" "800x600-1152x864-1024x768-1280x720-1280x800-1280x900-1280x1024-1360x768-1368x768-1440x900-1400x1050-1600x900-1600x1024-1680x1050-1920x1080" "-" "800x600"
+    
+resolution="$APP_ANSWER"
+WIDTH="$(echo $resolution | cut -d"x" -f1)"
+HEIGHT="$(echo $resolution | cut -d"x" -f2)"
+  
+Set_Desktop "On" "$WIDTH" "$HEIGHT"
+  
+Set_WineWindowTitle "$TITLE"
+
+
 #############################################
 #  Sound problem fix - pulseaudio related   #
 #############################################

New source code

#!/bin/bash
# Date : (2020-09-29)
# Last revision : see the changelog below
# Wine version used : see the changelog below
# Distribution used to test : XUbuntu 18.04 64 bits (Linux kernel v5.4.0). GPU: AMD Vega 11.
# Author : Dadu042
# Licence : Retail
# Only For : http://www.playonlinux.com
#
# TESTED Editions: Launcher v2.3.3.0 (GenshinImpact_install_20200911204035.exe)
#                           v2.3.4.0 (GenshinImpact_install_20201014173947.exe). Game (login screen): OSRELWin1.0.1_R1135452_S1135452_D1135370.
#
# Middlewares used by this software : Unity 2017, vcrun2013, vcrun2015, QT5, DirectX 11.
#
#
# CHANGELOG
# [Dadu042] (2020-09-29 10-00). 
#   Initial script. Game fail to run because of the anti cheat software (mhyprot2.sys), that want admin rights.
# [Dadu042] (2020-10-25 10-00).
#   Update the file installer URL.
# [Dadu042] (2020-10-25 20-00).
#   Wine 5.0.2 -> 5.19-staging (because I have got some crashes some seconds afeer the game did start).
# [Dadu042] (2020-10-26 20-00).
#   Add virtual desktop and mouse override.
#
# KNOWN ISSUES :
#  - Wine amd64 5.19-staging: missing textures (displayed as blue areas).
#
#  Anti-cheat issue:
#  - Wine amd64 4.21, 5.0.2, 5.11-staging, 5.16, 5.18-staging: when clicking 'Play' (yellow button) the window just does reduce in the task bar. Tried: set OS to Win7/8/10. Enable game auto update, wininet.
#    Download file from: http://www.dll-found.com/wdfldr.sys_download.html  copy to  /home/YourUserName/PlayOnLinux's virtual drives/Genshin_Impact/drive_c/users/theuser/Temp/   and into the game folder, copied also in uppercase.
#
#    Tried: copying wdfldr.sys (set as Native) and WDFLDR.SYS into '/drive_c/windows/system32/'.
#
#    Immediate Wine 5.0.2 debug log is:
#    0198:fixme:heap:RtlSetHeapInformation 0x570000 0 0x22db80 4 stub
#    0198:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0198:fixme:heap:RtlSetHeapInformation 0x790000 0 0x22f1b0 4 stub
#    019c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    01a2:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    01a2:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0199:fixme:ver:GetCurrentPackageId (0x99fb00 (nil)): stub
#
#    Wine 5.16:
#    0790:fixme:heap:RtlSetHeapInformation 0000000000890000 0 000000000021DFC0 4 stub
#    0790:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0790:fixme:heap:RtlSetHeapInformation 0000000000AB0000 0 000000000021F080 4 stub
#    079c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    07b8:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    07b8:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0794:fixme:ver:GetCurrentPackageId (0000000000CBFBA0 0000000000000000): stub
#
# KNOWN ISSUES (FIXED):
#  - Wine amd64 5.0.2, 5.19: on the account creation screen (if you want to use Facebook nor Twitter), display is bad and the characters typed are not displayed. Fix: Wine 5.19-staging

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="Genshin Impact"
PREFIX="Genshin_Impact"
EDITOR="miHoYo"
GAME_URL="https://en.wikipedia.org/wiki/Genshin_Impact"
AUTHOR="Dadu042"
STEAM_ID=""
GAME_VMS="512"
SHORTCUT_FILENAME="launcher.exe"
SOFTWARE_CATEGORIES="Game;RolePlaying;"
# http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_9:_Standardization#Advanced_Standardization
DOCUMENT_FILE=""


# Starting the script
POL_SetupWindow_Init
                         
# Starting debugging API
POL_Debug_Init
        
# Open dialogue box 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

POL_RequiredVersion "4.3.0" || POL_Debug_Fatal "$APPLICATION_TITLE $VERSION is required to install $TITLE"

# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"

############################################
#  Choose architecture: 32 bits or 64 bits #
############################################

# POL_SetupWindow_menu "$(eval_gettext 'What architecture do you want to use ?')" "$TITLE" "$(eval_gettext '64 bits (recommended)')~$(eval_gettext '32 bits')" "~"
 
# if [ "$APP_ANSWER" == "32 bits" ]; then
#        POL_System_SetArch "x86"
# elif [ "$APP_ANSWER" == "$(eval_gettext '64 bits (recommended)')" ]; then
#        POL_System_SetArch "amd64"
# fi

POL_System_SetArch "amd64"

# Download Wine if necessary then create prefix
POL_Wine_PrefixCreate "5.19-staging"
# POL_Wine_PrefixCreate

# POL_System_TmpCreate "$PREFIX"
             
Set_OS "win7"

#######################################
#  Hacks                              #
#######################################



#######################################
#  Installing mandatory dependencies  #
#######################################

# Avoid game freeze when doing ALT+TAB
POL_Wine_DirectInput "MouseWarpOverride" "force"


# POL_Call POL_Install_vcrun2013
# POL_Call POL_Install_d3dx11

# Disable DirectX 11
# POL_Wine_OverrideDLL "" "d3d11"


################
#      GPU     #
################

# Set Graphic Card information keys for wine
POL_Wine_SetVideoDriver

# Minimum memory size requiered for the graphic card.
POL_SetupWindow_VMS $GAME_VMS

# Asking about memory size of graphic card
# POL_SetupWindow_menu_list "How much memory does your graphics board have?" "$TITLE" "64-128-256-320-384-512-640-768-896-1024-1536-1792-2048-3072-4096" "-" "256"
# VRAM="$APP_ANSWER"
# POL_Wine_Direct3D "VideoMemorySize" "$VRAM"

# Useful for Nvidia GPUs
# POL_Call POL_Install_physx



#######################################
# Create a 'virtual desktop' (window) #
#######################################
  
POL_SetupWindow_menu_list "$(eval_gettext "Choose the game resolution")" "$TITLE" "800x600-1152x864-1024x768-1280x720-1280x800-1280x900-1280x1024-1360x768-1368x768-1440x900-1400x1050-1600x900-1600x1024-1680x1050-1920x1080" "-" "800x600"
    
resolution="$APP_ANSWER"
WIDTH="$(echo $resolution | cut -d"x" -f1)"
HEIGHT="$(echo $resolution | cut -d"x" -f2)"
  
Set_Desktop "On" "$WIDTH" "$HEIGHT"
  
Set_WineWindowTitle "$TITLE"


#############################################
#  Sound problem fix - pulseaudio related   #
#############################################
# [ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
# [ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
## End Fix


#######################################
#  Main part of this script           #
#######################################
                 
# Choose between Steam and other Digital Download versions
# POL_SetupWindow_InstallMethod "STEAM,DVD,LOCAL,DOWNLOAD"
POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"

# POL_SetupWindow_message "Warning: do not install Punk Buster nor DirectX." "$TITLE"
# POL_SetupWindow_message "Warning: do not install DirectX (nor the icons)." "$TITLE"
# POL_SetupWindow_message "Warning: do not install Visual C++ 2013 redistribuable\n nor Direct X." "$TITLE"
# POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"

# POL_SetupWindow_message "$(eval_gettext 'Note: at the end of the first installer (it does installs the downloader program), do not click RUN, instead close the window, then you will run the game from POL/POM.')" "$TITLE"


# Begin game installation
if [ "$INSTALL_METHOD" == "STEAM" ]; then
        POL_Call POL_Install_steam
        # Mandatory pre-install fix for steam
        POL_Call POL_Install_steam_flags "$STEAM_ID"
        # Shortcut done before install for steam version
        POL_Shortcut "steam.exe" "$TITLE" "" "steam://rungameid/$STEAM_ID"
        # Steam install
        POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue')" "$TITLE"
        cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
        POL_Wine start /unix "steam.exe" steam://install/$STEAM_ID
        POL_Wine_WaitExit "$TITLE"
                      
elif [ "$INSTALL_METHOD" == "DVD" ]; then
        POL_SetupWindow_cdrom
                      
        # POL_Call POL_Function_NoCDWarning
               
        POL_SetupWindow_check_cdrom "setup.exe"
        POL_Wine start /unix "$CDROM/setup.exe"
                     
        POL_Wine_WaitExit "$TITLE"
                  
        # Restore screen resolution (game's default is 800x600 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                     
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"

elif [ "$INSTALL_METHOD" == "DOWNLOAD" ]; then
        cd "$WINEPREFIX/drive_c"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: this script will download the demo .')" "$TITLE"
        # POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20200911204035.exe"
        POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20201014173947.exe"
           
        mv GenshinImpact_install_20201014173947.exe GameInstaller.exe
        # mv X.rar gameinstaller.rar
        # mv X.zip gameinstaller.zip
           
        # POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        # POL_System_unrar x "gameinstaller.rar" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        # POL_System_unzip "gameinstaller.zip" -d "$WINEPREFIX/drive_c/game/"
             
        # Extract without sub-folder.
        # unzip "gameinstaller.zip" -j -d "$WINEPREFIX/drive_c/"
             
        # POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"
         
        cd  "$WINEPREFIX/drive_c/game/"
        POL_Wine "GameInstaller.exe" # "/SILENT"
        POL_Wine_WaitBefore "$TITLE"
     
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: do NOT install DirectX.')" "$TITLE"
  
        # cd "$WINEPREFIX/drive_c"
        # rm GameInstaller.exe
             
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        # Restore screen resolution (game's default is 1024x768)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
             
elif [ "$INSTALL_METHOD" == "LOCAL" ]; then
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.EXE')~$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.MSI')~$(eval_gettext '.EXE')" "~"
           
        APP_ANSWER=".EXE"
     
if [ "$APP_ANSWER" == ".EXE" ]; then
        # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the installation file (.EXE)')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
   
        # POL_SetupWindow_message "Note: please answer NO to all the questions that will appear." "$TITLE"
   
        POL_Wine start /unix "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                 
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"


elif [ "$APP_ANSWER" == "$(eval_gettext '.MSI')" ]; then
       # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        POL_Wine msiexec /i  "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                   
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
      
elif [ "$APP_ANSWER" == "$(eval_gettext '.ZIP')" ]; then
        cd "$HOME"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nWARNING: the file name must not have SPACES in its name !.')" "$TITLE"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .ZIP file')" "$TITLE"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unzip "$APP_ANSWER" -d "$WINEPREFIX/drive_c/game/"
           
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
           
elif [ "$APP_ANSWER" == "$(eval_gettext '.RAR')" ]; then
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .RAR file')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unrar x "$APP_ANSWER" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
            
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
fi
fi

################
# Patch update #
################
 
# POL_SetupWindow_menu "$(eval_gettext 'Do you have a official patch-update to install ?')" "$TITLE" "$(eval_gettext 'No')~$(eval_gettext 'Yes')" "~"      
             
if [ "$APP_ANSWER" == "$(eval_gettext 'Yes')" ]; then
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .EXE file to run')" "$TITLE"
        PATCH_EXE="$APP_ANSWER"
        POL_Wine start /unix "$PATCH_EXE"
        POL_Wine_WaitExit "$PATCH_EXE"
fi

#######################################
#  Hacks                              #
#  Editing configuration files        #
#######################################




POL_SetupWindow_message "$(eval_gettext 'Installation is finished.')" "$TITLE"

POL_SetupWindow_message "$(eval_gettext 'WARNING: to avoid to have a huge log file, you should type \ninto Debug flags: fixme-all')" "$TITLE"
             
# POL_System_TmpDelete
POL_SetupWindow_Close
exit 0

Replies

sentientyeet Monday 26 October 2020 at 9:15
sentientyeet Anonymous

Message

Using Wine 5.19-staging (ZFGameBrowser.exe crash if not using this version) with the DXVK_172 component installed.

To fix the issue where the game doesn't respond to inputs after an ALT-TAB, turn on Automatically capture mouse in full-screen windows and Emulate virtual desktop (set to your native or preferred res)

Running smoothly, no issues so far.

Replies

Dadu042 Sunday 25 October 2020 at 20:24
Dadu042
Moderator

Warning

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

Differences

@@ -8,9 +8,9 @@
 # Only For : http://www.playonlinux.com
 #
 # TESTED Editions: Launcher v2.3.3.0 (GenshinImpact_install_20200911204035.exe)
-#                           v2.3.4.0 (GenshinImpact_install_20201014173947.exe)
+#                           v2.3.4.0 (GenshinImpact_install_20201014173947.exe). Game (login screen): OSRELWin1.0.1_R1135452_S1135452_D1135370.
 #
-# Middlewares used by this software : Unity 2017, vcrun2013, vcrun2015, QT5.
+# Middlewares used by this software : Unity 2017, vcrun2013, vcrun2015, QT5, DirectX 11.
 #
 #
 # CHANGELOG
@@ -20,6 +20,7 @@
 #   Update the file installer URL.
 #
 # KNOWN ISSUES :
+#  - Wine amd64 5.19-staging: missing textures (displayed as blue areas).
 #
 #  Anti-cheat issue:
 #  - Wine amd64 4.21, 5.0.2, 5.11-staging, 5.16, 5.18-staging: when clicking 'Play' (yellow button) the window just does reduce in the task bar. Tried: set OS to Win7/8/10. Enable game auto update, wininet.
@@ -36,7 +37,6 @@
 #    01a2:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
 #    0199:fixme:ver:GetCurrentPackageId (0x99fb00 (nil)): stub
 #
-#
 #    Wine 5.16:
 #    0790:fixme:heap:RtlSetHeapInformation 0000000000890000 0 000000000021DFC0 4 stub
 #    0790:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
@@ -47,7 +47,7 @@
 #    0794:fixme:ver:GetCurrentPackageId (0000000000CBFBA0 0000000000000000): stub
 #
 # KNOWN ISSUES (FIXED):
-#  - Wine amd64 5.0.2: X
+#  - Wine amd64 5.0.2, 5.19: on the account creation screen (if you want to use Facebook nor Twitter), display is bad and the characters typed are not displayed. Fix: Wine 5.19-staging
 
 [ "$PLAYONLINUX" = "" ] && exit 0
 source "$PLAYONLINUX/lib/sources"
@@ -58,7 +58,7 @@
 GAME_URL="https://en.wikipedia.org/wiki/Genshin_Impact"
 AUTHOR="Dadu042"
 STEAM_ID=""
-GAME_VMS="512"
+GAME_VMS="1024"
 SHORTCUT_FILENAME="launcher.exe"
 SOFTWARE_CATEGORIES="Game;RolePlaying;"
 # http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_9:_Standardization#Advanced_Standardization
@@ -322,7 +322,7 @@
 
 POL_SetupWindow_message "$(eval_gettext 'Installation is finished.')" "$TITLE"
 
-# POL_SetupWindow_message "$(eval_gettext 'WARNING: to avoid to have a huge log file, you should type \ninto Debug flags : fixme-all')" "$TITLE"
+POL_SetupWindow_message "$(eval_gettext 'WARNING: to avoid to have a huge log file, you should type \ninto Debug flags: fixme-all')" "$TITLE"
              
 # POL_System_TmpDelete
 POL_SetupWindow_Close

New source code

#!/bin/bash
# Date : (2020-09-29)
# Last revision : see the changelog below
# Wine version used : see the changelog below
# Distribution used to test : XUbuntu 18.04 64 bits (Linux kernel v5.4.0). GPU: AMD Vega 11.
# Author : Dadu042
# Licence : Retail
# Only For : http://www.playonlinux.com
#
# TESTED Editions: Launcher v2.3.3.0 (GenshinImpact_install_20200911204035.exe)
#                           v2.3.4.0 (GenshinImpact_install_20201014173947.exe). Game (login screen): OSRELWin1.0.1_R1135452_S1135452_D1135370.
#
# Middlewares used by this software : Unity 2017, vcrun2013, vcrun2015, QT5, DirectX 11.
#
#
# CHANGELOG
# [Dadu042] (2020-09-29 10-00). 
#   Initial script. Game fail to run because of the anti cheat software (mhyprot2.sys), that want admin rights.
# [Dadu042] (2020-10-25 10-00). 
#   Update the file installer URL.
#
# KNOWN ISSUES :
#  - Wine amd64 5.19-staging: missing textures (displayed as blue areas).
#
#  Anti-cheat issue:
#  - Wine amd64 4.21, 5.0.2, 5.11-staging, 5.16, 5.18-staging: when clicking 'Play' (yellow button) the window just does reduce in the task bar. Tried: set OS to Win7/8/10. Enable game auto update, wininet.
#    Download file from: http://www.dll-found.com/wdfldr.sys_download.html  copy to  /home/YourUserName/PlayOnLinux's virtual drives/Genshin_Impact/drive_c/users/theuser/Temp/   and into the game folder, copied also in uppercase.
#
#    Tried: copying wdfldr.sys (set as Native) and WDFLDR.SYS into '/drive_c/windows/system32/'.
#
#    Immediate Wine 5.0.2 debug log is:
#    0198:fixme:heap:RtlSetHeapInformation 0x570000 0 0x22db80 4 stub
#    0198:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0198:fixme:heap:RtlSetHeapInformation 0x790000 0 0x22f1b0 4 stub
#    019c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    01a2:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    01a2:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0199:fixme:ver:GetCurrentPackageId (0x99fb00 (nil)): stub
#
#    Wine 5.16:
#    0790:fixme:heap:RtlSetHeapInformation 0000000000890000 0 000000000021DFC0 4 stub
#    0790:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0790:fixme:heap:RtlSetHeapInformation 0000000000AB0000 0 000000000021F080 4 stub
#    079c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    07b8:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    07b8:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0794:fixme:ver:GetCurrentPackageId (0000000000CBFBA0 0000000000000000): stub
#
# KNOWN ISSUES (FIXED):
#  - Wine amd64 5.0.2, 5.19: on the account creation screen (if you want to use Facebook nor Twitter), display is bad and the characters typed are not displayed. Fix: Wine 5.19-staging

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="Genshin Impact"
PREFIX="Genshin_Impact"
EDITOR="miHoYo"
GAME_URL="https://en.wikipedia.org/wiki/Genshin_Impact"
AUTHOR="Dadu042"
STEAM_ID=""
GAME_VMS="1024"
SHORTCUT_FILENAME="launcher.exe"
SOFTWARE_CATEGORIES="Game;RolePlaying;"
# http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_9:_Standardization#Advanced_Standardization
DOCUMENT_FILE=""


# Starting the script
POL_SetupWindow_Init
                         
# Starting debugging API
POL_Debug_Init
        
# Open dialogue box 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

POL_RequiredVersion "4.3.0" || POL_Debug_Fatal "$APPLICATION_TITLE $VERSION is required to install $TITLE"

# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"

############################################
#  Choose architecture: 32 bits or 64 bits #
############################################

# POL_SetupWindow_menu "$(eval_gettext 'What architecture do you want to use ?')" "$TITLE" "$(eval_gettext '64 bits (recommended)')~$(eval_gettext '32 bits')" "~"
 
# if [ "$APP_ANSWER" == "32 bits" ]; then
#        POL_System_SetArch "x86"
# elif [ "$APP_ANSWER" == "$(eval_gettext '64 bits (recommended)')" ]; then
#        POL_System_SetArch "amd64"
# fi

POL_System_SetArch "amd64"

# Download Wine if necessary then create prefix
POL_Wine_PrefixCreate "5.0.2"
# POL_Wine_PrefixCreate

# POL_System_TmpCreate "$PREFIX"
             
Set_OS "win7"

#######################################
#  Hacks                              #
#######################################




#######################################
#  Installing mandatory dependencies  #
#######################################


# POL_Call POL_Install_vcrun2013
# POL_Call POL_Install_d3dx11

# Disable DirectX 11
# POL_Wine_OverrideDLL "" "d3d11"


################
#      GPU     #
################

# Set Graphic Card information keys for wine
POL_Wine_SetVideoDriver

# Minimum memory size requiered for the graphic card.
POL_SetupWindow_VMS $GAME_VMS

# Asking about memory size of graphic card
# POL_SetupWindow_menu_list "How much memory does your graphics board have?" "$TITLE" "64-128-256-320-384-512-640-768-896-1024-1536-1792-2048-3072-4096" "-" "256"
# VRAM="$APP_ANSWER"
# POL_Wine_Direct3D "VideoMemorySize" "$VRAM"

# Useful for Nvidia GPUs
# POL_Call POL_Install_physx


#############################################
#  Sound problem fix - pulseaudio related   #
#############################################
# [ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
# [ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
## End Fix


#######################################
#  Main part of this script           #
#######################################
                 
# Choose between Steam and other Digital Download versions
# POL_SetupWindow_InstallMethod "STEAM,DVD,LOCAL,DOWNLOAD"
POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"

# POL_SetupWindow_message "Warning: do not install Punk Buster nor DirectX." "$TITLE"
# POL_SetupWindow_message "Warning: do not install DirectX (nor the icons)." "$TITLE"
# POL_SetupWindow_message "Warning: do not install Visual C++ 2013 redistribuable\n nor Direct X." "$TITLE"
# POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"

# POL_SetupWindow_message "$(eval_gettext 'Note: at the end of the first installer (it does installs the downloader program), do not click RUN, instead close the window, then you will run the game from POL/POM.')" "$TITLE"


# Begin game installation
if [ "$INSTALL_METHOD" == "STEAM" ]; then
        POL_Call POL_Install_steam
        # Mandatory pre-install fix for steam
        POL_Call POL_Install_steam_flags "$STEAM_ID"
        # Shortcut done before install for steam version
        POL_Shortcut "steam.exe" "$TITLE" "" "steam://rungameid/$STEAM_ID"
        # Steam install
        POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue')" "$TITLE"
        cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
        POL_Wine start /unix "steam.exe" steam://install/$STEAM_ID
        POL_Wine_WaitExit "$TITLE"
                      
elif [ "$INSTALL_METHOD" == "DVD" ]; then
        POL_SetupWindow_cdrom
                      
        # POL_Call POL_Function_NoCDWarning
               
        POL_SetupWindow_check_cdrom "setup.exe"
        POL_Wine start /unix "$CDROM/setup.exe"
                     
        POL_Wine_WaitExit "$TITLE"
                  
        # Restore screen resolution (game's default is 800x600 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                     
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"

elif [ "$INSTALL_METHOD" == "DOWNLOAD" ]; then
        cd "$WINEPREFIX/drive_c"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: this script will download the demo .')" "$TITLE"
        # POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20200911204035.exe"
        POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20201014173947.exe"
           
        mv GenshinImpact_install_20201014173947.exe GameInstaller.exe
        # mv X.rar gameinstaller.rar
        # mv X.zip gameinstaller.zip
           
        # POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        # POL_System_unrar x "gameinstaller.rar" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        # POL_System_unzip "gameinstaller.zip" -d "$WINEPREFIX/drive_c/game/"
             
        # Extract without sub-folder.
        # unzip "gameinstaller.zip" -j -d "$WINEPREFIX/drive_c/"
             
        # POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"
         
        cd  "$WINEPREFIX/drive_c/game/"
        POL_Wine "GameInstaller.exe" # "/SILENT"
        POL_Wine_WaitBefore "$TITLE"
     
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: do NOT install DirectX.')" "$TITLE"
  
        # cd "$WINEPREFIX/drive_c"
        # rm GameInstaller.exe
             
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        # Restore screen resolution (game's default is 1024x768)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
             
elif [ "$INSTALL_METHOD" == "LOCAL" ]; then
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.EXE')~$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.MSI')~$(eval_gettext '.EXE')" "~"
           
        APP_ANSWER=".EXE"
     
if [ "$APP_ANSWER" == ".EXE" ]; then
        # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the installation file (.EXE)')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
   
        # POL_SetupWindow_message "Note: please answer NO to all the questions that will appear." "$TITLE"
   
        POL_Wine start /unix "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                 
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"


elif [ "$APP_ANSWER" == "$(eval_gettext '.MSI')" ]; then
       # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        POL_Wine msiexec /i  "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                   
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
      
elif [ "$APP_ANSWER" == "$(eval_gettext '.ZIP')" ]; then
        cd "$HOME"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nWARNING: the file name must not have SPACES in its name !.')" "$TITLE"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .ZIP file')" "$TITLE"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unzip "$APP_ANSWER" -d "$WINEPREFIX/drive_c/game/"
           
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
           
elif [ "$APP_ANSWER" == "$(eval_gettext '.RAR')" ]; then
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .RAR file')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unrar x "$APP_ANSWER" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
            
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
fi
fi

################
# Patch update #
################
 
# POL_SetupWindow_menu "$(eval_gettext 'Do you have a official patch-update to install ?')" "$TITLE" "$(eval_gettext 'No')~$(eval_gettext 'Yes')" "~"      
             
if [ "$APP_ANSWER" == "$(eval_gettext 'Yes')" ]; then
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .EXE file to run')" "$TITLE"
        PATCH_EXE="$APP_ANSWER"
        POL_Wine start /unix "$PATCH_EXE"
        POL_Wine_WaitExit "$PATCH_EXE"
fi

#######################################
#  Hacks                              #
#  Editing configuration files        #
#######################################




POL_SetupWindow_message "$(eval_gettext 'Installation is finished.')" "$TITLE"

POL_SetupWindow_message "$(eval_gettext 'WARNING: to avoid to have a huge log file, you should type \ninto Debug flags: fixme-all')" "$TITLE"
             
# POL_System_TmpDelete
POL_SetupWindow_Close
exit 0

Replies

Dadu042 Sunday 25 October 2020 at 11:48
Dadu042
Moderator

Warning

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

Differences

@@ -7,7 +7,8 @@
 # Licence : Retail
 # Only For : http://www.playonlinux.com
 #
-# TESTED Editions: Launcher v2.3.3.0
+# TESTED Editions: Launcher v2.3.3.0 (GenshinImpact_install_20200911204035.exe)
+#                           v2.3.4.0 (GenshinImpact_install_20201014173947.exe)
 #
 # Middlewares used by this software : Unity 2017, vcrun2013, vcrun2015, QT5.
 #
@@ -15,6 +16,8 @@
 # CHANGELOG
 # [Dadu042] (2020-09-29 10-00). 
 #   Initial script. Game fail to run because of the anti cheat software (mhyprot2.sys), that want admin rights.
+# [Dadu042] (2020-10-25 10-00). 
+#   Update the file installer URL.
 #
 # KNOWN ISSUES :
 #
@@ -194,9 +197,10 @@
         cd "$WINEPREFIX/drive_c"
              
         # POL_SetupWindow_message "$(eval_gettext '\n\nNote: this script will download the demo .')" "$TITLE"
-        POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20200911204035.exe"
+        # POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20200911204035.exe"
+        POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20201014173947.exe"
            
-        mv GenshinImpact_install_20200911204035.exe GameInstaller.exe
+        mv GenshinImpact_install_20201014173947.exe GameInstaller.exe
         # mv X.rar gameinstaller.rar
         # mv X.zip gameinstaller.zip
            

New source code

#!/bin/bash
# Date : (2020-09-29)
# Last revision : see the changelog below
# Wine version used : see the changelog below
# Distribution used to test : XUbuntu 18.04 64 bits (Linux kernel v5.4.0). GPU: AMD Vega 11.
# Author : Dadu042
# Licence : Retail
# Only For : http://www.playonlinux.com
#
# TESTED Editions: Launcher v2.3.3.0 (GenshinImpact_install_20200911204035.exe)
#                           v2.3.4.0 (GenshinImpact_install_20201014173947.exe)
#
# Middlewares used by this software : Unity 2017, vcrun2013, vcrun2015, QT5.
#
#
# CHANGELOG
# [Dadu042] (2020-09-29 10-00). 
#   Initial script. Game fail to run because of the anti cheat software (mhyprot2.sys), that want admin rights.
# [Dadu042] (2020-10-25 10-00). 
#   Update the file installer URL.
#
# KNOWN ISSUES :
#
#  Anti-cheat issue:
#  - Wine amd64 4.21, 5.0.2, 5.11-staging, 5.16, 5.18-staging: when clicking 'Play' (yellow button) the window just does reduce in the task bar. Tried: set OS to Win7/8/10. Enable game auto update, wininet.
#    Download file from: http://www.dll-found.com/wdfldr.sys_download.html  copy to  /home/YourUserName/PlayOnLinux's virtual drives/Genshin_Impact/drive_c/users/theuser/Temp/   and into the game folder, copied also in uppercase.
#
#    Tried: copying wdfldr.sys (set as Native) and WDFLDR.SYS into '/drive_c/windows/system32/'.
#
#    Immediate Wine 5.0.2 debug log is:
#    0198:fixme:heap:RtlSetHeapInformation 0x570000 0 0x22db80 4 stub
#    0198:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0198:fixme:heap:RtlSetHeapInformation 0x790000 0 0x22f1b0 4 stub
#    019c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    01a2:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    01a2:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0199:fixme:ver:GetCurrentPackageId (0x99fb00 (nil)): stub
#
#
#    Wine 5.16:
#    0790:fixme:heap:RtlSetHeapInformation 0000000000890000 0 000000000021DFC0 4 stub
#    0790:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0790:fixme:heap:RtlSetHeapInformation 0000000000AB0000 0 000000000021F080 4 stub
#    079c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    07b8:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    07b8:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0794:fixme:ver:GetCurrentPackageId (0000000000CBFBA0 0000000000000000): stub
#
# KNOWN ISSUES (FIXED):
#  - Wine amd64 5.0.2: X

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="Genshin Impact"
PREFIX="Genshin_Impact"
EDITOR="miHoYo"
GAME_URL="https://en.wikipedia.org/wiki/Genshin_Impact"
AUTHOR="Dadu042"
STEAM_ID=""
GAME_VMS="512"
SHORTCUT_FILENAME="launcher.exe"
SOFTWARE_CATEGORIES="Game;RolePlaying;"
# http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_9:_Standardization#Advanced_Standardization
DOCUMENT_FILE=""


# Starting the script
POL_SetupWindow_Init
                         
# Starting debugging API
POL_Debug_Init
        
# Open dialogue box 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

POL_RequiredVersion "4.3.0" || POL_Debug_Fatal "$APPLICATION_TITLE $VERSION is required to install $TITLE"

# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"

############################################
#  Choose architecture: 32 bits or 64 bits #
############################################

# POL_SetupWindow_menu "$(eval_gettext 'What architecture do you want to use ?')" "$TITLE" "$(eval_gettext '64 bits (recommended)')~$(eval_gettext '32 bits')" "~"
 
# if [ "$APP_ANSWER" == "32 bits" ]; then
#        POL_System_SetArch "x86"
# elif [ "$APP_ANSWER" == "$(eval_gettext '64 bits (recommended)')" ]; then
#        POL_System_SetArch "amd64"
# fi

POL_System_SetArch "amd64"

# Download Wine if necessary then create prefix
POL_Wine_PrefixCreate "5.0.2"
# POL_Wine_PrefixCreate

# POL_System_TmpCreate "$PREFIX"
             
Set_OS "win7"

#######################################
#  Hacks                              #
#######################################




#######################################
#  Installing mandatory dependencies  #
#######################################


# POL_Call POL_Install_vcrun2013
# POL_Call POL_Install_d3dx11

# Disable DirectX 11
# POL_Wine_OverrideDLL "" "d3d11"


################
#      GPU     #
################

# Set Graphic Card information keys for wine
POL_Wine_SetVideoDriver

# Minimum memory size requiered for the graphic card.
POL_SetupWindow_VMS $GAME_VMS

# Asking about memory size of graphic card
# POL_SetupWindow_menu_list "How much memory does your graphics board have?" "$TITLE" "64-128-256-320-384-512-640-768-896-1024-1536-1792-2048-3072-4096" "-" "256"
# VRAM="$APP_ANSWER"
# POL_Wine_Direct3D "VideoMemorySize" "$VRAM"

# Useful for Nvidia GPUs
# POL_Call POL_Install_physx


#############################################
#  Sound problem fix - pulseaudio related   #
#############################################
# [ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
# [ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
## End Fix


#######################################
#  Main part of this script           #
#######################################
                 
# Choose between Steam and other Digital Download versions
# POL_SetupWindow_InstallMethod "STEAM,DVD,LOCAL,DOWNLOAD"
POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"

# POL_SetupWindow_message "Warning: do not install Punk Buster nor DirectX." "$TITLE"
# POL_SetupWindow_message "Warning: do not install DirectX (nor the icons)." "$TITLE"
# POL_SetupWindow_message "Warning: do not install Visual C++ 2013 redistribuable\n nor Direct X." "$TITLE"
# POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"

# POL_SetupWindow_message "$(eval_gettext 'Note: at the end of the first installer (it does installs the downloader program), do not click RUN, instead close the window, then you will run the game from POL/POM.')" "$TITLE"


# Begin game installation
if [ "$INSTALL_METHOD" == "STEAM" ]; then
        POL_Call POL_Install_steam
        # Mandatory pre-install fix for steam
        POL_Call POL_Install_steam_flags "$STEAM_ID"
        # Shortcut done before install for steam version
        POL_Shortcut "steam.exe" "$TITLE" "" "steam://rungameid/$STEAM_ID"
        # Steam install
        POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue')" "$TITLE"
        cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
        POL_Wine start /unix "steam.exe" steam://install/$STEAM_ID
        POL_Wine_WaitExit "$TITLE"
                      
elif [ "$INSTALL_METHOD" == "DVD" ]; then
        POL_SetupWindow_cdrom
                      
        # POL_Call POL_Function_NoCDWarning
               
        POL_SetupWindow_check_cdrom "setup.exe"
        POL_Wine start /unix "$CDROM/setup.exe"
                     
        POL_Wine_WaitExit "$TITLE"
                  
        # Restore screen resolution (game's default is 800x600 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                     
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"

elif [ "$INSTALL_METHOD" == "DOWNLOAD" ]; then
        cd "$WINEPREFIX/drive_c"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: this script will download the demo .')" "$TITLE"
        # POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20200911204035.exe"
        POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20201014173947.exe"
           
        mv GenshinImpact_install_20201014173947.exe GameInstaller.exe
        # mv X.rar gameinstaller.rar
        # mv X.zip gameinstaller.zip
           
        # POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        # POL_System_unrar x "gameinstaller.rar" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        # POL_System_unzip "gameinstaller.zip" -d "$WINEPREFIX/drive_c/game/"
             
        # Extract without sub-folder.
        # unzip "gameinstaller.zip" -j -d "$WINEPREFIX/drive_c/"
             
        # POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"
         
        cd  "$WINEPREFIX/drive_c/game/"
        POL_Wine "GameInstaller.exe" # "/SILENT"
        POL_Wine_WaitBefore "$TITLE"
     
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: do NOT install DirectX.')" "$TITLE"
  
        # cd "$WINEPREFIX/drive_c"
        # rm GameInstaller.exe
             
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        # Restore screen resolution (game's default is 1024x768)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
             
elif [ "$INSTALL_METHOD" == "LOCAL" ]; then
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.EXE')~$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.MSI')~$(eval_gettext '.EXE')" "~"
           
        APP_ANSWER=".EXE"
     
if [ "$APP_ANSWER" == ".EXE" ]; then
        # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the installation file (.EXE)')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
   
        # POL_SetupWindow_message "Note: please answer NO to all the questions that will appear." "$TITLE"
   
        POL_Wine start /unix "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                 
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"


elif [ "$APP_ANSWER" == "$(eval_gettext '.MSI')" ]; then
       # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        POL_Wine msiexec /i  "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                   
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
      
elif [ "$APP_ANSWER" == "$(eval_gettext '.ZIP')" ]; then
        cd "$HOME"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nWARNING: the file name must not have SPACES in its name !.')" "$TITLE"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .ZIP file')" "$TITLE"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unzip "$APP_ANSWER" -d "$WINEPREFIX/drive_c/game/"
           
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
           
elif [ "$APP_ANSWER" == "$(eval_gettext '.RAR')" ]; then
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .RAR file')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unrar x "$APP_ANSWER" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
            
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
fi
fi

################
# Patch update #
################
 
# POL_SetupWindow_menu "$(eval_gettext 'Do you have a official patch-update to install ?')" "$TITLE" "$(eval_gettext 'No')~$(eval_gettext 'Yes')" "~"      
             
if [ "$APP_ANSWER" == "$(eval_gettext 'Yes')" ]; then
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .EXE file to run')" "$TITLE"
        PATCH_EXE="$APP_ANSWER"
        POL_Wine start /unix "$PATCH_EXE"
        POL_Wine_WaitExit "$PATCH_EXE"
fi

#######################################
#  Hacks                              #
#  Editing configuration files        #
#######################################




POL_SetupWindow_message "$(eval_gettext 'Installation is finished.')" "$TITLE"

# POL_SetupWindow_message "$(eval_gettext 'WARNING: to avoid to have a huge log file, you should type \ninto Debug flags : fixme-all')" "$TITLE"
             
# POL_System_TmpDelete
POL_SetupWindow_Close
exit 0

Replies

Krock Saturday 10 October 2020 at 19:37
Krock Anonymous

Message

OUTDATED, FOR VERSION 1.0.1 CHECK TIMBUNTU'S ANSWER BELOW
 
This is a guide to patch *.sys service/driver registrations which are not and will not be supported by Wine. You will need to modify "UnityPlayer.dll" in order to get the game to launch at all.
 
Used components:
  • Ghidra decompiler
  • Game version 1.0.0
  • UnityPlayer.dll, date: 2020-08-28, sha1: f63edd1b76ca6c9a4f409fcb7c62b58561ee7fae
 
Patch 1
Replace function starts (PUSH) with RET
@ offset 0x0124c420, address 18148ce20 ("mhyprotect")
< 40 55 53 56 41 57 48 8d ac 24
> c3 c3 53 56 41 57 48 8d ac 24
@ offset 0x0148bdd0, address 18148c7d0 ("mhyprot2")
< 40 55 53 56 57 41 54 41 56 41
> c3 c3 53 56 57 41 54 41 56 41
 
 
This results in the game running smoothly for 15 to 20 seconds until:
wine: Unhandled page fault on read access to 000000000000003C at address 0000000181CA196A (thread 00e0), starting debugger...
This is likely due to the skipped code, but cannot confirm this.
 
Proof, Wine 5.15: https://i.postimg.cc/qqWyNL03/grafik.png

Replies

Sunday 11 October 2020 at 11:00
This is the right place, thanks for your hack.
Anonymous
Sunday 11 October 2020 at 19:33
Step 2 (OUTDATED, SEE TIMBUNTU'S ANSWER BELOW): Fix following access violation (segfault):

wine: Unhandled page fault on read access to 000000000000003C at address 0000000181CA196A (thread 00e0), starting debugger...

I do neither know what this function does nor where it is used (no references found), but this crash is caused by dereferencing an invalid pointer.

 

Replace MOV with XOR and NOP (last 3 bytes)

@ modification (0x31) at offset 0x1BD5D6A, address 181ca196a (unknown function)
< e9 6c 2f f2 ff 4c 8b 1f 66 41 0b c1 41 8B 1B
> e9 6c 2f f2 ff 4c 8b 1f 66 41 0b c1 31 db 90

You now can register and download the "Presistent" content. After that, it will freeze the game at 19.74% while loading the game data. Remove the "Persistent" directory from the game to unfreeze. Yet no solution found for this.

UPD: I cannot check whether these changes work flawlessly on Windows - test results are greatly appreciated to figure out the source of this problem!
Anonymous
Tuesday 20 October 2020 at 21:17
Small update:
You might not experience any freeze on your system or when using an older Wine version. Howeverif you do - try the command line argument "-nolog" which seems to avoid some sort of race condition.

On success you will end up with the error code 31-4302 which seems to be caused by a failing server-client verification. I'll dig into this using Wireshark when I have some more free time.
Wednesday 21 October 2020 at 14:51
I tested it on Windows an it shows the same error code 31-4302. I also tested it on Linux Mint, same result.
Anonymous
Friday 23 October 2020 at 11:38
I seem to have gotten it to work with game version 1.0.1, wine-tkg 5.19.r1.gb49e8743-300 (https://github.com/Frogging-Family/wine-tkg-git), and the following patches to the UnityPlayer.dll:
Offset               Old                    New
0148BDD0       40                     C3
0148C420        40 55                C3 F5
01B30933        8B 28                31 ED
I only played for about 15 minutes so far, but during that time it ran without any problems.
Update: Played for about 2 hours and still no problems, looks good!
Anonymous
Friday 23 October 2020 at 21:39
@timbuntu You absolute mad lad We did it!

Version 1.0.1 is working here on plain Wine 5.19. Let's hope it'll stay like that.

By the way, what's near 01B30934? How did you get to this address? I'm very curious.
Saturday 24 October 2020 at 0:56
Can someone make a 'sed' command line in order to automate the changes ?, so I will add it in the script.
Anonymous
Saturday 24 October 2020 at 1:38
Archlinux - linux-zen-vfio - nvidia-dkms - Wine 5.19

I was able to make the first set of changes from @Krock and the last set from @timbuntu, the game launches and plays, but ZFGameBrowser.exe encounters an error once the game loads, the mouse and keyboard stop working after the window loses focus, and the ground is invisible, I was unable to find the second set of changes, it's not quite clear which are still needed for v1.0.1.
Anonymous
Saturday 24 October 2020 at 3:17
I did the Changes from timbuntu, the game launches, with wine 5.19 got the error ZFGameBrowser.exe fixed switing to wine 5.19-stagging, in order the mouse and keyboard font loses focus in winecfg -> graphics -> capture mouse on full screen fixed, but the gound is invislbe, its like not loading the resources of the ground? hhahaha i dont know :D i want to play so bad this game :), any news or how to fix this?
Anonymous
Saturday 24 October 2020 at 3:33
Thank you for those fixes, that fixed ZFGameBrowser and enabling virtual windows fixed the mouse/keyboard.

It seems the ground issue I was talking about might be shaders not texture https://i.imgur.com/QOd7mmG.png
Anonymous
Saturday 24 October 2020 at 3:51
i can provide how is looking in my pc https://www.darkzaion.com/genshin.jpg and the https://www.darkzaion.com/UnityPlayer.dll im using following @timbuntu changes, hope some one can figure it out how to solve this :D, thank you <3
Anonymous
Saturday 24 October 2020 at 4:01
@Krock Yeess, we did! And that offset was where I was getting the Unhandled page fault with game version 1.0.1, iirc there was a "MOV EBP,dword ptr [RAX]" that I replaced with an "XOR EBP,EBP". What did you XOR when replacing the MOV in game version 1.0.0?
Anonymous
Saturday 24 October 2020 at 4:08
@Dadu042 I fear it probably can't be done with sed, I could provide a bsdiff patch file, but then the systems need to have bspatch installed to apply it. I sadly don't really know a more portable way right now. An ugly way I could imagine would maybe be with dd, but if someone has a better idea that would be great.
Anonymous
Saturday 24 October 2020 at 4:14
@ShayBox Don't apply both sets of changes, only apply the changes from my comment. The changes from Krock were for version 1.0.0
Anonymous
Saturday 24 October 2020 at 4:19
@timbuntu I reapplied your changes from a fresh file, the world is still missing textures
Anonymous
Saturday 24 October 2020 at 4:20
@ShayBox @DarkZaioN Sadly I don't really know how to fix that since the problem didn't occur for me. I'm using dxvk, are you using a clean wine prefix, did you install anything directx related, are you also using dxvk? Maybe it has something to do with that.
Anonymous
Saturday 24 October 2020 at 4:21
I'm using the playonlinux beta script as the base.

I switched to the lutris script and enabled dxvk, esync, and fsync, and it fixed the problem!
Anonymous
Saturday 24 October 2020 at 4:44
Nice! That's great to hear!
Anonymous
Saturday 24 October 2020 at 10:56
@timbuntu So we did exactly the same, just on different versions. Interesting that the Access Violation error occurred in another location after the 1.0.1 update. I replaced "MOV EBX,dword ptr [R11]" with "XOR EBX,EBX", plus a NOP to fill the 1 byte gap.
Anonymous
Saturday 24 October 2020 at 12:10
Then we really did exactly the same! With the only difference being the game version, I really hope that it will still work with the next versions then.
Anonymous
Saturday 24 October 2020 at 13:38
Ok, so! I redid everything starting from the current playonlinux script:

 

1. Install the game with the current playonlinux script.

2. Change the wine version to 5.19-staging. (Plain 5.19 didn't work for me)

3. Install dxvk

4. Start the game/launcher and let it download the game files.

5. Go to the downloaded game files at "~/PlayOnLinux\'s\ virtual\ drives/Genshin_Impact/drive_c/Program Files/Genshin Impact/Genshin Impact Game"  and execute the following script to patch the UnityPlayer.dll:

#! /bin/bash

dd if=<(echo -ne "\xc3") of=UnityPlayer.dll bs=1 seek=$((0x0148BDD0)) conv=notrunc
dd if=<(echo -ne "\xc3\xf5") of=UnityPlayer.dll bs=1 seek=$((0x0148C420)) conv=notrunc
dd if=<(echo -ne "\x31\xed") of=UnityPlayer.dll bs=1 seek=$((0x01B30933)) conv=notrunc

6. Run the game/launcher again, hit Launch, and it should work!
Anonymous
Saturday 24 October 2020 at 22:24
I played for 8 hours yesterday, no issues, still working today, thanks for getting the game to work guys.
Anonymous
Sunday 25 October 2020 at 0:37
well, i have trouble to install dxkv on opensuse, after hours trying the game dont start after dxkv instalation fuckkk.... need som help :(
Anonymous
Sunday 25 October 2020 at 1:39
Do you have the vulkan drivers installed on your system? For dxvk to work you have to have them installed, so if it doesn't start anymore after dxvk installation but did so before, then maybe that might be the problem?
Anonymous
Sunday 25 October 2020 at 10:45
I have installed the game with lutris, it's working as a charm. Many thanks guys, you have done an amazing job!
Sunday 25 October 2020 at 12:22
I made a patch (to use after the game) that does automate the job. https://www.playonlinux.com/en/app-4251.html
Anonymous
Sunday 25 October 2020 at 15:00
Nice, thank you!
Anonymous
Sunday 25 October 2020 at 18:22
keyboard is not working
Anonymous
Sunday 25 October 2020 at 19:11
Maybe try what DarkZaioN wrote above: In playonlinux click on Genshin Impact, click configure, go to the "Wine" tab, click "Configure Wine", go to the "Graphics" tab, and check "Automatically capture the mouse in full-screen windows"
Sunday 25 October 2020 at 20:25
Keyboard is OK on Linux, until doing a ALT+TAB (this freeze the game screen).
Anonymous
Sunday 25 October 2020 at 22:24
it is not working but i'm using wine lutris 5.7-11 and looks like it's working now, but still poor performance. i will try playonlinux
Anonymous
Wednesday 28 October 2020 at 14:37
After playing for days with no issues, I have stated getting error 31-4302 when trying to launch the game.
Anonymous
Wednesday 28 October 2020 at 15:13
offset code that is already here, seems to be spread quickly to various forums. so that the unityplayer.dll offset of @timbuntu is already patched now
Anonymous
Wednesday 28 October 2020 at 16:01
I don't think a patch has been released though. And the game does start. Maybe I have just been banned or a check has been put in place?
Anonymous
Wednesday 28 October 2020 at 16:28
Yeah, there was no patch, the UnityPlayer.dll is still unchanged, the only thing that I think changed is the "Persistent Content" that gets downloaded when the game starts.
Didn't really look into it yet though, so I'm not sure. The only thing I can say is that the UnityPlayer.dll didn't get patched.
Anonymous
Wednesday 28 October 2020 at 16:40
after re-installing/re-patching game changing wine version doesn't help too
Anonymous
Wednesday 28 October 2020 at 17:55
Seems like even some windows users are getting the issue since today. That gives me some hope
Anonymous
Wednesday 28 October 2020 at 17:55
To fix ALT+TAB: open wine registry and put in HKEY_CURRENT_USER\Software\Wine\X11 Driver

UseTakeFocus REG_SZ with value N

After that even Virtual Desktop mode is not needed. But you can't run it until 31-4302 error.
Anonymous
Wednesday 28 October 2020 at 18:17
So that's the files that changed since it was working as far as I can see:
https://pastebin.com/b702AHyr

Edited by Krock

littlelycan Monday 5 October 2020 at 17:13
littlelycan Anonymous

Message

can anyone please comment on this to confirm if this script works. Please specify which distro your using. Mint user here and wanted to make sure first if it works rather than wasting my time. Thank you in advance.

Replies

Tuesday 6 October 2020 at 15:32
The script does no work because of the anti-cheat, this is in the description of the script at the top of the page.
Dadu042 Thursday 1 October 2020 at 17:27
Dadu042
Moderator

Warning

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

Differences

@@ -14,18 +14,22 @@
 #
 # CHANGELOG
 # [Dadu042] (2020-09-29 10-00). 
-#   Initial script.
+#   Initial script. Game fail to run because of the anti cheat software (mhyprot2.sys), that want admin rights.
 #
 # KNOWN ISSUES :
-#  - Wine amd64 4.21, 5.0.2, 5.11-staging, 5.16: when clicking 'Play' (yellow button) the window just does reduce in the task bar. Tried: set OS to Win7/8/10. Enable game auto update.
-#    Download file from: http://www.dll-found.com/wdfldr.sys_download.html  copy to  /home/YourUserName/PlayOnLinux's virtual drives/Genshin_Impact/drive_c/users/walter/Temp/   and into the game folder, copied also in uppercase.
+#
+#  Anti-cheat issue:
+#  - Wine amd64 4.21, 5.0.2, 5.11-staging, 5.16, 5.18-staging: when clicking 'Play' (yellow button) the window just does reduce in the task bar. Tried: set OS to Win7/8/10. Enable game auto update, wininet.
+#    Download file from: http://www.dll-found.com/wdfldr.sys_download.html  copy to  /home/YourUserName/PlayOnLinux's virtual drives/Genshin_Impact/drive_c/users/theuser/Temp/   and into the game folder, copied also in uppercase.
+#
+#    Tried: copying wdfldr.sys (set as Native) and WDFLDR.SYS into '/drive_c/windows/system32/'.
 #
 #    Immediate Wine 5.0.2 debug log is:
 #    0198:fixme:heap:RtlSetHeapInformation 0x570000 0 0x22db80 4 stub
 #    0198:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
 #    0198:fixme:heap:RtlSetHeapInformation 0x790000 0 0x22f1b0 4 stub
 #    019c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
-#    01a2:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\walter\\Temp\\mhyprot2.sys") not found
+#    01a2:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
 #    01a2:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
 #    0199:fixme:ver:GetCurrentPackageId (0x99fb00 (nil)): stub
 #
@@ -35,7 +39,7 @@
 #    0790:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
 #    0790:fixme:heap:RtlSetHeapInformation 0000000000AB0000 0 000000000021F080 4 stub
 #    079c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
-#    07b8:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\walter\\Temp\\mhyprot2.sys") not found
+#    07b8:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
 #    07b8:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
 #    0794:fixme:ver:GetCurrentPackageId (0000000000CBFBA0 0000000000000000): stub
 #

New source code

#!/bin/bash
# Date : (2020-09-29)
# Last revision : see the changelog below
# Wine version used : see the changelog below
# Distribution used to test : XUbuntu 18.04 64 bits (Linux kernel v5.4.0). GPU: AMD Vega 11.
# Author : Dadu042
# Licence : Retail
# Only For : http://www.playonlinux.com
#
# TESTED Editions: Launcher v2.3.3.0
#
# Middlewares used by this software : Unity 2017, vcrun2013, vcrun2015, QT5.
#
#
# CHANGELOG
# [Dadu042] (2020-09-29 10-00). 
#   Initial script. Game fail to run because of the anti cheat software (mhyprot2.sys), that want admin rights.
#
# KNOWN ISSUES :
#
#  Anti-cheat issue:
#  - Wine amd64 4.21, 5.0.2, 5.11-staging, 5.16, 5.18-staging: when clicking 'Play' (yellow button) the window just does reduce in the task bar. Tried: set OS to Win7/8/10. Enable game auto update, wininet.
#    Download file from: http://www.dll-found.com/wdfldr.sys_download.html  copy to  /home/YourUserName/PlayOnLinux's virtual drives/Genshin_Impact/drive_c/users/theuser/Temp/   and into the game folder, copied also in uppercase.
#
#    Tried: copying wdfldr.sys (set as Native) and WDFLDR.SYS into '/drive_c/windows/system32/'.
#
#    Immediate Wine 5.0.2 debug log is:
#    0198:fixme:heap:RtlSetHeapInformation 0x570000 0 0x22db80 4 stub
#    0198:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0198:fixme:heap:RtlSetHeapInformation 0x790000 0 0x22f1b0 4 stub
#    019c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    01a2:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    01a2:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0199:fixme:ver:GetCurrentPackageId (0x99fb00 (nil)): stub
#
#
#    Wine 5.16:
#    0790:fixme:heap:RtlSetHeapInformation 0000000000890000 0 000000000021DFC0 4 stub
#    0790:fixme:heap:EnumSystemFirmwareTables (0x4649524d, 0000000000000000, 0)
#    0790:fixme:heap:RtlSetHeapInformation 0000000000AB0000 0 000000000021F080 4 stub
#    079c:err:service:validate_context_handle Access denied - handle created with access 34, needed 10000
#    07b8:err:module:import_dll Library WDFLDR.SYS (which is needed by L"C:\\users\\theuser\\Temp\\mhyprot2.sys") not found
#    07b8:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\mhyprot2": c0000142
#    0794:fixme:ver:GetCurrentPackageId (0000000000CBFBA0 0000000000000000): stub
#
# KNOWN ISSUES (FIXED):
#  - Wine amd64 5.0.2: X

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="Genshin Impact"
PREFIX="Genshin_Impact"
EDITOR="miHoYo"
GAME_URL="https://en.wikipedia.org/wiki/Genshin_Impact"
AUTHOR="Dadu042"
STEAM_ID=""
GAME_VMS="512"
SHORTCUT_FILENAME="launcher.exe"
SOFTWARE_CATEGORIES="Game;RolePlaying;"
# http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_9:_Standardization#Advanced_Standardization
DOCUMENT_FILE=""


# Starting the script
POL_SetupWindow_Init
                         
# Starting debugging API
POL_Debug_Init
        
# Open dialogue box 
POL_SetupWindow_presentation "$TITLE" "$EDITOR" "$GAME_URL" "$AUTHOR" "$PREFIX"

POL_RequiredVersion "4.3.0" || POL_Debug_Fatal "$APPLICATION_TITLE $VERSION is required to install $TITLE"

# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"

############################################
#  Choose architecture: 32 bits or 64 bits #
############################################

# POL_SetupWindow_menu "$(eval_gettext 'What architecture do you want to use ?')" "$TITLE" "$(eval_gettext '64 bits (recommended)')~$(eval_gettext '32 bits')" "~"
 
# if [ "$APP_ANSWER" == "32 bits" ]; then
#        POL_System_SetArch "x86"
# elif [ "$APP_ANSWER" == "$(eval_gettext '64 bits (recommended)')" ]; then
#        POL_System_SetArch "amd64"
# fi

POL_System_SetArch "amd64"

# Download Wine if necessary then create prefix
POL_Wine_PrefixCreate "5.0.2"
# POL_Wine_PrefixCreate

# POL_System_TmpCreate "$PREFIX"
             
Set_OS "win7"

#######################################
#  Hacks                              #
#######################################




#######################################
#  Installing mandatory dependencies  #
#######################################


# POL_Call POL_Install_vcrun2013
# POL_Call POL_Install_d3dx11

# Disable DirectX 11
# POL_Wine_OverrideDLL "" "d3d11"


################
#      GPU     #
################

# Set Graphic Card information keys for wine
POL_Wine_SetVideoDriver

# Minimum memory size requiered for the graphic card.
POL_SetupWindow_VMS $GAME_VMS

# Asking about memory size of graphic card
# POL_SetupWindow_menu_list "How much memory does your graphics board have?" "$TITLE" "64-128-256-320-384-512-640-768-896-1024-1536-1792-2048-3072-4096" "-" "256"
# VRAM="$APP_ANSWER"
# POL_Wine_Direct3D "VideoMemorySize" "$VRAM"

# Useful for Nvidia GPUs
# POL_Call POL_Install_physx


#############################################
#  Sound problem fix - pulseaudio related   #
#############################################
# [ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
# [ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
## End Fix


#######################################
#  Main part of this script           #
#######################################
                 
# Choose between Steam and other Digital Download versions
# POL_SetupWindow_InstallMethod "STEAM,DVD,LOCAL,DOWNLOAD"
POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"

# POL_SetupWindow_message "Warning: do not install Punk Buster nor DirectX." "$TITLE"
# POL_SetupWindow_message "Warning: do not install DirectX (nor the icons)." "$TITLE"
# POL_SetupWindow_message "Warning: do not install Visual C++ 2013 redistribuable\n nor Direct X." "$TITLE"
# POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"

# POL_SetupWindow_message "$(eval_gettext 'Note: at the end of the first installer (it does installs the downloader program), do not click RUN, instead close the window, then you will run the game from POL/POM.')" "$TITLE"


# Begin game installation
if [ "$INSTALL_METHOD" == "STEAM" ]; then
        POL_Call POL_Install_steam
        # Mandatory pre-install fix for steam
        POL_Call POL_Install_steam_flags "$STEAM_ID"
        # Shortcut done before install for steam version
        POL_Shortcut "steam.exe" "$TITLE" "" "steam://rungameid/$STEAM_ID"
        # Steam install
        POL_SetupWindow_message "$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue')" "$TITLE"
        cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
        POL_Wine start /unix "steam.exe" steam://install/$STEAM_ID
        POL_Wine_WaitExit "$TITLE"
                      
elif [ "$INSTALL_METHOD" == "DVD" ]; then
        POL_SetupWindow_cdrom
                      
        # POL_Call POL_Function_NoCDWarning
               
        POL_SetupWindow_check_cdrom "setup.exe"
        POL_Wine start /unix "$CDROM/setup.exe"
                     
        POL_Wine_WaitExit "$TITLE"
                  
        # Restore screen resolution (game's default is 800x600 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                     
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"

elif [ "$INSTALL_METHOD" == "DOWNLOAD" ]; then
        cd "$WINEPREFIX/drive_c"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: this script will download the demo .')" "$TITLE"
        POL_Download "https://genshinimpact.mihoyo.com/client_app/launcher/GenshinImpact_install_20200911204035.exe"
           
        mv GenshinImpact_install_20200911204035.exe GameInstaller.exe
        # mv X.rar gameinstaller.rar
        # mv X.zip gameinstaller.zip
           
        # POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        # POL_System_unrar x "gameinstaller.rar" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        # POL_System_unzip "gameinstaller.zip" -d "$WINEPREFIX/drive_c/game/"
             
        # Extract without sub-folder.
        # unzip "gameinstaller.zip" -j -d "$WINEPREFIX/drive_c/"
             
        # POL_SetupWindow_message "$(eval_gettext 'Note: we recommend you to uncheck all the checkboxes:\n[x] -> [ ]')" "$TITLE"
         
        cd  "$WINEPREFIX/drive_c/game/"
        POL_Wine "GameInstaller.exe" # "/SILENT"
        POL_Wine_WaitBefore "$TITLE"
     
        # POL_SetupWindow_message "$(eval_gettext '\n\nNote: do NOT install DirectX.')" "$TITLE"
  
        # cd "$WINEPREFIX/drive_c"
        # rm GameInstaller.exe
             
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        # Restore screen resolution (game's default is 1024x768)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
             
elif [ "$INSTALL_METHOD" == "LOCAL" ]; then
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.EXE')~$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.ZIP')~$(eval_gettext '.RAR')" "~"
        # POL_SetupWindow_menu "$(eval_gettext 'What is the type of the file?.')" "$TITLE" "$(eval_gettext '.MSI')~$(eval_gettext '.EXE')" "~"
           
        APP_ANSWER=".EXE"
     
if [ "$APP_ANSWER" == ".EXE" ]; then
        # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the installation file (.EXE)')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
   
        # POL_SetupWindow_message "Note: please answer NO to all the questions that will appear." "$TITLE"
   
        POL_Wine start /unix "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                 
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
  
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"


elif [ "$APP_ANSWER" == "$(eval_gettext '.MSI')" ]; then
       # Asking then installing local files of the game
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        POL_Wine msiexec /i  "$SETUP_EXE"
        POL_Wine_WaitExit "$TITLE"
                   
        # Restore screen resolution (game's default is 640x480 ?)
        # POL_Shortcut_InsertBeforeWine "$SHORTCUT" "trap 'xrandr -s 0' EXIT"
                   
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
        POL_Shortcut_QuietDebug "$TITLE"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
      
elif [ "$APP_ANSWER" == "$(eval_gettext '.ZIP')" ]; then
        cd "$HOME"
             
        # POL_SetupWindow_message "$(eval_gettext '\n\nWARNING: the file name must not have SPACES in its name !.')" "$TITLE"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .ZIP file')" "$TITLE"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unzip "$APP_ANSWER" -d "$WINEPREFIX/drive_c/game/"
           
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
             
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
           
elif [ "$APP_ANSWER" == "$(eval_gettext '.RAR')" ]; then
        cd "$HOME"
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .RAR file')" "$TITLE"
        SETUP_EXE="$APP_ANSWER"
        cd "$POL_System_TmpDir"
        POL_SetupWindow_wait_next_signal "$(eval_gettext 'Extracting the archive...')" "$TITLE"
        POL_System_unrar x "$APP_ANSWER" "$WINEPREFIX/drive_c/game/" || POL_Debug_Fatal "unrar is required to unarchive $TITLE (unrar package is not installed on the OS)."
        POL_Shortcut "$SHORTCUT_FILENAME" "$TITLE" "" "" "$SOFTWARE_CATEGORIES"
            
        POL_Shortcut_Document "$TITLE" "$DOCUMENT_FILE"
fi
fi

################
# Patch update #
################
 
# POL_SetupWindow_menu "$(eval_gettext 'Do you have a official patch-update to install ?')" "$TITLE" "$(eval_gettext 'No')~$(eval_gettext 'Yes')" "~"      
             
if [ "$APP_ANSWER" == "$(eval_gettext 'Yes')" ]; then
        POL_SetupWindow_browse "$(eval_gettext 'Please select the .EXE file to run')" "$TITLE"
        PATCH_EXE="$APP_ANSWER"
        POL_Wine start /unix "$PATCH_EXE"
        POL_Wine_WaitExit "$PATCH_EXE"
fi

#######################################
#  Hacks                              #
#  Editing configuration files        #
#######################################




POL_SetupWindow_message "$(eval_gettext 'Installation is finished.')" "$TITLE"

# POL_SetupWindow_message "$(eval_gettext 'WARNING: to avoid to have a huge log file, you should type \ninto Debug flags : fixme-all')" "$TITLE"
             
# POL_System_TmpDelete
POL_SetupWindow_Close
exit 0

Replies

Anonymous
Saturday 3 October 2020 at 23:05
Hello, i'm new in this platform. How do you use the button "Try this update" in PlayOnLinux. I use this in Ubuntu version.
Anonymous
Monday 12 October 2020 at 10:44
Can anyone explain to me how can I use this new script? I already have the game installed via PoL.
Anonymous
Monday 12 October 2020 at 22:10
Guys - This script does not do anything. It's a stub because Genshin Impact does currently not run on Linux (unless modified).