Tool CreateB4xlib

Hi,

with this small Windows application you can easily create a B4xlib library.
You can save the application "CreateB4xlib.exe" wherever you want.
The best way is to create a shortcut to the application and save it under this path: C:\Users\your-username\AppData\Roaming\Microsoft\Windows\SendTo
1676645499943.png


This way you can easily create a B4xlib from the contents of a directory using the "Send-To" command.

1676645138278.png


The prerequisite is that the compression tool 7-zip is installed and located under "C:\Program Files\7-Zip".
Only all "*.bas" and *.txt" files as well as the directory "Files" are stored in the B4xlib.

18.02.2023: Update to v1.001
Fixed error when creating.

18.02.2023: Update to v1.002
The "Objects" directory was mistakenly integrated into the library.

20.02.2023: Update to v1.003
- Translate messages to English, German and Italian.
- Create a InnoSetup script to install application and create its shortcut on "C:\Users\[username]\AppData\Roaming\Microsoft\Windows\SendTo".
- The limitation "no blank character" remains, because the B4xlib should not contain spaces anyway.
- I had to split the zip-file in 2, because the forum doesn't allow larger files than 512KB.
Please delete the ".txt" extension from the zip files.

24.05.2023: Update to v1.004
- In this new version, classes/files can be excluded.
Just add the attribute "ExcludedFiles" in the file "manifest.txt" and the application excludes it from the library.
Example of a "manifest.txt" file:
Version=1.00
B4A.DependsOn=XUI
B4i.DependsOn=iXUI
ExcludedFiles=clsTest1.bas, clsTest2.bas
- In the zip file "CreateB4xlib.v1.004.zip" is only the exe file, just uncompress it and replace the old version.
 

Attachments

  • CreateB4xlib_v1.003.zip.001.txt
    512 KB · Views: 255
  • CreateB4xlib_v1.003.zip.002.txt
    429.7 KB · Views: 251
  • CreateB4xlib.v1.004.zip
    13.1 KB · Views: 239
Last edited:

Filippo

Expert
Licensed User
Longtime User
Fixed error when creating.
The library was created in "7z" format. But this format is not recognized by B4x, it must be created in format "zip".
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
On previous version, the application was creating an empty b4xlib.
I was just about to report this, but then came version 1.001 update.
Well... After this update the application is not creating any b4xlib file at all.
Tried running it with "send to" link and with CMD. No b4xlib file and no response whatsoever in both situations.
 

Filippo

Expert
Licensed User
Longtime User
On previous version, the application was creating an empty b4xlib.
I was just about to report this, but then came version 1.001 update.
Well... After this update the application is not creating any b4xlib file at all.
Tried running it with "send to" link and with CMD. No b4xlib file and no response whatsoever in both situations.
Hi @Claudio Oliveira ,

I just tried again, it works without problems.
What does the directory look like? Can you make a screenshot?
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
Hi @Claudio Oliveira ,

I just tried again, it works without problems.
What does the directory look like? Can you make a screenshot?
Sure!
1676751097249.png


This is what my project folder looks like before running CreateB4Xlib. It stays exactly the same after runnning the application.
I'm running Windos10 Pro- 64bits, B4J 9.80 64bits, JDK 11.0.1 and 7Zip Version 22.01 (x64).
By the way: Already tested CreateB4Xlib version 1.002
Thanks!
 

Filippo

Expert
Licensed User
Longtime User
This is what my project folder looks like before running CreateB4Xlib. It stays exactly the same after runnning the application.
I'm running Windos10 Pro- 64bits, B4J 9.80 64bits, JDK 11.0.1 and 7Zip Version 22.01 (x64).
By the way: Already tested CreateB4Xlib version 1.002
Thanks!
The start directory must not contain a blank character.
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
Great!
Copied my start folder to D:\ and everything worked just fine.
Thank you!

Hope you don't mind if I make some suggestions... ?
- Translate messages to English. German is such a beautiful language and it's worth learning! Meanwhile, I believe messages in English would reach a larger number of users.
- Open the target folder at ther end of B4Xlib creation process.
- Create a InnoSetup script to install application and create its shortcut on "C:\Users\[username]\AppData\Roaming\Microsoft\Windows\SendTo"
- Last but not least: remove this "no blank character" limitation.

