B4J Tutorial B4LinuxInstall script to use B4X tools in linux

This is a Bash shell script that allows installing B4J and B4A in linux systems, along with their required dependencies. It is very functional. But for now only Ubuntu is fully supported.

The project has a repository in github. The only file you need is b4linuxinstall.sh. You can install it by opening a terminal and entering these commands:

B4X:
wget github.com/joseluis/B4LinuxInstall/raw/master/b4linuxinstall.sh
bash ./b4linuxinstall.sh
To install B4i and B4A you must download the installers and put them in the same directory before executing the script.
---

This is a work in progress. More linux distributions will also be supported eventually. There is a poll in this thread to know which are the most used in the community in order to prioritize them.

I must thank Zolive33 for his previous(1) work(2) from which B4LinuxInstall is built upon and tries to improve on the mission of bringing the software we love to our Linux computers.

UPDATE 2016: Since I'm no longer a user of B4X I'll probably wont be updating this tool anymore. Also it seems that since B4A version 5 there are some compatibility issues that difficults running it in linux.
 
Last edited:

johnaaronrose

Active Member
Licensed User
Longtime User
A suggestion for Ubuntu 16.04, in a terminal execute this commandes :
sudo apt-get update
sudo apt-get install winbind
Winbind was not installed. I installed it. Starting B4A leads to a small black window being displayed. Starting it from Terminal with:
export WINEPREFIX="/home/john/workspace_b4/wine_b4"
wine start /d "c:\\Program Files\\Anywhere Software\\Basic4android" B4A.exe
gives a loop on the following 3 messages:
fixme:win:EnumDisplayDevicesW ((null),0,0x513e414,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x513e530,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),1,0x513e530,0x00000000), stub!
 

zolive33

Active Member
Licensed User
Longtime User
did you use PlayOnLinux?
did you install Microsoft .Net Framework 4?
 
Last edited:

zolive33

Active Member
Licensed User
Longtime User
I haven't other idea to help you, sorry.
For me, everything works well, except copy/past on designer (Wine crashes, I don't no why!).
 

Attachments

  • Capture du 2017-02-14 21-25-42.png
    Capture du 2017-02-14 21-25-42.png
    25 KB · Views: 358
  • Capture du 2017-02-14 21-25-54.png
    Capture du 2017-02-14 21-25-54.png
    25.2 KB · Views: 341
  • Capture du 2017-02-14 21-26-28.png
    Capture du 2017-02-14 21-26-28.png
    40.4 KB · Views: 332

johnaaronrose

Active Member
Licensed User
Longtime User
I just installed B4A successfully on a laptop running Ubuntu Trusty and using B4A version 5.8 (as opposed to version 6.0 which I can't run on my desktop using Ubuntu Xenial). So I thought that I'd try again on my Xenial desktop with B4A v5.8. It didn't install B4A even though I said y to the question asking ifit should install! I'm baffled by some code in b4linuxinstall.sh: what does wget_download ${b4aURL} do (in line 521)? There is no other reference to b4aURL in the script.

I would have expected an invocation of the installer b4a.exe to install B4A. So I tried that:
john@NewDesktop:~/Downloads$ export WINEPREFIX="/home/john/workspace_b4/wine_b4"
john@NewDesktop:~/Downloads$ cp /home/john/Downloads/b4a.exe "/home/john/workspace_b4/wine_b4/drive_c/Program Files/b4a.exe"
john@NewDesktop:~/Downloads$ wine "C:\\Program Files\\b4a.exe"
fixme:process:SetProcessDEPPolicy (1): stub
fixme:shell:SIC_Initialize Failed to load IDI_SHELL_DOCUMENT icon!
fixme:shell:SIC_Initialize Failed to load IDI_SHELL_DOCUMENT icon!
fixme:process:SetProcessDEPPolicy (1): stub
err:eek:le:apartment_createwindowifneeded CreateWindow failed with error 317
fixme:win:DisableProcessWindowsGhosting : stub
 

zolive33

Active Member
Licensed User
Longtime User
This script is obsolete. It does not install "Microsoft .Net Framework 4".
The solution is to use PlayOnLinux (see my tutorial).
 

johnaaronrose

Active Member
Licensed User
Longtime User
I have Ubuntu 14.04 LTS on my Dell Vostro and B4A ran nicely on it. Since my last post I've upgraded my motherboard to an ASUS B85-M with an Intel i5-4690, 8G ram, 1T HD, all in a mid size ATX box. I dual boot to Ubuntu 14.04 or Windows 7 Pro. I went through all the steps as above and am asked for the license file but after that I get a small black rectangle and it freezes up. I've looked at the log and it seems that there are a couple unsupported functions that are causing the problems.

I had the original Dell motherboard in the Vostro so I replaced it with the MCI 760G motherboard (AMD FX6350) and Ubuntu 14.04 actually started up (different motherboard and all). B4A5 also started up and ran nicely. After some Ubuntu updates installed though, it finally crapped out too.

I don't know what I'm going to do. Microsoft has pulled it's last stunt in my case. Their blatant invasion of my privacy was the last straw. BUT, the programs that I rely on the most all run in Windows. :( I'm fed up with Microsoft but where else can I work with B4A?
I have same problem. Did you find a solution? If not, could you tell me where to find the log? What are the unsupported functions?
 

johnaaronrose

Active Member
Licensed User
Longtime User
Fixed b4linuxinstall.sh (download from https://app.box.com/s/r31f1jltwhfp3tjd2ficysu8zo3jtblw) so that it installs things OK. Problems were that B4A v5.8 used different directory names on installation from version 4. When I run B4A, it asks for License file OK and accepts it. But it then displays a solid black window approx 10cms x 5cms and nothing else happens.

I'm not able to run it successfully from Terminal. When I use "export WINEARCH=win32", "export WINEPREFIX=/home/john/workspace_b4/wine_b4" and "wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/john/workspace_b4/wine_b4/dosdevices/c:/users/Public/Start\\ Menu/Programs/B4A/B4A.lnk" (taken from B4A.desktop), it displays a popup titled Error stating "File not found". If only I knew which file! Clicking OK gives:
john@NewDesktop:~$ wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/john/workspace_b4/wine_b4/dosdevices/c:/users/Public/Start\\ Menu/Programs/B4A/B4A.lnk
fixme:exec:SHELL_execute flags ignored: 0x00000100
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: Success.

Both B4A.desktop (in .local/share/applications/wine/Programs/B4A) & wine-extension-b4a.desktop (in .local(/share/applications) were created by B4A install. I have uploaded both of them, changing the .desktop file extension to .txt. I don't know enough about Wine to see what I'm doing wrong when I try to run B4A from a Terminal. Can anybody tell me what I should do?

I've tried using winecfg to change the Windows version to Windows 7 and made other changes in the Libraries tab to set the following libraries:
* fusion (built-in)
* gdiplus (native)
* mscoree (native)
* msvcr100 (native,built-in)
* msxml3 (native)
I've tried both Wine 1.6 & 1.8 using Ubuntu Xenial.
All combinations make no difference.
 

Attachments

  • B4A.txt
    370 bytes · Views: 423
  • wine-extension-b4a.txt
    235 bytes · Views: 376
Last edited:

Juan Marrero

Active Member
Licensed User
Longtime User
I manage to install B4A, B4J and B4i using PlayOnLinux, and installing Java 7 (Configure Button/<your virtual drive/Miscellaneous Tab/ Run a .exe file in this virtual drive) For some reason Java 8 always got stuck during the initial part of the installation. I haven't deployed any app but they open correctly.
 
Top