The forum

Program Files behaviours

Author Replies
Aymeric P. Wednesday 14 October 2009 at 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

Edited by Salvatos


Former member.
NSLW Wednesday 14 October 2009 at 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.

Edited by NSLW

Aymeric P. Sunday 1 November 2009 at 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 Monday 2 November 2009 at 8:52
NSLW

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

Edited by NSLW

Quentin PÂRIS Sunday 28 February 2010 at 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