Distribution Tool for SmallBASIC

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

Previous topic - Next topic

lettersquash

#15
Aha! I think I've got it - anyway, both have worked with these changes:

I first tried again with (what I thought was) neither box checked - black, empty checkboxes for the two types, self-extracting or package. I now suspect those are CHECKED when black and UNCHECKED when pale. This would also explain why I thought the logic of the two radio buttons was wrong.

Anyway, having run it like that, it still just made the Win_PackageDirectory with contents, the exe and data directory, all looked complete. However, that exe didn't work - just created the "main.bas" window, empty.

It was FIXED when I also noticed your paths for source and destination were parallel. I had put my destination in a subdir of where the source is. Probably some self-reference or recursion problem, maybe, although it reports finishing.

I then did the same with the paths, (i.e. made them parallel) and it created both package and installer versions in their folders, both of which worked correctly, giving the original output! Yay...

Except, this is where I realise I'm making a fundamental error. I thought the app would just take my k2.bas file, scan it for any referenced resources and include those. I had various other bits of junk in that directory, including my directories with earlier attempts - so although these last attempts work fine, they also contain all that junk! I didn't realise I have to start with just my .bas file and required resources in their own directory. I'm pretty sure that's all it was. Schoolboy error, as we used to say.

So, well done - even though this isn't the compiler I thought it might be, I expect it will be useful to send someone a working program. In fact, it's almost as good - the only difference I can think of is that the code and other data are exposed, but I'm a long way from worrying about IP rights.

Thanks again,
¬~
I'll have you know, I'm coding all the right commands, just not necessarily in the right order.

Tinine

#16
Quote from: lettersquash on January 31, 2023, 13:15:35Just 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 have the identical experience as outlined above  :(

Apologies...false alarm. I hadn't read where @lettersquash discovered the fix. I did the same and now all is great. Really loving this interpreter and I'm going to use it for a serious application  8)


codeWrapped

Hello J7M,

I am completely new here. I tried your program and I get a black screen? I am on PC with Windows 10. What I did is create a small window.bas program using the Raylib "Basic Window" example. I can run the code using sbasic window.bas and it works fine. I get a Raylib window with some rendered text that stays open until I close it. I then use your tool to package it. It creates me a directory with a data directory and a first_window.exe When I double click on the first_window.exe I do get a window, but it has black screen?

I am also wondering how you guys compile a .bas file to a .exe via command-line, without the Distribution Tool?

Thank you in advance!

J7M

Hi codeWrapped, could you please attache a screenshot of the distribution tool. I would like to see, how you configured all the paths and files. Maybe something is wrong there.

SmallBASIC only compiles some kind of byte code which is then interpreted. You can't compile and get an executable file. The distribution tool only packs all the necessary files together and creates an exe-file which in the end just calls SmallBASIC with the right parameters.

J7M

@codeWrapped : I tried to create a package for a raylib program. I didn't work on my Win10 neither. The problem is, that I forgot to add the file "raylibc.bas" to the distribution tool. I'll do this the next days and update Github. As a quick work around, you can copy the file raylibc.bas from the SmallBASIC folder to the folder, where your basic-program is located.