Nice app indeed, Filippo!
Thanks for sharing
 

Filippo

Expert
Licensed User
Longtime User
Great!
Copied my start folder to D:\ and everything worked just fine.
Thank you!

Hope you don't mind if I make some suggestions... ?
- Translate messages to English. German is such a beautiful language and it's worth learning! Meanwhile, I believe messages in English would reach a larger number of users.
- Open the target folder at ther end of B4Xlib creation process.
- Create a InnoSetup script to install application and create its shortcut on "C:\Users\[username]\AppData\Roaming\Microsoft\Windows\SendTo"
- Last but not least: remove this "no blank character" limitation.

Nice app indeed, Filippo!
Thanks for sharing
Thanks for your suggestions for changes, I will try to implement as many as possible.
 

giannimaione

Well-Known Member
Licensed User
Longtime User
windows defender detect "Trojan:Win32/Wacatac.B!ml"
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
Ciao Filippo!
Thanks for implementing my suggestions! ?
Everything working fine, including InnoSetup script.

This message is still in german though...
1676911825442.png
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
Perfect!
Finally someone has found it, because I am the inventor. ?
Scanned with Avast and Karspersky and no virus found at all.
I don't use Windows Defender. It keeps reporting false positives all the time. I believe CreateB4xlib is another one of these...
 

Filippo

Expert
Licensed User
Longtime User
Scanned with Avast and Karspersky and no virus found at all.
Super! Then no one will recognize my super virus. ?

This message is still in german though...
But that's strange, normally it should be English, because the language file is correct.
The correct output should be: The B4xlib was created successfully!

Everything working fine, including InnoSetup script.
This took me almost a day of work, because I was trying to create the shortcut to Send-To all the time with Visual-Studio.
Obviously it doesn't work with Visual-Studio. But then I managed it with InnoSetup.
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
Super! Then no one will recognize my super virus. ?
But that's strange, normally it should be English, because the language file is correct.
The correct output should be: The B4xlib was created successfully!
Two comments here:
- I was using the OLD version of the application. My bad. Updated version Ok. Sorry! ?

- Installation messages are Ok. Tried Italian, Deutsch and English, and all installation messages showed up in the correct language. On the other hand, application messages are always in english, no matter what language was selected for installation - including deutsch.

Check this out: italian installation.
I deliberately started the application from the start menu with no parameters just to check the message returned. That's the last pic.
1676915689394.png
1676915679053.png
1676915671332.png
 

Filippo

Expert
Licensed User
Longtime User
Check this out: italian installation.
I deliberately started the application from the start menu with no parameters just to check the message returned. That's the last pic.
The language setting during installation has only installation to do, not with the application.
The language for the application is based on the system setting.

The output on the last image is normal, because the application has to output a message if it is started without parameters.
 

Claudio Oliveira

Active Member
Licensed User
Longtime User
The language for the application is based on the system setting.
Oh, right!
I'm from Brasil, so my language setting is pt_BR. As you didn't translate your app to brazilian portuguese, the original windows default language (en_US) is used instead.
I installed the italian language pack, run the app and... voilà! Italian messages.
Brilliant! Very useful application indeed!
Thank you! Grazie! Dankeschön! Obrigado! :)
 

TelKel81

Active Member
Licensed User
For a single BAS file, I use this 3-liner batchfile (.bat, .cmd) :
B4X:
set PATH_SevenZip=D:\Apps\7-Zip\7-Zip64
set PATH_AdditionnalLibraries=C:\Program Files\B4J\# Libraries

"%PATH_SevenZip%\7z.exe" a -tzip "%PATH_AdditionnalLibraries%\%~n1.b4xlib" %1
1) Place the batchfile in the same folder as your shared modules (.BAS).
2) "Drag and drop" a BAS file over it.
3) It will take the filepath as argument, call PATH_SevenZip\7zip.exe and save the .b4xlib in your PATH_AdditionnalLibraries folder.
 
Top