Native Registry Support

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
J. Baker
Addict
Addict
Posts: 2178
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Native Registry Support

Post by J. Baker »

Rinzwind wrote:@J. Baker
You mean like how OS X also leaves configuration files and caches laying around ;)
I use App Cleaner on OS X but yes, Apple could include an official uninstaller in their OS.
BarryG wrote: As I said (twice now), access to the Registry is for reading and applying system settings that can't be done any other way.
Reading the registry is one thing but I prefer for the registry to be unaltered if possible. Some developers do use it for data only and then never clear it. That's highly annoying.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: Native Registry-Unterstützung

Post by Saki »

Saki wrote:
BarryG wrote: As I said (twice now), access to the Registry is for reading and applying system settings that can't be done any other way.
Interesting, which exactly do you want to change, name them !
No offense,
but they demand things they don't know how to use or if you need them.
地球上の平和
User avatar
ChrisR
Addict
Addict
Posts: 1150
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: Native Registry Support

Post by ChrisR »

It's not going to advance the debate, but whether you like it or not, the Registry is at the core of Windows and many other applications.
For me, there is no doubt, it is a lack in PB and it should be integrated natively to simplify developer's life. Cross platform compatibility is a bad excuse for not having it.
I often use the registry to develop some Windows tools, so +1 for me
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Native Registry Support

Post by RichAlgeni »

Jac de Lad wrote:However, some programming languages implemented a dedicated solution for non windows platforms, storing that information in a file with similar structure. This won't port the information you can get via registry on windows to other is, but is suitable for storing information intended by the developer.

Also however, being limited to windows doesn't seem like a valid excuse to me. Thinking of SendMessage right now...
We learn by doing. Build your own. Ask if you need help. The people here will be glad to help you.
User avatar
Jac de Lad
Enthusiast
Enthusiast
Posts: 106
Joined: Wed Jul 15, 2020 7:10 am
Contact:

Re: Native Registry Support

Post by Jac de Lad »

That's not the point. I know how to do it via API, but I just think it would be a logical addition. I can understand that PureBasic is meant to be platform independent. XProfan is creating a file as pseudo registry on non windows systems. Seems like a good solution to me.

Gesendet von meinem ONEPLUS A6003 mit Tapatalk
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: Native Registry Support

Post by RichAlgeni »

Most of us dislike the registry. We use it because it is a necessity when building a service. But most of the Window's Issues I have run into were because of registry problems.
User avatar
DeanH
Enthusiast
Enthusiast
Posts: 224
Joined: Wed May 07, 2008 4:57 am
Location: Adelaide, South Australia
Contact:

Re: Native Registry Support

Post by DeanH »

I think this would be a useful function in PB. Here is an example why: I discovered some of my adventuresome users have associated the database files with Adobe PDF reader or something else. This happened because they tried to open the database directly from File Explorer, saw the dialog asking which app to use and then chose one without knowing what was actually going on. The database then gets associated with the wrong program, which can sometimes cause weird problems. There is no easy way to remove an association in Windows. It requires a registry hack or some other software like Types. Hacking the registry is not a good idea, and I shudder when I have to do it, but i have too many times, especially for this problem. I would like to add a password-protected pushbutton in the support area of my program that would remove the association. Easy, simple, controlled. This is just one example. So a +1 from me, too.
Marc56us
Addict
Addict
Posts: 1479
Joined: Sat Feb 08, 2014 3:26 pm

Re: Native Registry Support

Post by Marc56us »

DeanH wrote:There is no easy way to remove an association in Windows.
Hi,

There is the Windows command: 'assoc'

Displays or modifies file name extension associations.

Code: Select all

assoc [<.ext>[=[<filetype>]]]
To remove the file type association for a file name extension, add a white space after the equal sign by pressing the SPACEBAR.[/i]

But I also vote for some registry change commands (even if I rarely use the registry directly)

:wink:
User avatar
DeanH
Enthusiast
Enthusiast
Posts: 224
Joined: Wed May 07, 2008 4:57 am
Location: Adelaide, South Australia
Contact:

Re: Native Registry Support

Post by DeanH »

Thanks Marc56us. I was not aware of that command. I'll look into it.
User avatar
DeanH
Enthusiast
Enthusiast
Posts: 224
Joined: Wed May 07, 2008 4:57 am
Location: Adelaide, South Australia
Contact:

Re: Native Registry Support

Post by DeanH »

I am not sure assoc works for all file associations. I have associated the extension .bmd with Notepad. The Types program, shows this association. Assoc does not include this in its list. The command Assoc .bmd returns "File association not found for extension .bmd. Trying to disassociate it returns access denied.
Marc56us
Addict
Addict
Posts: 1479
Joined: Sat Feb 08, 2014 3:26 pm

Re: Native Registry Support

Post by Marc56us »

DeanH wrote:I am not sure assoc works for all file associations. I have associated the extension .bmd with Notepad. The Types program, shows this association. Assoc does not include this in its list. The command Assoc .bmd returns "File association not found for extension .bmd. Trying to disassociate it returns access denied.
Hi,

1. In all case, you need to do it in a shell (CMD) in admin mode
2. 'assoc' associate extension with file type not file name
3. If file type does not exist, you first need to create it (use ftype)

Code: Select all

Open CMD with admin rights
Win + R > Run > Ctrl+Shift+Enter

Go in directory where you can write (ie: temp)
	CD %temp%

Create a test file
	C:\[...]> echo Hello World > hi.bmd

Create a NEW file type
	C:\[...]> ftype bmdfile=%systemroot%\System32\notepad.exe %1

Verify
	C:\[...]> ftype bmdfile
	bmdfile=C:\WINDOWS\System32\notepad.exe %1
	
Associate extension to new file type	
	C:\[...]> assoc .bmd=bmdfile
	
Verify association
	C:\[...]> assoc .bmd
	.bmd=bmdfile

Test
	C:\[...]> hi.bmd

Yes, type filename with extension	
Notepad is launch with the file :-)

To remove
	C:\[...]> assoc .bmd=
	C:\[...]> ftype bmdfile=
:wink:
Post Reply