issue-#94 using BlackBox without the Windows registry

Merged to the master branch
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

issue-#94 using BlackBox without the Windows registry

Post by Josef Templ »

I have created issue-#94 according to CPC 1.7 change list number 36.

For the changes see http://redmine.blackboxframework.org/pr ... c080bcafe3.

Fixes a trivial bug in ReadRegistry: len is given in byte and must be multiplied by 2.
Differences to the CPC 1.7 version are:

0. The new option is named /INIFILE instead of /PORTABLE.
1. The INI-file name is given as an explicit parameter following the /INIFILE option.
2. The top level section in the INI-file is named after the application (Dialog.appName, as also used in the Windows registry)
3. HostMenus.ReadCommandLine is extended with the new option.

For the user there is no change unless the new option /INIFILE <iniFilePath> is used on the command line.

- Josef
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#94 using BlackBox without the Windows registry

Post by Zinn »

Josef, your solution works fine.

In the PROCEDURE SetIniFile;
behind

IF opt = "/INIFILE" THEN
HostFiles.GetName(p, i, name, opt);

i insert the line

IF name = "" THEN name := HostFiles.appName + ".ini" END;

- Helmut
luowy
Posts: 234
Joined: Mon Oct 20, 2014 12:52 pm

Re: issue-#94 using BlackBox without the Windows registry

Post by luowy »

Josef Templ wrote:0. The new option is named /INIFILE instead of /PORTABLE.
how about remain the "/PORTABLE" as a option without a infile name followed?
for I have used to it for years, it give me a goog feeling.

luowy
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#94 using BlackBox without the Windows registry

Post by Zinn »

luowy wrote:how about remain the "/PORTABLE" as a option without a infile name followed?
for I have used to it for years, it give me a goog feeling.
luowy
Luowy, see my last comment here. After insert the line

IF name = "" THEN name := HostFiles.appName + ".ini" END;

you can use /INIFILE without filename.

In which help document we should mention the new key /INIFILE ?
- Helmut
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#94 using BlackBox without the Windows registry

Post by Josef Templ »

The name "/PORTABLE" is just misleading.
It is a poor name for that purpose.
luowy
Posts: 234
Joined: Mon Oct 20, 2014 12:52 pm

Re: issue-#94 using BlackBox without the Windows registry

Post by luowy »

Josef Templ wrote:The name "/PORTABLE" is just misleading.
It is a poor name for that purpose.
https://en.wikipedia.org/wiki/Portable_application
A portable application (portable app), sometimes also called standalone, is a program designed to run on a compatible computer without being installed leaving the computer's configuration information intact. This type of application can be stored on any storage device, including internal mass storage and external storage such as USB drives and floppy disks – storing its program files and any configuration information and data on the storage medium alone. If no configuration information is required a portable program can be run from read-only storage such as CD-ROMs and DVD-ROMs. Such applications are commonly used on restricted machines due to the nature in which they do not interact or modify the system. They are considered safe since they run the same executable code and thus neither add nor retract any functionality of their installable counterparts. Some applications are available in both installable and portable versions.

Some applications which are not portable by default support optional portability through other mechanisms, the most common being command-line arguments. Examples might include "/portable" to simply instruct the program to behave as a portable program, or "--cfg=/path/inifile" to specify the configuration file location.
use a bat file in the bb directory:

Code: Select all

start blackbox.exe  /PORTABLE /NOSCROLL 
then this BB became "portable", it can run anywhere without touching system Registry;
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#94 using BlackBox without the Windows registry

Post by Josef Templ »

Thanks, I was not aware of this definition of 'portable'.
The usual interpretation is that it is a software that can be
recompiled and linked for a different platform such as MacOS, Windows or Linux
or even be run on different OSes without recompilation such as Java programs.

Anyway, we can of course keep /PORTABLE as an alias for the more explicit form
of /INFILE <appname>.ini.
The alternative of omitting the filename only works if the /INFILE option is the
last one in the command line and this is only possible if there is only one option
with an optional argument. This would be kind of ugly.
I have therefore included /PORTABLE now as a separate option.

For the changes see http://redmine.blackboxframework.org/pr ... c080bcafe3.

@Helmut: is it important to choose HostFiles.appName instead of Dialog.appName?

The command line options are currently not documented anywhere
(with the exception of the /USE and /PAR) so I have added them.

- Josef
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#94 using BlackBox without the Windows registry

Post by Zinn »

Josef Templ wrote: @Helmut: is it important to choose HostFiles.appName instead of Dialog.appName?
No, it isn't. Use the one you like.
- Helmut
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#94 using BlackBox without the Windows registry

Post by Robert »

Minor typo in the Docu for \USE. "pathes" should be "paths".
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#94 using BlackBox without the Windows registry

Post by Josef Templ »

thanks, fixed.
Post Reply