Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
97 user(s) are online (81 user(s) are browsing Forums)

Members: 0
Guests: 97

more...

Support us!

Headlines






prefs files which works everywhere
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6376
Have some probably dumb question:

Let's say i have "System" partition. And have some apps which use images/fonts/etc from my system partition. So, when i choice from those apps full path to data files, in prefs files it saves then as "System:path_to_data_files". And , if i will just copy that prefs file to another machine , where is not System: partition, but name is different, then "System:path" from prefs will fail.

Question is: how i can fast deal with it, and have SYS: instead of System:.

Only one way about which i know now, is that i should manually re-save all patches again, just manually delete "system:" and type "sys:" when do choice.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: prefs files which works everywhere
Quite a regular
Joined:
2007/2/6 13:57
From Donostia (SPAIN)
Posts: 552
Prefs file is in IFF-PREFS format or just plain text?
IFF-PREFS: maybe create a tool to convert from System:abc to SYS:abc

'Assign System: SYS:'?

   Report Go to top

Re: prefs files which works everywhere
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6376
@javier
Quote:

Prefs file is in IFF-PREFS format or just plain text?


IFF-PREFS ones, (those usual system's prefs file like done from Prefs:Font, etc).

Quote:

'Assign System: SYS:'?


You mean force users to do such assign ? That no way of course. Need something which can very fast and easy just deal with system-kind preference files and put instead of system: sys: everywhere, so when i will upload it, it will works for everyone, not only for those who have system partition called as System:

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: prefs files which works everywhere
Quite a regular
Joined:
2007/2/6 13:57
From Donostia (SPAIN)
Posts: 552
Is it a very large/big .prefs file?
Maybe the converter tool/hack could be nice. I have here a input/locale/wbpattern .prefs reading source code (from amigaos4 wiki)

   Report Go to top

Re: prefs files which works everywhere
Home away from home
Joined:
2006/12/4 23:15
Posts: 2180
@kas1e

The solultion is simple, you *never* overwrite someones prefs file in a installer. Rather you allow them load that prefs file from the preferences program. They can then save it as default if needed. That way the path is right whatever system.

Always save image paths etc with sys: (ie do it right to start with then it doesn't need fixing)

If your making a theme the first rule is overridden but you should only copt to ENV: till confirmed by the users.





_________________
Blender For OS4.x : Blues : Walker Broad
   Report Go to top

Re: prefs files which works everywhere
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6376
@javier
Quote:

Is it a very large/big .prefs file?


Yep, that mui prefs which i done for year or two. Dig in now into every part of it and check where i do use images from some system path are pain and i not sure if i want to spend time on it :)

Quote:

Maybe the converter tool/hack could be nice.


If you can make one which will just replace all the "system:" in the prefs file to "sys:" with all shifts and co, and prefs will works: that can be pretty helpfull.

@Andy
Quote:

The solultion is simple, you *never* overwrite someones prefs file in a installer.


I never use any installers, and i not want to overwrite anything: I have my mui skin which is just prefs file (big one), which is handle all necessary stuff, and where i open from system partition bunch of images of all kind in all kind of different places, and they all saves as "System:" , because my system partition are "System:", while, i need "Sys:" there, so it will works for every user , as Sys: assign presented always.

Quote:

Always save image paths etc with sys: (ie do it right to start with then it doesn't need fixing)


Now its easy to say, right :) But problem is that everything already done like it done already. General advice are ok, but problem still here. I just save all patches by asl-requester and choice "system:" year back, now not want to change all manually, as there hundred of places


Quote:

If your making a theme the first rule is overridden but you should only copt to ENV: till confirmed by the users.


Nope, that not theme, its just some mui skin, which images i can't upload as they copyrighted on morphos, all i can upload its my own prefs file with text to point out where download and where to put images. That prefs file done for last years from "System:Mui/Images/balblabla", which should be "Sys:Mui/Images/blablabl" to make it works for all users (and yep, those images should be exactly there, not in env: or whatever).

In other words, all those general advises are ok, and sure they all right, just problem is that i have prefs file already, and do not want to recheck all those hundreds places where images uses from system:mui/balbal, just want to swap all fast on sys:mui/balbal and upload it.

Maybe there is ready to use some prefs-file apps which can do so ? (like load/change/save)

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: prefs files which works everywhere
Not too shy to talk
Joined:
2006/11/27 22:28
From Germany
Posts: 303
@kas1e

it you want to point to the mui directory use the mui: assign. and not sys:mui.

but it seems that mui always uses the formatted name instead of the assigned or device one. strange! and imho a bug.

regards...
michael

_________________
Michael Merkel
(Michael.Merkel@gmx.net Home)
Member of Amiga-Freunde Pfalz, OS4 Welt
   Report Go to top

Re: prefs files which works everywhere
Just can't stay away
Joined:
2009/2/9 19:32
From Brussels Belgium
Posts: 1121
@kas1e



I would start using rep from http://aminet.net/package/util/cli/rep and see if the result does what you want.
I guess in a binary file problems may occur after that.because you replace a string with a shorter one.

Second method then
You could extract all the needed full paths (strings beginning with system: - i guess 'strings' can be used)

system:myfullpath then has to be replaced with "sys:myfullpath "
adding 3 blanks at the replacing fullpath

you could make a script 'rep'ing al these fullpathis in sequence
rep prefsfile system:myfullpath1 "sys:myfullpath "

   Report Go to top

Re: prefs files which works everywhere
Home away from home
Joined:
2006/12/4 23:15
Posts: 2180
Quote:

I have my mui skin which is just prefs file (big one), which is handle all necessary stuff, and where i open from system partition bunch of images of all kind in all kind of different places, and they all saves as "System:" , because my system partition are "System:", while, i need "Sys:" there, so it will works for every user , as Sys: assign presented always.


Well checking MUI: most of the images are contained in MUI:Images

So you just need to unpack the gadget images there in a directory and they becomae available in the MUI4 prefs program.

Then there just a "few" background images.

Ultimately though the only safe way to do this is bite the bullet and move all the images to MUI:Images/kas1e (for example) and rebuild your MUI theme.

There are some IFF file editors on aminet, but you'd likely end up taking as much time to use them as the actual MUI prefs editor.

Solutions based on hacking / search and replacing in the binary file are likely to end up with a malformed IFF header (wrong sized chunks etc). Admittedly your reduceing the string length so you *could* pad with zeros.









_________________
Blender For OS4.x : Blues : Walker Broad
   Report Go to top

Re: prefs files which works everywhere
Just can't stay away
Joined:
2006/11/24 18:52
From Gloucestershire, UK.
Posts: 1172
@MichaelMerkel

Quote:
but it seems that mui always uses the formatted name instead of the assigned or device one. strange! and imho a bug.


That's the same as the original behaviour of IPrefs before I filed an enhancement request many years ago. the early versions would automatically expand the device name to the volume name.



_________________
Amiga user since 1985
AOS4, A-EON, IBrowse & Alinea Betatester

Ps. I hate the new amigans website. <shudder>
   Report Go to top

Re: prefs files which works everywhere
Home away from home
Joined:
2007/5/19 14:23
From England
Posts: 3553
@Kas1e
Maybe this is something which needs to be "fixed" in MUI? (Although the maintainer of MUI may disagree that it is a bug, and rather claim that it is a feature, for certain reasons.)

_________________
Author of the PortablE programming language.
I love using Amiga OS4.1
It is pitch black. You are likely to be eaten by a grue...
   Report Go to top





[Advanced Search]



Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project