Dennis
Full Member
 
Old but still active
Posts: 147
|
Post by Dennis on Aug 31, 2021 17:41:31 GMT -5
I have spent the last hour or so trying to create a .EXE file for one of my programs. I have done it before a a year or so ago but somehow I cannot get it to work again. I have followed the Help Manual religiously and specified a unique name after browsing. The file textbox shows the correct name. When I click the Create button, LB comes up with a message "OS Error. The system cammot find the file specified" I have tried different names, different directories, and have even moved the source (.bas) into a clean directory but nothing helps. I keep getting the same message. I am obviously doing something wrong but I cannot figure out what. Desperately looking for help. I need a .EXE file to be able to use a commercial protection wrapper.
|
|
|
Post by mknarr on Aug 31, 2021 17:54:27 GMT -5
Dennis, I'll try to help. First you need to create a TKN file with the same name as your basic program. Then goto folder Program Files(x86) and look for your Liberty Basic folder. It might be named Liberty Basic v4.5.1. In that folder is an exe named runXXX.exe and if you have LB version 4.5.1 it will be named run451.exe. Copy that program to the folder that contains your tkn and then rename it to the name of the tkn file. That's the way I have done it from about 17 years.
I have never used the Create Function and it may be that it is looking for the TKN file.
|
|
|
Post by Chris Iverson on Aug 31, 2021 18:29:21 GMT -5
That's the manual way to do it, and if you do that, you'll also need to copy some, if not all, of the DLL and SLL files from the LB folder.
I've forgotten which ones do what; and the Create Application option just copies them all to not worry about it.
EDIT: Also, after getting that error, would you be able to post the most recent entry from your ERROR.LOG file? (Or delete it and let the error re-create it, so it's the only thing in there)
|
|
Dennis
Full Member
 
Old but still active
Posts: 147
|
Post by Dennis on Aug 31, 2021 22:47:45 GMT -5
Thanks mknarr - I think you are right about the TKN file but the Create function should say something along those lines. Chris, I will look at the error log and follow your advice...
|
|
Dennis
Full Member
 
Old but still active
Posts: 147
|
Post by Dennis on Aug 31, 2021 23:17:17 GMT -5
OK, this is really strange... Tried mknarr's TKN suggestion first. I verified that there is a TKN file present and tried the Create function again - got the error message. Repeated everything that I had tried before and the message persisted. I thought Chris' suggestion regarding the error.log made sense so I located and deleted the error.log. Tried the Create again to record the error and it worked!! Tried it a few times with no problem...... Very strange!! I now have to consider whether a 1.2MB .EXE (excluding the DLL and SLL files) is feasible to distribute - I have a suite of 15 programs which make up my system... Going to see if another product (whose name shall not be mentioned) will reduce the bloat....  Seriously though, I cannot see the link between deleting the error log and the Create working??? Was the message perhaps referring to the error log and not my program? Perhaps the error ;og was corrupt although I could read it with Notepad.... Confusing! ***EDIT*** Tried the alternate product and it yielded a 113KB .EXE which is a 90% reduction.....
|
|
|
Post by Chris Iverson on Aug 31, 2021 23:19:51 GMT -5
If you distribute the programs together(and they're all LB programs), you only need one set of the SLL and DLL files. You'll need a separate EXE and TKN for each one, but if they're all in the same folder, they can share the rest of the runtime files.
As for why deleting the error log caused it to work, I have absolutely no idea.
|
|
Dennis
Full Member
 
Old but still active
Posts: 147
|
Post by Dennis on Aug 31, 2021 23:33:09 GMT -5
Chris, I know I will only need one set of SLL and DLL files but the 1.2MB for a smallish program concerns me. The SLL and DLL files together are about 1.7MB which is a one-time hit. Some of the clients (students) I deal with live in countries with limited Internet and with slow and expensive downloads. This is why size concerns me.
Regarding the Create problem, I have a feeling that the error log was corrupted or something... Why did no other function "complain"?
Going to try making an EXE out of one of my larger programms...
|
|
Dennis
Full Member
 
Old but still active
Posts: 147
|
Post by Dennis on Aug 31, 2021 23:57:42 GMT -5
I am now totally confused... The error.log is MIA - cannot find it anywhere even with a search of my entire C: drive. The Create error does not want to go away so have given up on the Create approach and will go with mknarr's suggestion. This will be time-consuming and frustrating!! I think there is definitely a link between the error log and the Create function.
I compliled my largest program with the alternate product and it created an EXE of 130KB. I don't know what size LB's will be as I cannot get the Create to work. I assume it will probably be a bit larger than 1.2MB....
Carl needs to look at why the Create function is misbehaving and how the error log is related....
mknarr - do I have to include all the TKN files when I distribute my system? I assume I need to do this which adds to the bloat!!
|
|
|
Post by tsh73 on Sept 1, 2021 2:03:16 GMT -5
Hello Dennis
as for size #1 then I saved *this* page I got 2Mb (and 91 file!) One Google Search result page is 2.3Mb Time of small downloads is over long long time ago - you can't control the Internet So I don't think you really should bother (IMHO)
as for size #2 biggest programs I have is about 40k, a bit over 1000 lines. Size of TKN I get is +/- 10% from source I really wonder what size is your "smallish program" source code? May be some big data tables/strings is included? (where was a code to put coded BMP in DATA lines for example) (just curiosity)
As for "This will be time-consuming and frustrating!!" 1. create tkn 2. move it to new folder 3. copy dlls/slls 4. copy runtime engine, rename it as your TKN name That's really all
Easier still - if you already have EXE created, you can copy EXE (which is actually renamed runtime engine - same for all LB EXEs) and dlls/slls from there, - no need to search in a folder.
|
|
|
Post by Rod on Sept 1, 2021 3:41:19 GMT -5
Are we sure the error message discussed is not the "Error creating .exe" message which always occurs if you try and create an .exe into a directory that has been created before? The system finds files it did not expect and creates the error message. But in fact since the files exist you will find the .exe runs perfectly well.
We would need to see the exact error message wording.
|
|
Dennis
Full Member
 
Old but still active
Posts: 147
|
Post by Dennis on Sept 1, 2021 10:24:53 GMT -5
Hi Rod I gave the exact wording in my original post. Here it is again:
When I click the Create button, LB comes up with a message "OS Error. The system cannot find the file specified" This is the exact wording.
The error log has totally disappeared....
|
|
Dennis
Full Member
 
Old but still active
Posts: 147
|
Post by Dennis on Sept 1, 2021 10:54:09 GMT -5
Hi Anatoly Thanks for responding. I was not critisizing LB but making a comment about a problem and some concerns about size.... Yes, my "smallish program" has large tables in it and is over 2500 lines of code - that is the nature of the beast. The same program when compiled with other BASICs yielded between 110KB and 116KB EXE's. And no, I do not use DATA or any imbedded BMPs. If you knew the target market and countries I operate in, you would not make the comment you did about the Internet. I have to bother!! In fact many times I have had to use a USB stick to move things as there is no Internet available. Where there is, it is slow and expensive so I have to concern myself about its use... I live in a country where access to the Internet is fast, cheap, and unshaped - others do not... It would be easier to just hit Create then to go through a 4 step process each time. At my age, time is of the essence as I might not live too long...  The reason for needing an EXE is to allow a licensing system to wrap it for protection. TKN and other types of file cannot be "wrapped". I am not too sure what you mean about "search in a folder" in your last sentence? Regards
|
|
|
Post by Rod on Sept 1, 2021 10:59:05 GMT -5
Well the other reason would be that you are starting Liberty by clicking on a desktop icon, say of the project directory or a .bas file. If you are clicking a shortcut to start Liberty it does not change the working directory, so Liberty may start but it is set to the project directory or .bas files directory and not the original Liberty directory where the .dlls are stored.
This from the help file.
So navigate to the Program Files(x86) folder that holds the Liberty BAISC v4.5.1 directory and click on Liberty.exe to get the IDE (Editor) Then navigate to load your .bas file, once loaded you are set to create an .exe. Liberty will have the .bas file loaded but will still have its working directory set to Program Files(x86) and will find the .dlls it needs to complete the process.
When you click create the loaded .bas file is used to create the .tkn and then the .dlls are copied from the working directory to your named .exe directory putting everything needed into one directory.
You can right click on that directory and select send too, zipped file. Then typically you will have a much smaller file to distribute and one that is easy to extract onto the destination PC.
|
|
Dennis
Full Member
 
Old but still active
Posts: 147
|
Post by Dennis on Sept 1, 2021 11:28:28 GMT -5
Thanks Rod. I will try what you suggest. I do not use a shortcut for LB on my desktop - I execute it directly. However, I will experiment to see what is happening. What you are saying makes sense. Perhaps after 54 years in the game I have got used to easy and seamless "compiling"...  I will give you feedback.
|
|
|
Post by Carl Gundel on Sept 1, 2021 11:35:12 GMT -5
OK, this is really strange... Tried mknarr's TKN suggestion first. I verified that there is a TKN file present and tried the Create function again - got the error message. Repeated everything that I had tried before and the message persisted. I thought Chris' suggestion regarding the error.log made sense so I located and deleted the error.log. Tried the Create again to record the error and it worked!! Tried it a few times with no problem...... Very strange!! I now have to consider whether a 1.2MB .EXE (excluding the DLL and SLL files) is feasible to distribute - I have a suite of 15 programs which make up my system... Going to see if another product (whose name shall not be mentioned) will reduce the bloat....  Seriously though, I cannot see the link between deleting the error log and the Create working??? Was the message perhaps referring to the error log and not my program? Perhaps the error ;og was corrupt although I could read it with Notepad.... Confusing! ***EDIT*** Tried the alternate product and it yielded a 113KB .EXE which is a 90% reduction..... Sorry, but how is 1.2MB bloat? Why does an EXE need to be 113K when a 1GB flash drive will hold 800 copies of a 1.2MB file?
|
|