LB Booster
General >> Suggestion Box >> Embedded Files http://lbb.conforums.com/index.cgi?board=suggestions&action=display&num=1385177606 Embedded Files
Post by CirothUngol on Nov 23rd, 2013, 02:33am
Here's a few suggestions regarding embedded files:
* Option to extract files to system %TEMP% folder. I don't know if special permissions are needed for this, but it'd be nice to have the option of extracting to a less-visible neutral location.
* Option to extract files only if they don't exist. ...or something similar. It seems that the default behavior is to always over-write any files that are present, which may not always be desired (like with a default settings.ini, perhaps).
* Option to extract files only when triggered to do so. I don't really know how this would work, but it'd also be nice to have some control over when, how often, or even if files were extracted.
* Block option to add embedded files unless .BAS file has been saved. So that other block-heads such as myself won't waste their time trying to solve a problem that doesn't exist. ^_^
Thanx again for including the option to embed files into LB Booster. It's going to make a couple of my little projects neater, cleaner, more attractive, and easier to maintain. LBB is most certainly an "every day" utility. w00t.
Re: Embedded Files
Post by Richard Russell on Nov 23rd, 2013, 10:45am
* Option to extract files to system %TEMP% folder.
I could do that. I may consider adding it to the next release if you think it would be really useful.
Quote:
* Option to extract files only if they don't exist. ...or something similar.
That's sort of how it currently works, except that it also tests to see if the file is identical to the embedded version; if not it gets overwritten. If you want to embed a file that can subsequently be modified, save it as a different name (maybe in %TEMP% if I provide that option) and in your program copy it to the required path/filename if it doesn't already exist.
Quote:
* Option to extract files only when triggered to do so. I don't really know how this would work
Nor me! If I add the 'extract to %TEMP%' option you would be able to achieve the equivalent in your own code by selectively copying from there to the desired destination.
Quote:
* Block option to add embedded files unless .BAS file has been saved.
I'll definitely look at fixing that issue one way or another.
Richard.
Re: Embedded Files
Post by CirothUngol on Nov 23rd, 2013, 5:46pm
I could do that. I may consider adding it to the next release if you think it would be really useful.
I would most certainly use it, and it seems the easiest and most direct way to allow users to control the placement of internal files. Also, providing the %TEMP% path as an internal variable (like DefaultDir$) would make user control even easier and more convenient.
Thanks for considering the suggestion. I think it would prove a great addition to the LibertyBASIC Booster.
Re: Embedded Files
Post by Richard Russell on Nov 23rd, 2013, 5:59pm
I would most certainly use it, and it seems the easiest and most direct way to allow users to control the placement of internal files. Also, providing the %TEMP% path as an internal variable (like DefaultDir$) would make user control even easier and more convenient.
OK, I'll add the option. You'll need to put the source file in %TEMP% first, but then you'd want to anyway for testing in the IDE.
I don't think I'll provide a predefined variable which points to %TEMP% for the simple reason that it would prevent you testing and debugging the program in LB. It's not difficult to do using CALLDLL:
Code:
TempPath$ = space$(_MAX_PATH)
calldll #kernel32, "GetTempPathA", _
_MAX_PATH as long, TempPath$ as ptr, _
ret as long
TempPath$ = trim$(TempPath$)
Edit: Anyway if you don't mind it being LBB-specific you can always use this hack: