Relative path in preference menu for all files "*.pref"

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5357
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Relative path in preference menu for all files "*.pref"

Post by Kwai chang caine »

Hello,

Is it possible a day, to adding a field in a propriety of the IDE, for put the path of the file PREF.

Often i have problem, the pref i use, is in the User/Data and i believe it's the pref of the /Portable, and i loose my pref when i change of machine :|
Because the /Portable is not also rigourous, when for example i dblClic on a PB file, the /Portable is not used and PB take the AppData pref. :cry:
And i can't use the AppData pref, because i never works on the same machine

With a relative path like "..\Preference\", i'm sure pref are always the same for all my PB version and i'm sure to can works with my removable DD without problem . 8)

Thanks
Last edited by Kwai chang caine on Fri Feb 21, 2014 8:36 pm, edited 5 times in total.
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5357
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Relative path in preference menu for all files "*.pref"

Post by Kwai chang caine »

+1 8)
One year after :mrgreen:
ImageThe happiness is a road...
Not a destination
User avatar
blueb
Addict
Addict
Posts: 1044
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: Relative path in preference menu for all files "*.pref"

Post by blueb »

Kwaï chang caïne,

Yes, I have lost my Prefs (and my Template files) in the past, so what I did was
create a procedure that locates the directory and copies it to my
PureBasic Folder.

e.g.

Code: Select all


If CopyDirectory("C:\Users\Bob\AppData\Roaming\PureBasic", "C:\PureBasic\Bobs Template Backup Folder",  
                         "", #PB_FileSystem_Recursive|#PB_FileSystem_Force)

     Debug "Success! You now have a copy of your template files!"

Else
     
     Debug "+++++++++++++++++++++++++++"
     Debug " Something went wrong! Please try again!"
     Debug "+++++++++++++++++++++++++++"

EndIf



Here's a picture: https://www.dropbox.com/s/nf3nkhq4hgco6h3/MyPrefs.png
- It was too lonely at the top.

System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Relative path in preference menu for all files "*.pref"

Post by ts-soft »

@Kwaï chang caïne
A property for preferences path make no sense. How should pb read this property before found the preferences :wink:

make always a backup like blueb suggest.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5357
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Relative path in preference menu for all files "*.pref"

Post by Kwai chang caine »

I'm not alone to have thos poblem :|
It's really a big problem when you have create several template without restart the ide
Now each time i create a template i restart the ide for be sure
Thanks Blueb for your tips 8)

@tsSoft
You have right :shock:
I have not thinking to that :lol:

In fact before with the old versions,the pref is in the source folder by default.
I don't know what idea pass in the head of FRED for change a team who win :|
Id it not strange to force a portable program to write in the pc ???
The better idea will be not change the old behaviour, and add /NoPortable option for some person, at my advice not the majority, who want writing in the roaming...
ImageThe happiness is a road...
Not a destination
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Relative path in preference menu for all files "*.pref"

Post by ts-soft »

Kwaï chang caïne wrote:The better idea will be not change the old behaviour, and add /NoPortable option for some person, at my advice not the majority, who want writing in the roaming...
Image
The old behaviour shouldn't work on actual OS with some security. The actual behaviour is right one!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: Relative path in preference menu for all files "*.pref"

Post by rsts »

Kwaï chang caïne wrote:The better idea will be not change the old behaviour, and add /NoPortable option for some person, at my advice not the majority, who want writing in the roaming...
-1

btw - I'm interested in knowing how you determined this so-called "majority" of yours? :wink:
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5357
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Relative path in preference menu for all files "*.pref"

Post by Kwai chang caine »

The old behaviour shouldn't work on actual OS with some security. The actual behaviour is right one!
I don't understand why it's a security problem ?
Perhaps when there are several users ???
And it's not an obligation to instal PB in ProgramFile if it's that the problem ....
Rsts wrote:btw - I'm interested in knowing how you determined this so-called "majority" of yours?
i have say "at my advice" :wink:
I thought the portable advantage is one off the power of PB !! :shock:
It is not an adavantage ???
When you see all VStudio with the BDR inscription :?
Perhaps i'm wrong, for be sure just a survey can say this point...but it's not really important.

What i know, it's not normal that sometime, we can loose preference in one clic, then PB can, and be able to run portable mode :|
Before never this problem exist, after perhaps a problem of security is fixed, but replaced by another :(
ImageThe happiness is a road...
Not a destination
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Relative path in preference menu for all files "*.pref"

Post by ts-soft »

Most Users, over 95% uses the normal security of windows. PB-IDE can't write in ProgramFiles, no permission for this.
After this change have 95% of all PB-Users a problem. In the moment have max. 5%, but i think only you, a problem :mrgreen:

Portable is only for using on a stick, but never on a desktop-machine!
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Relative path in preference menu for all files "*.pref"

Post by Thunder93 »

I've always copied the shortcut with the commandline set. Therefore If I ever want to work with PB on one of my other machines as a temporary bases, no problem.
Copy PB from media disk to Windows desktop, all I do then is simply update the shortcut target path.

For my needs, the one thing that I would like to see improved on in regards to PB Portable support.. is if I'm running off a removal media disk, PB should be with an option to detect if running off of media disk and automatically launch in Portable mode. Launching PB in Portable mode off of memory stick, thumb drive, or external hard drive .. isn't without effort.


With PB running automatically in PB Portable mode, the PB IDE titlebar be with;

PureBasic ?.?? LTS (x??) [Portable mode] ... feEl thE rEal P0wer of Portable Power!!! :mrgreen:
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5357
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Relative path in preference menu for all files "*.pref"

Post by Kwai chang caine »

Portable is only for using on a stick, but never on a desktop-machine
I use PB nearly always on a external DD, never on the desktop.
For that, i use the /portable
But sometime, i dblClic on a PB file or other manipulation, in fact i don't know always what's happened, and i'm not warned that i use the roaming pref
I just see that, the next day, when i see, i have loose all modifications of the previous day :|
I think it's when even annoying..

The pref is when even a very important files, find other idea to protect them, (Like Thunder93 idea for exampler) at my advice is not a light subject :?
So if you think the contrary, it's your right :shock:
It's also possible to test if you have the right to write, if not, writing in roaming, if yes in the root forder, or why not on the two place in the same time ...
Several idea can be used, perhaps also, some users have the problem and say nothing..
ImageThe happiness is a road...
Not a destination
Post Reply