Farmville v2 Launcher on Linux/Wine

Questions about Wine on Linux
Locked
släcki
Level 2
Level 2
Posts: 12
Joined: Wed Oct 19, 2022 8:29 am

Farmville v2 Launcher on Linux/Wine

Post by släcki »

Hi, a friend of mine was looking for a Laptop. I had one, and thought it's a good idea to show him how great Linux is. All works, except... Farmville. His wife plays farmville and has thousands of hours on it, so unfortunately this is a must have.
I tried to get it running (Linux Mint 21 LTS), no chance. I also tried it on Fedora 37, also no luck.
So i am wondering if there is anybody that got it working.

Farmville is a flash based game that is abandoned (more or less) from the devs. They once said they might go with html5 etc. - but this is more or less dead. As it uses flash, they created a windows launcher that contains a kind of portable flash and all the files required to run it.

The launcher is available here: https://zyngablog.typepad.com/farmville ... -know.html
After running it, it created /home/oli/.wine/drive_c/Program Files/Farm2Desktop. The attachment contains the content of the folder.
When i try to run the Farm2Launch.exe, i get:

Code: Select all

[oli@DESKTOP-E83VF5L Farm2Desktop]$ wine ./Farm2Launch.exe 
002c:fixme:winediag:LdrInitializeThunk wine-staging 7.12 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
00bc:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (00000000025CD490 1 C) semi-stub
0168:fixme:sync:SetWaitableTimerEx (00000000000001FC, 00000000043DFBD0, 0, 0000000000000000, 0000000000000000, 0000000000000000, 500) semi-stub
0120:fixme:nls:get_dummy_preferred_ui_language (0x8 000000000011B924 0000000000000000 000000000011B920) returning a dummy value (current locale)
0120:fixme:nls:get_dummy_preferred_ui_language (0x8 000000000011B924 00000000003BD960 000000000011B920) returning a dummy value (current locale)
0120:fixme:secur32:LsaGetLogonSessionData 000000000011C348 000000000011C338 stub
0120:fixme:pulse:AudioSessionControl_RegisterAudioSessionNotification (00000000003FB060)->(00000000003352D0) - stub
0120:fixme:pulse:AudioSessionControl_UnregisterAudioSessionNotification (00000000003FB060)->(00000000003352D0) - stub
0120:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
then nothing happens. When i run the Farmville Two.exe, it returns this and then again nothing more:

Code: Select all

[oli@DESKTOP-E83VF5L Farm2Desktop]$ wine "Farmville Two.exe" 
002c:fixme:winediag:LdrInitializeThunk wine-staging 7.12 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
00cc:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (00000000025CD490 1 C) semi-stub
0160:fixme:sync:SetWaitableTimerEx (00000000000001FC, 00000000043DFBD0, 0, 0000000000000000, 0000000000000000, 0000000000000000, 500) semi-stub
0118:fixme:nls:get_dummy_preferred_ui_language (0x8 000000000011B924 0000000000000000 000000000011B920) returning a dummy value (current locale)
0118:fixme:nls:get_dummy_preferred_ui_language (0x8 000000000011B924 0000000000369BB0 000000000011B920) returning a dummy value (current locale)
0118:fixme:secur32:LsaGetLogonSessionData 000000000011C348 000000000011C338 stub
0118:fixme:pulse:AudioSessionControl_RegisterAudioSessionNotification (000000000037ABC0)->(000000000031D570) - stub
0118:fixme:pulse:AudioSessionControl_UnregisterAudioSessionNotification (000000000037ABC0)->(000000000031D570) - stub
0118:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
Any help is very appreciated :)
Attachments
Bildschirmfoto_2022-10-22_13-48-33.png
qwertymnb
Level 5
Level 5
Posts: 273
Joined: Sun Jan 17, 2016 4:36 pm

Re: Farmville v2 Launcher on Linux/Wine

Post by qwertymnb »

Hi,

