Distribution Tool for SmallBASIC

Started by J7M, July 14, 2022, 19:33:20

Previous topic - Next topic

J7M

I programmed a simple distribution tool for SmallBASIC. You can create packages for Windows and Linux now. The packages have all files necessary to run your program. The Windows package contains an exe-file. Just double-click it to start your SB program. For Linux you can create an AppImage. On the SmallBASIC website you can find an article with instructions: https://smallbasic.github.io/pages/distributiontool.html

So far I could only test it on three different computers running Win10, Win11 and Linux Manjaro. I hope it will run on your system. Please let me know, if you find a bug.


chrisws

This is awesome, but I have a suggestion - we should make an option for android.

I think I would just need to release the intermediate build artefacts.

It would probably require the user to have installed the android sdk.

J7M

Would be great to build for android. I have never done something with android or the android sdk. But I'm sure with some help from your side, I can add this option to the tool.

chrisws

Quote from: J7M on July 20, 2022, 19:47:28
Would be great to build for android. I have never done something with android or the android sdk. But I'm sure with some help from your side, I can add this option to the tool.

I created a shell script to combine various SmallBASIC components to make a separate app.

This consists of:
- dist folder containing pre-compiled java and c code
- resources folder containing app icons
- assets folder containing main.bas and font ttf files
- AndroidManifest.xml - hand edited XML file
- self signed certificate to sign the app

If you are still interested I could release this as a package/kit.

You could then incorporate the script steps into your distribution program.

The main dependency is the Android SDK along with Java.

J7M

QuoteIf you are still interested I could release this as a package/kit.

You could then incorporate the script steps into your distribution program.

The main dependency is the Android SDK along with Java.

I'm still interested. Distributing for Android will be great. Please prepare the package and I'll add it to the Distribution Tool.

chrisws

Quote from: J7M on August 16, 2022, 21:17:26
QuoteIf you are still interested I could release this as a package/kit.

You could then incorporate the script steps into your distribution program.

The main dependency is the Android SDK along with Java.

I'm still interested. Distributing for Android will be great. Please prepare the package and I'll add it to the Distribution Tool.

Okay - here is the package. https://github.com/smallbasic/SmallBASIC/releases/tag/v12.25_pre

Let me know if you hit any issues.



J7M

QuoteOkay - here is the package. https://github.com/smallbasic/SmallBASIC/releases/tag/v12.25_pre

Let me know if you hit any issues.

thank you. I will have a look and try to get it working (but it will take some time).

J7M

Just a short update: I managed to get the android-sdk command line tools working, building an apk package and installing it on my tablet. The app runs smooth on my tablet like it was started in the Android SmallBASIC editor. Next I will create the distribution tool for Android.

J7M

The new distribution tool to create Android apps ready for use. More information in the SmallBASIC article:

https://smallbasic.github.io/pages/distributiontool.html

Please let me know, if you find bugs or have problems using the tool.

JohnnyRockets

Hi,

I'm a bit late to the conversation, but this is super cool and MUCH appreciated!

JR

lettersquash

OMG, I'm even later to the conversation - I should check here more often! This looks very promising! Thanks guys.
I'll have you know, I'm coding all the right commands, just not necessarily in the right order.

lettersquash

#11
Just tried it with one of my programs, but it didn't work for me (Win11). The dialog is rather small on my PC, by the way, but I think I used it properly. It's also hard to read with the two shades of grey.

I did two tests with my program, one as package directory, the other as self-extracting, to separate destinations. Oddly, these seem to have been created with the child folder named the opposite of the boxes I checked (lighter greyed).

The package directory (as dir named) didn't do anything after a couple of momentary windows appeared and disappeared. The s-e exe opened a Main.bas window after the flickering windows, but content - my script should draw some shapes - didn't appear.

I might try the opposite editor option, but I'm not sure I can spare much time for experimenting with it. I think I had it on the console version (but I've been editing that script in both that and the FLTK editor. Maybe that's my bad - I didn't think I had to worry which I used. I don't use any plugins, just the native sB code.

I was hoping the resulting exe might be a stand-alone program, but it seems to install a copy of sbasic.exe and various resources in the data directory. I was once again hoping to escape the syntactical spider's web that is AutoHotkey and port my creations to SmallBASIC, but it's not looking like it's suitable for the project I'm on with.

Good luck!
I'll have you know, I'm coding all the right commands, just not necessarily in the right order.

J7M

@lettersquash
The distribution tool is not a compiler, which creates a stand-alone exe file. It will just pack everything together and makes execution easier, especially if you want to share your program with friends who don't have any idea about Smallbasic.

I agree with you, that the color theme of the nuklear plugin is a little bit misleading. Looking at the screenshot, I'm not so sure which checkbox is checked. Maybe something I can improve. Size of the text might be at high resolution displays a little bit small, depends on the scaling by the window manager.

Can you share your source code? I would like to try and see if there is somewhere a bug in the packaging tool.

lettersquash

Quote from: J7M on February 01, 2023, 19:48:51
@lettersquash
The distribution tool is not a compiler, which creates a stand-alone exe file. It will just pack everything together and makes execution easier, especially if you want to share your program with friends who don't have any idea about Smallbasic.
Yes, I see.

Quote
I agree with you, that the color theme of the nuklear plugin is a little bit misleading. Looking at the screenshot, I'm not so sure which checkbox is checked. Maybe something I can improve. Size of the text might be at high resolution displays a little bit small, depends on the scaling by the window manager.
Yes, this is often an issue. I notice my Win11 settings include something for scaling particular program windows individually. I've not tried it yet, but that might work. I find the opposite problem comes up with some non-resizeable tools - SuperBeam, for example - where I have to temporarily remove the taskbar to hit a button. ;D

Quote
Can you share your source code? I would like to try and see if there is somewhere a bug in the packaging tool.
OK, can do. It had a text file it loaded for data, so I just edited it to give it a simpler text string, removing the file calls and repeat-until loop. I wondered if that might be one problem, but it didn't fix it. I edited and ran it last in sbasici.exe (FLTK), so used the Console option in the radio buttons at the bottom (the other says sbasicg.exe). I'm not sure if I'm doing that right.

N.B. those radio buttons seem to work backwards - maybe this is the problem - if I click on the unchecked one, it doesn't switch the selection to that one; if I click the checked one (lighter colour), it switches to the other.

I opted for the self-extracting archive. I'm not sure what the difference is.

Another possible problem that occured to me is that my SmallBASIC programs are in ...\My Documents\Programming\SmallBASIC (with the script in a subdirectory of that path) rather than in Program Files or elsewhere. This probably happened when I moved my SmallBASIC files from my old PC to my new one - perhaps I should have installed the programs properly - I can't remember if they come with installers or are just unzipped.

I am essentially a beginner with SmallBASIC, and don't understand much of the various editing options, nor do I know much about the Windows environment, so it may just be my bad. I am pretty experienced with BASIC generally though, and this script works fine when I run it on my system using either editor.

File attached.
I'll have you know, I'm coding all the right commands, just not necessarily in the right order.

J7M

@lettersquash
I checked with my Win11 and my Linux computer. I tested the Linux and the Windows version of the distribution tool with your k2.bas. All created packages are running fine in Windows 11 and in Linux. In the attachment you can find a screenshot of the windows dist tool with the settings I used.  Maybe something is wrong there? Sorry, but right now I don't know what else could be the reason.