[SOLVED] Shared Roaming Folder is a Problem

Just starting out? Need help? Post your questions and find answers here.
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

[SOLVED] Shared Roaming Folder is a Problem

Post by Randy Walker »

I've installed PB versions 5.40, 5.62 and 6.20 and they all share the same path for the preference file which in turn causes them to all try to auto-load the same source files on program launch. Is there anything I can do to make them load from their own respective source folders I setup specifically to keep them from sharing source files? I'm really tired of source files getting corrupted from cross loads.
Last edited by Randy Walker on Mon Jun 09, 2025 10:14 pm, edited 1 time in total.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Quin
Addict
Addict
Posts: 1127
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Shared Roaming Folder is a Problem

Post by Quin »

Do they get corrupted because of the different compiler versions/options at the end of the file, or because its trying to reload them all?
If the former, try setting "Save settings to" to something other than the end of the current source file.
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Shared Roaming Folder is a Problem

Post by Randy Walker »

Quin wrote: Sun Jun 08, 2025 3:47 pm Do they get corrupted because of the different compiler versions/options at the end of the file, or because its trying to reload them all?
Because I'm not paying attention to the fact they are not loading from where I had them load in the previous session and get rewritten when I edit and compile/run them. I don't want those edits to go to my good source file working perfectly in 5.40.
If the former, try setting "Save settings to" to something other than the end of the current source file.
Afraid to try because I don't know the consequences of any of those options.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Shared Roaming Folder is a Problem

Post by #NULL »

linux help wrote:

Code: Select all

Options for launching the IDE: 
  -p or --preferences <file>    loads/saves all the configuration to/from the given file
Command-line options for the IDE:
https://www.purebasic.com/documentation ... dline.html
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Shared Roaming Folder is a Problem

Post by Randy Walker »

Now that you mention it, never looked down there before but there does seem to be some pref settings at the bottom of my 5.40 source file -- more corruption apparently. it says:
; IDE Options = PureBasic 6.20 (Windows - x64)
Which is totally bogus. My 5.40 installation is x86 and the other 2 are x64.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Shared Roaming Folder is a Problem

Post by Randy Walker »

#NULL wrote: Sun Jun 08, 2025 4:06 pm
linux help wrote:

Code: Select all

Options for launching the IDE: 
  -p or --preferences <file>    loads/saves all the configuration to/from the given file
Command-line options for the IDE:
https://www.purebasic.com/documentation ... dline.html
Thanks NULL. Was totally unaware of those switches. looks to me like this one should fix the problem but where/how to add the switch?:
/LOCAL puts all preferences in the PureBasic directory instead of the user profile location
It gives this as an example:
Example:
PureBasic.exe Example.pb /PORTABLE
So I guess I should have to do:
PureBasic.exe Example.pb /LOCAL
That would imply I cannot use the recent files pick list to load any files and need to create custom shortcuts to load any of my source files.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: Shared Roaming Folder is a Problem

Post by AZJIO »

Code: Select all

C:\PB\PureBasic\PureBasic_x64\PureBasic.exe /P "C:\PB\conf\PureBasic.prefs" /T "C:\PB\conf\Templates.prefs" /A "C:\PB\conf\Tools.prefs" /H "C:\PB\conf\History.db"
Randy Walker wrote: Sun Jun 08, 2025 4:09 pm ; IDE Options = PureBasic 6.20 (Windows - x64)
If a file is opened in this IDE and at least once saved or compilation is started, the data is overwritten. But it doesn't affect the result of compilation.
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Shared Roaming Folder is a Problem

Post by Randy Walker »

AZJIO wrote: Sun Jun 08, 2025 4:38 pm

Code: Select all

C:\PB\PureBasic\PureBasic_x64\PureBasic.exe /P "C:\PB\conf\PureBasic.prefs" /T "C:\PB\conf\Templates.prefs" /A "C:\PB\conf\Tools.prefs" /H "C:\PB\conf\History.db"
Hi AZJIO : Not quite sure what you're saying here. Looks like you created a configurations folder as C:\PB\Conf but don't understand your what looks like a command line. Is this something you execute from command line?
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: Shared Roaming Folder is a Problem

Post by AZJIO »

Randy Walker wrote: Sun Jun 08, 2025 5:25 pm Is this something you execute from command line?
This can be written in the registry or in a shortcut
Image
Last edited by AZJIO on Sun Jun 08, 2025 6:45 pm, edited 1 time in total.
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Shared Roaming Folder is a Problem

Post by Randy Walker »

AZJIO wrote: Sun Jun 08, 2025 5:46 pm
Randy Walker wrote: Sun Jun 08, 2025 5:25 pm Is this something you execute from command line?
This can be written in the registry or in a shortcut
Still confused.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: Shared Roaming Folder is a Problem

Post by AZJIO »

Registry. You can specify several versions in the registry and choose which version to run the pb file with.
Image
My File Extension Association program (ContMenuFiles)
Image
Shortcut (launch a specific version)
Image
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Shared Roaming Folder is a Problem

Post by Randy Walker »

AZJIO wrote: Sun Jun 08, 2025 6:53 pm Registry. You can specify several versions in the registry and choose which version to run the pb file with.
Those image links wont open due to some security issue with ibb.co.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
User avatar
spikey
Enthusiast
Enthusiast
Posts: 750
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: Shared Roaming Folder is a Problem

Post by spikey »

Randy Walker wrote: Sun Jun 08, 2025 6:38 pm Still confused.
Start menu items are shortcuts with properties which state how the loader should start the program.
They live in a sub-folder of "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\"
If you right click an icon in the start menu and choose "Open File Location" from the context menu, you'll open the shortcut's folder.
Then right click the shortcut file and choose "Properties" from the context menu. You'll open the shortcut's "Properties" dialog.
See https://windows.tips.net/T010869_Changi ... rties.html for a generic example, which hopefully you'll be able to see.
There is an entry called "Target" and this is the command line which will start the application when clicked in the Start menu.
You can modify this as required by adding switch options after the target exe name:
"C:\Program Files\PureBasic 620\PureBasic.exe" /P "<PathToYourPrefsForPurebasic620>\PureBasic.prefs"

However, be aware that the /LOCAL and /PORTABLE options won't work properly with the IDE installed as a subfolder in "C:\Program Files" or "C:\Program Files (x86)". These are protected folders and require elevation to modify as a malware protection. Which means you'll either get read only problems using the IDE or you'd always have to start it as admin, which isn't a best practice.

AZJIO gets around that by installing his copies of PureBasic inside a folder called "C:\PB" which can be modified by the IDE with /LOCAL and /PORTABLE.
(For the sake of completeness for posterity: I'd like to point out that this isn't a best practice from a security point of view either and shouldn't be replicated in a secure corporate environment).

If you want your PureBasic folders to stay in "C:\Program Files" you can use the /P and /T etc settings to relocate the specific configuration files somewhere else but leave the main folder alone.

You will probably want the /NOEXT option on all of your shortcuts so that they don't update the default file handler settings in the registry which can also cause files to not be opened in the way you expect them to.

I hope this helps!
Randy Walker
Addict
Addict
Posts: 989
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Shared Roaming Folder is a Problem

Post by Randy Walker »

spikey wrote: Mon Jun 09, 2025 1:53 pm
Randy Walker wrote: Sun Jun 08, 2025 6:38 pm Still confused.
Start menu items are shortcuts with properties which state how the loader should start the program.
They live in a sub-folder of "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\"
If you right click an icon in the start menu and choose "Open File Location" from the context menu, you'll open the shortcut's folder.
Then right click the shortcut file and choose "Properties" from the context menu. You'll open the shortcut's "Properties" dialog.
See https://windows.tips.net/T010869_Changi ... rties.html for a generic example, which hopefully you'll be able to see.
There is an entry called "Target" and this is the command line which will start the application when clicked in the Start menu.
You can modify this as required by adding switch options after the target exe name:
"C:\Program Files\PureBasic 620\PureBasic.exe" /P "<PathToYourPrefsForPurebasic620>\PureBasic.prefs"
YES!! spikey : That resolved the problem. Seems I don't need the /LOCAL switch at all, though it would probably be nice if it worked -- just seems to break history. Meanwhile I added a Conf folder to each of my source folders and copied the pref file to each respective folder:
D:\PureBasic\PB_prjct-540\Conf\PureBasic.prefs
D:\PureBasic\PB_prjct-562\Conf\PureBasic.prefs
D:\PureBasic\PB_prjct-620\Conf\PureBasic.prefs
I put the /P in front of each of those and appended to the shortcut target as you suggested.
Works great!! THANKS!!!!
And great big THANKS for the detailed explanation. ⭐⭐⭐⭐⭐
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
User avatar
spikey
Enthusiast
Enthusiast
Posts: 750
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: Shared Roaming Folder is a Problem

Post by spikey »

Randy Walker wrote: Mon Jun 09, 2025 10:13 pm Works great!! THANKS!!!!
You're welcome! :)
Randy Walker wrote: Mon Jun 09, 2025 10:13 pm ...just seems to break history.
Yes, it will for the same 'read only' problem I mentioned above. /LOCAL will only work if the files are writeable in the IDE's parent folder. This is not true when the IDE is installed to one of the "Program Files" folders.

You can resolve this by using the /H switch and specifying a unique path for each IDE version history file, for example:

Code: Select all

/H D:\PureBasic\PB_prjct-540\Conf\history.db
This will cause each IDE to create its own new empty history.db file in the Conf folders too. However, be aware that doing so will disconnect ALL the IDE's from the current history database content. It depends how reliant you are on the history content, if this is something you would want to do or not.
Post Reply