I gave it a try. i can see from a log that it tries to open a file
C:\\Program Files\\Farm2Desktop\\META-INF\\AIR\\publisherid
which is not present.
If i do 'touch publisherid' in that directory it throws out a few more fixme`s and it shows up running in a 'ps -ux' but no window appears (???)

Maybe have a look what this file (publisherid) looks like on windows? Or copy it over. Or maybe manually installing flash with winetricks might change anything?
släcki
Level 2
Level 2
Posts: 12
Joined: Wed Oct 19, 2022 8:29 am

Re: Farmville v2 Launcher on Linux/Wine

Post by släcki »

Thanks for that! I will try to get this file!

edit: i copied the whole folder from the windows installation of the friend. i can provide now any file that is required. i am just a bit afraid that it might contain sensitive information.
there is no such file:

[oli@DESKTOP-E83VF5L ~]$ cd /home/oli/Downloads/Farm2Desktop/META-INF/AIR/
[oli@DESKTOP-E83VF5L AIR]$ find .
.
./hash
./extensions
./extensions/com.zynga.farm2.utilsANE
./extensions/com.zynga.farm2.utilsANE/library.swf
./extensions/com.zynga.farm2.utilsANE/META-INF
./extensions/com.zynga.farm2.utilsANE/META-INF/ANE
./extensions/com.zynga.farm2.utilsANE/META-INF/ANE/Windows-x86-64
./extensions/com.zynga.farm2.utilsANE/META-INF/ANE/Windows-x86-64/library.swf
./extensions/com.zynga.farm2.utilsANE/META-INF/ANE/Windows-x86-64/UtilsAne64.dll
./extensions/com.zynga.farm2.utilsANE/META-INF/ANE/extension.xml
./extensions/com.zynga.farm2.utilsANE/catalog.xml
./extensions/com.zynga.farm2.desktopANE
./extensions/com.zynga.farm2.desktopANE/library.swf
./extensions/com.zynga.farm2.desktopANE/META-INF
./extensions/com.zynga.farm2.desktopANE/META-INF/ANE
./extensions/com.zynga.farm2.desktopANE/META-INF/ANE/Windows-x86-64
./extensions/com.zynga.farm2.desktopANE/META-INF/ANE/Windows-x86-64/library.swf
./extensions/com.zynga.farm2.desktopANE/META-INF/ANE/Windows-x86-64/F2DesktopAne64.dll
./extensions/com.zynga.farm2.desktopANE/META-INF/ANE/extension.xml
./extensions/com.zynga.farm2.desktopANE/catalog.xml
./application.xml

installing flash wont help because the adobe flash player does not load: https://www.tenforums.com/software-apps ... -icon.html
Last edited by släcki on Tue Oct 25, 2022 1:55 pm, edited 1 time in total.
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Farmville v2 Launcher on Linux/Wine

Post by jkfloris »

Whether all the steps are necessary, I'm not sure, but I can play the game if I install Firefox 106.0.1 in Wine.

Code: Select all

# Install Firefox
wine "Firefox Setup 106.0.1.exe"
# For me, Firefox's "pingsender" doesn't work, so turn it off
winecfg → Libraries → New override → pingsender.exe → Add → Edit → Disable
# Also the Firefox menu bar isn't visible, disable the windows decoration
winecfg → Graphics → uncheck "Allow the window manager to decorate the windows"

# Start Firefox
cd "${HOME}/.wine/drive_c/Program Files/Mozilla Firefox"
wine firefox.exe
# Close Firefox after the first run steps. Make it the default browser

# Start Farmville 2
cd "${HOME}/.wine/drive_c/Program Files/Farm2Desktop"
wine "Farmville Two.exe" -launch
# If all goes well, now Firefox will open.
You'll probably be sent to a Facebook page. Whether logging in with Facebook works, I don't know.
However, going to https://zyngagames.com and logging in with a Zynga account does work.

Should Firefox not work/ crash, install wininet with winetricks
If FarmVille's taskbar does not work/ crash, you can turn it off by disabling farm2taskbarnotifier.exe in winecfg
släcki
Level 2
Level 2
Posts: 12
Joined: Wed Oct 19, 2022 8:29 am

Re: Farmville v2 Launcher on Linux/Wine

Post by släcki »

I tried what you mentioned. I logged in to facebook (also on zyngagames.com). Then it complains about the missing Farmville v2 Launcher, which it downloads (.msi file). I installed that (clicked on the download tab -> then the .msi, after asking if its ok to install i clicked ok).
First it looks like it does something, but then it only creates a white square in the upper left and... thats it.
Now i tested it again with wininet installed, killed everything, logged in again, it complains again that the launcher is missing, installed that again, and now... nothing :/
Attached is the log that is created when running wine firefox, i hope it does not contain any sensitive information :)

Cant attach them. It says invalid file extension, no matter if its output1.log or output1.txt :/
Last edited by släcki on Wed Oct 26, 2022 12:14 pm, edited 1 time in total.
släcki
Level 2
Level 2
Posts: 12
Joined: Wed Oct 19, 2022 8:29 am

Re: Farmville v2 Launcher on Linux/Wine

Post by släcki »

I killed everything and reinstalled wine again, and noticed i did not use the repo from winehq, my bad!

When i try to install the farmville2launcher.msi, i now get:
[oli@DESKTOP-E83VF5L Downloads]$ wine FarmVille2Launcher.msi
002c:fixme:winediag:LdrInitializeThunk wine-staging 7.20 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0098:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
00bc:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (00000000021CD4B0 1 C) semi-stub
002c:fixme:ntdll:EtwEventActivityIdControl 0x1, 000000000021EDE0: stub
0150:fixme:file:NtLockFile I/O completion on lock not implemented yet
0150:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0178:fixme:mscoree:parse_startup useLegacyV2RuntimeActivationPolicy=L"true" not implemented
0178:fixme:mscoree:get_runtime_info unsupported startup flags 2
0178:err:mscoree:CLRRuntimeInfo_GetRuntimeHost Wine Mono is not installed
0150:fixme:service:EnumDependentServicesW 0087BDD0 0x00000001 00000000 0x00000000 0073EB50 0073EB54 - stub
0150:fixme:msi:ITERATE_CreateShortcuts poorly handled shortcut format, advertised shortcut
01ac:fixme:msvcp:_Locinfo__Locinfo_ctor_cat_cstr (00000000021CD4B0 1 C) semi-stub
01c0:fixme:mscoree:parse_startup useLegacyV2RuntimeActivationPolicy=L"true" not implemented
01c0:fixme:mscoree:get_runtime_info unsupported startup flags 2
01c0:err:mscoree:CLRRuntimeInfo_GetRuntimeHost Wine Mono is not installed
0150:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)
0150:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5)

but i have wine-mono installed
[oli@DESKTOP-E83VF5L Downloads]$ rpm -qa | grep wine | grep mono
wine-mono-7.3.0-2.fc37.noarch
is there maybe another package? this one looks like the one from the fedora repository, not from any winehq repository. Or is this maybe even an incompatibility, as i am running fedora 37, and the winehq repo is for f36
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Farmville v2 Launcher on Linux/Wine

Post by jkfloris »

WineHQ does not offer a wine-mono package. When creating a prefix, Wine should have asked to download and install wine-mono. If not, you can also download it manually.

For Wine 7.20 you need wine-mono 7.4.0.

Read the wiki for more information
släcki
Level 2
Level 2
Posts: 12
Joined: Wed Oct 19, 2022 8:29 am

Re: Farmville v2 Launcher on Linux/Wine

Post by släcki »

Ok so i deleted again the prefix, installed firefox, installed wine-mono, installed wininet with winetricks, checked with wine uninstaller that wine-mono is installed, then opened zyngagames.com, logged in, everything looked good, downloaded the launcherv2 from zynga, installed it (clicked on the .msi download information inside firefox), and then this happened:

Unhandled exception: unimplemented function urlmon.dll.414 called in 64-bit code (0x0000017002e968).
Register dump:
rip:000000017002e968 rsp:00000000050becd0 rbp:00000000050bf0f0 eflags:00000202 ( - -- I - - - )
rax:0000000180000100 rbx:00000000050becf0 rcx:00000000050becf0 rdx:000000000000019e
rsi:0000000000000000 rdi:0000000000000002 r8:000007ff776ee2ca r9:0000000000000000 r10:0000000000230370
r11:0000000000232608 r12:0000000000000000 r13:8000000000000080 r14:0000000000000000 r15:0000000000000000
Stack dump:
0x000000050becd0: 00000000050becf0 0000000000000002
0x000000050bece0: 00000000050bf0f0 000000017002da62
0x000000050becf0: 0000000180000100 0000000000000000
0x000000050bed00: 000000017002e968 000007ff00000002
0x000000050bed10: 000007ff777acb90 000000000000019e
0x000000050bed20: 000000000023250d 000007ff0000000f
0x000000050bed30: 0000000000000000 0000000000230330
0x000000050bed40: 0000000000000000 000000000000002c
0x000000050bed50: 000000000000002b 0000000000000100
0x000000050bed60: 0000000000232610 0000000000230000
0x000000050bed70: 000000007b089af0 000000007b046978
0x000000050bed80: 000000000032d760 000000000032d760
Backtrace:
=>0 0x0000017002e968 stub_entry_point+0x48(dll=<internal error>, name=<internal error>, ret_addr=<internal error>) in ntdll (0x000000050bf0f0)
1 0x0007ff776ee2ca in wininet (+0x1e2ca) (0x000000050bf0f0)
2 0x0007ff776ee00b in wininet (+0x1e00b) (0x000000050bf0f0)
3 0x0007ff776e6687 in wininet (+0x16687) (0000000000000000)
4 0x0007ff7774f665 in wininet (+0x7f665) (0x00000000cc0018)
5 0x0000018075e248 in adobe air (+0x75e248) (0x000000050bf340)
6 0x0000018075fc8f in adobe air (+0x75fc8f) (0x000000050bfdb0)
7 0x0000007b6290b9 BaseThreadInitThunk+0x9(unknown=<internal error>, entry=<internal error>, arg=<internal error>) [Z:\home\abuild\rpmbuild\BUILD\wine-7.20\dlls\kernel32\thread.c:61] in kernel32 (0000000000000000)
8 0x0000017005f443 __wine_pop_frame(entry=000000018075FBD0, arg=000005F242C482E0) [Z:\home\abuild\rpmbuild\BUILD\wine-7.20\include\wine\exception.h:277] in ntdll (0000000000000000)
9 0x0000017005f443 RtlUserThreadStart+0x83(entry=[<register RSP not accessible in this frame>, arg=[<register RSP not accessible in this frame>) [Z:\home\abuild\rpmbuild\BUILD\wine-7.20\dlls\ntdll\thread.c:240] in ntdll (0000000000000000)
0x0000017002e968 stub_entry_point+0x48 in ntdll: jmp 0x0000017002e960 stub_entry_point+0x40

i guess i need a 32 bit prefix, just wondering why. is this urlmon thingen something from zynga?
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Farmville v2 Launcher on Linux/Wine

Post by jkfloris »

I have noticed that Firefox is unstable with Wine. You might have better luck with Chrome.
The following script installs an older Chrome version and FarmVille in its own prefix.
You may have to modify the script here and there, but I expect it can get you started.

Code: Select all

#!/bin/bash

FV_chrome="https://www.slimjetbrowser.com/chrome/files/90.0.4430.72/ChromeStandaloneSetup64.exe"
FV_launcher="https://zdnfarmtwo0-a.akamaihd.net/airversions/v1.0.28.0/FarmVille2Launcher.msi"


export WINEPREFIX="${HOME}/FarmVille2"
export WINE="/opt/wine-staging/bin/wine"
export WINEDEBUG="-all"
export WINEDLLOVERRIDES="winemenubuilder.exe=d"

echo "Create new prefix"
"$WINE"boot

echo "Download Chrome and Farmville"
wget -nv -nc -P "$WINEPREFIX/drive_c/windows/temp" "$FV_chrome"
wget -nv -nc -P "$WINEPREFIX/drive_c/windows/temp" "$FV_launcher"

echo "Install Chrome (This will hang for 2 minutes)"
$WINE start /unix "$WINEPREFIX/drive_c/windows/temp/ChromeStandaloneSetup64.exe"
# The installation of Chrome requires GoogleUpdate. But this process keeps running.
# Two minutes should be enough to install Chrome.
sleep 120
"$WINE"server -k

export WINEDLLOVERRIDES="GoogleUpdate.exe,winemenubuilder.exe=d"
echo "Chrome first run: disable Use hardware accleration when available (chrome://settings/system)"
"$WINE" start /unix "$WINEPREFIX/drive_c/Program Files/Google/Chrome/Application/chrome.exe" --disable-gpu
"$WINE"server -w

echo "Make Chrome the default browser"
"$WINE" start /unix "$WINEPREFIX/drive_c/Program Files/Google/Chrome/Application/chrome.exe"
"$WINE"server -w

echo "Install FarmVille (This will hang for a minute)"
"$WINE" msiexec /i "$WINEPREFIX/drive_c/windows/temp/FarmVille2Launcher.msi"
sleep 60
"$WINE"server -k

echo "Run FarmVille"
export WINEDLLOVERRIDES="GoogleUpdate.exe,ZyngaUpdateService.exe,Farm2TaskbarNotifier.exe,winemenubuilder.exe=d"
"$WINE" start /unix "$WINEPREFIX/drive_c/Program Files/Farm2Desktop/Farmville Two.exe" -launch
"$WINE"server -w
släcki
Level 2
Level 2
Posts: 12
Joined: Wed Oct 19, 2022 8:29 am

Re: Farmville v2 Launcher on Linux/Wine

Post by släcki »

awesome! it works with your script.
Do i have to disable gpu acceleration? And can i update the chrome exe?

updated the chrome exe to http://www.slimjetbrowser.com/chrome/fi ... etup64.exe, works
but not disabling hw acceleration for the gpu leads to
wine: Unhandled page fault on read access to FFFFFFFFFFFFFFFF at address 000000017002A827 (thread 0b8c), starting debugger...

i will see if her farm can be loaded on that laptop. she plays now for about 10 years and so there is a lot of resources that needs to be parsed :/
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: Farmville v2 Launcher on Linux/Wine

Post by jkfloris »

Do i have to disable gpu acceleration?
I haven't tested it extensively, but you can play with the different values of "Choose ANGLE graphics backend" in chrome://flags
Locked