Forums

Program Files behaviours

Auteur Réponses
Aymeric P. Mercredi 14 Octobre 2009 à 8:07
Aymeric P.

After some discussion between scriptors, I decided to post this to explain how to use the right Program Files directory.
Indeed the directory name depends on the system's locale.

So if you want to be sure that you're using the right path in your script, you need to know exactly which path Wine uses.

You can use this code
#fetching PROGRAMFILES environmental variable (by NSLW)
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}


But don't read the program files name for the default Wine prefix!

What I mean is that if the default Wine prefix was created with an old release of Wine, you can't be sure that the current Wine release uses the same behavior for their prefix.
And it is possible that there is no default prefix (a user that never runs something directly with Wine, but always through a tool like PoL).

So use this code:
select_prefix "$REPERTOIRE/wineprefix/$Prefix"
POL_SetupWindow_prefixcreate
#fetching PROGRAMFILES environmental variable (by NSLW)
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}


With this you use the Program Files directory created by Wine.


But if you want to force Program Files to be "Program Files", you need to use (it's not recommended behavior):
select_prefix "$REPERTOIRE/wineprefix/$Prefix"
POL_SetupWindow_specialprefixcreate


or (I think, no time to test and be sure), you can do this:
select_prefix "$REPERTOIRE/wineprefix/$Prefix"
POL_SetupWindow_prefixcreate
set_programfile_dir
wineboot

Edité par Salvatos


Former member.
NSLW Mercredi 14 Octobre 2009 à 10:20
NSLW

With this one you use the Program Files directory created by wine. But if you want to force the Program Files to be Program Files you need to use

select_prefix "$REPERTOIRE/wineprefix/$Prefix"
POL_SetupWindow_specialprefixcreate

Quote from MulX

I don't get it. Why would anyone like to force Program Files to be Program Files and not e.g Archivos de programa? I think it may be confusing for not advanced user to get accustomed to Program Files if all the time he used Archivos de programa in MS Windows.

BTW. Good that you clarified that and made other scriptors aware of that.

Edité par NSLW

Aymeric P. Dimanche 1 Novembre 2009 à 23:11
Aymeric P.

Indeed using Program Files instead of Archivos de programa can confuse some basic user but if a day you need to force Program Files to be Program Files you can ^^.


As a say and explain in the first post: don't read the program files name for the default Wine prefix !!!
I don't have the time to check all script, so correct your own script, or report the script !

Former member.
NSLW Lundi 2 Novembre 2009 à 8:52
NSLW

Ok. I will be correcting this but it'll take some time.

Edité par NSLW

Quentin PÂRIS Dimanche 28 Février 2010 à 11:31
Quentin PÂRISAnonymous

Updated : Please use

PROGRAMFILES="Program Files" 
POL_LoadVar_PROGRAMFILES

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com