Generating a properly configured Wine installation

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Benjamin M. Schwartz

Generating a properly configured Wine installation

Post by Benjamin M. Schwartz »

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear Wine users,

I am attempting to run Wine inside Sugar, the OLPC GUI environment. I
have managed to learn how to run wine from a nonstandard install prefix.
I am now trying to generate a correctly customized .wine/ automatically.
For example, I wish to set the DPI to 160 before any programs are run. I
also wish to set the USERPROFILE setting to something not based on the
UNIX username.

How can I perform automated customization of .wine before launching
anything in Wine? Where are the settings for DPI and USERPROFILE stored?

Thank you,
Ben
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/jTAUJT6e6HFtqQRAqZJAJ4hz8LFsrFjPdXxZL3GmIFct9UPEQCfZvbv
vLHu9IIdcMfX1OYLn4LBWKE=
=lmEJ
-----END PGP SIGNATURE-----
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Generating a properly configured Wine installation

Post by austin987 »

On Thu, Apr 10, 2008 at 10:39 AM, Benjamin M. Schwartz
<[email protected]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear Wine users,

I am attempting to run Wine inside Sugar, the OLPC GUI environment. I
have managed to learn how to run wine from a nonstandard install prefix.
I am now trying to generate a correctly customized .wine/ automatically.
For example, I wish to set the DPI to 160 before any programs are run. I
also wish to set the USERPROFILE setting to something not based on the
UNIX username.

How can I perform automated customization of .wine before launching
anything in Wine? Where are the settings for DPI and USERPROFILE stored?

Thank you,
Ben
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/jTAUJT6e6HFtqQRAqZJAJ4hz8LFsrFjPdXxZL3GmIFct9UPEQCfZvbv
vLHu9IIdcMfX1OYLn4LBWKE=
=lmEJ
-----END PGP SIGNATURE-----

You'd have to custom compile wine and edit those settings in
tools/wine.inf before compiling.
Benjamin M. Schwartz

Generating a properly configured Wine installation

Post by Benjamin M. Schwartz »

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Austin English wrote:
| You'd have to custom compile wine and edit those settings in
| tools/wine.inf before compiling.

This can't be true. For example, as a matter of brute force, I could
start a copy of Wine, generate the .wine/, use winecfg to modify it, and
then carry that .wine/ around for future reference. Before starting
applications, I could just copy the entire contents of my customized
.wine/ into WINEPREFIX. This, however, is very ugly, because I'm moving
megabytes of junk around because I don't know where the settings are
stored. Where are the settings stored?

- --Ben

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/jh9UJT6e6HFtqQRAof5AJoD5AtuaHOzsWGf03dBtBXDALnTVACfQ6Kf
0x4+/ofRSsahH369ieFecYc=
=kRJ9
-----END PGP SIGNATURE-----
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Generating a properly configured Wine installation

Post by austin987 »

On Thu, Apr 10, 2008 at 10:55 AM, Benjamin M. Schwartz
<[email protected]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Austin English wrote:
| You'd have to custom compile wine and edit those settings in
| tools/wine.inf before compiling.

This can't be true. For example, as a matter of brute force, I could
start a copy of Wine, generate the .wine/, use winecfg to modify it, and
then carry that .wine/ around for future reference. Before starting
applications, I could just copy the entire contents of my customized
.wine/ into WINEPREFIX. This, however, is very ugly, because I'm moving
megabytes of junk around because I don't know where the settings are
stored. Where are the settings stored?

- --Ben


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/jh9UJT6e6HFtqQRAof5AJoD5AtuaHOzsWGf03dBtBXDALnTVACfQ6Kf
0x4+/ofRSsahH369ieFecYc=
=kRJ9
-----END PGP SIGNATURE-----
You could run wineprefixcreate, then use a shell script to edit
~/.wine/user.reg & ~/.wine/system.reg. Actually, correct my mistake
earlier. It seems you can edit /usr/share/wine/wine.inf as well (I
haven't tested this though).
Benjamin M. Schwartz

Generating a properly configured Wine installation

Post by Benjamin M. Schwartz »

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Austin English wrote:
| You could run wineprefixcreate, then use a shell script to edit
| ~/.wine/user.reg & ~/.wine/system.reg.

I have been storing "good" copies of these two files, and using a shell
script to copy them into the appropriate location. Unfortunately, this
does not seem to have the desired effect. For example, if I

use winecfg to set the DPI to 160,
exit wine,
back up user.reg and system.reg,
run wineprefixcreate,
copy user.reg and system.reg back into ~/.wine/,
and start a new program,

the new program starts at 96 DPI again.

Clearly I am doing something wrong. Could this be related to the
USERPROFILE setting?

I am also surprised that there is no Ntuser.dat.

- --Ben
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/kHKUJT6e6HFtqQRAokzAJ9SXSSXUfe0Cy8X+8CUTab8r6zSbQCfc53/
5ytkJz72la8AcrYvKBlrtJk=
=4gZl
-----END PGP SIGNATURE-----
Dan Kegel

Generating a properly configured Wine installation

Post by Dan Kegel »

On Thu, Apr 10, 2008 at 9:35 AM, Benjamin M. Schwartz
<[email protected]> wrote:
Austin English wrote:
| You could run wineprefixcreate, then use a shell script to edit
| ~/.wine/user.reg & ~/.wine/system.reg.

I have been storing "good" copies of these two files, and using a shell
script to copy them into the appropriate location. Unfortunately, this
does not seem to have the desired effect. For example, if I

use winecfg to set the DPI to 160,
exit wine,
back up user.reg and system.reg,
run wineprefixcreate,
copy user.reg and system.reg back into ~/.wine/,
and start a new program,

the new program starts at 96 DPI again.

Clearly I am doing something wrong.
Two suggestions.
1. If you must modify user.reg and system.reg by hand, make sure
that wineserver has shut down first, e.g. wineserver -w.
2. Rather than modifying those files by hand, use regedit to do it.
See http://kegel.com/wine/winetricks for an example of how to script this.
- Dan
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Generating a properly configured Wine installation

Post by austin987 »

On Thu, Apr 10, 2008 at 11:35 AM, Benjamin M. Schwartz
<[email protected]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Austin English wrote:
| You could run wineprefixcreate, then use a shell script to edit
| ~/.wine/user.reg & ~/.wine/system.reg.

I have been storing "good" copies of these two files, and using a shell
script to copy them into the appropriate location. Unfortunately, this
does not seem to have the desired effect. For example, if I

use winecfg to set the DPI to 160,
exit wine,
back up user.reg and system.reg,
run wineprefixcreate,
copy user.reg and system.reg back into ~/.wine/,
and start a new program,

the new program starts at 96 DPI again.

Clearly I am doing something wrong. Could this be related to the
USERPROFILE setting?

I am also surprised that there is no Ntuser.dat.


- --Ben
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/kHKUJT6e6HFtqQRAokzAJ9SXSSXUfe0Cy8X+8CUTab8r6zSbQCfc53/
5ytkJz72la8AcrYvKBlrtJk=
=4gZl
-----END PGP SIGNATURE-----
Try editing /usr/share/wine/wine.inf (may be different for your
distribution). I just tested with a few settings, and new wine
prefixes made take that as the default.
Benjamin M. Schwartz

Generating a properly configured Wine installation

Post by Benjamin M. Schwartz »

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Austin English wrote:
| Try editing /usr/share/wine/wine.inf (may be different for your
| distribution). I just tested with a few settings, and new wine
| prefixes made take that as the default.

The fundamental problem appears to be related to USERPROFILE.

My package of Wine will be run as many different users, and it is
important that it work identically regardless of the UNIX uid of the user
running it. I therefore used regedit to change USERPROFILE and all the
other related registry keys to point to a profile
(C:\windows\profiles\olpc) that is not consistent with the current UNIX login.

It appears that when wine starts it detects this discrepancy and favors
the UNIX username. In the process, it also appears to be discarding my
settings for things like DPI. In a simplified test case where I know the
username in advance and set the registry's profile directories to be
consistent with the UNIX username, the settings are preserved.

What is the proper way to run Wine with a Windows username that is
unrelated to the UNIX username?

- --Ben
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/lBTUJT6e6HFtqQRAh8DAJ9/zL7yev4H2vclIAKNuFqwf+37DACfQIRM
FH7vfb2t9xxAz0Q9iXcG6SI=
=LTEd
-----END PGP SIGNATURE-----
Dan Kegel

Generating a properly configured Wine installation

Post by Dan Kegel »

On Thu, Apr 10, 2008 at 10:37 AM, Benjamin M. Schwartz
<[email protected]> wrote:
My package of Wine will be run as many different users, and it is
important that it work identically regardless of the UNIX uid of the user
running it. I therefore used regedit to change USERPROFILE and all the
other related registry keys to point to a profile
(C:\windows\profiles\olpc) that is not consistent with the current UNIX
login.
Aha. Why do you have to do this, exactly? Are you trying to
set up a read-only profile? Have you tried copying settings
into the user's normal profiles instead?
- Dan
Benjamin M. Schwartz

Generating a properly configured Wine installation

Post by Benjamin M. Schwartz »

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dan Kegel wrote:
| On Thu, Apr 10, 2008 at 10:37 AM, Benjamin M. Schwartz
| <[email protected]> wrote:
|> My package of Wine will be run as many different users, and it is
|> important that it work identically regardless of the UNIX uid of the user
|> running it. I therefore used regedit to change USERPROFILE and all the
|> other related registry keys to point to a profile
|> (C:\windows\profiles\olpc) that is not consistent with the current UNIX
|> login.
|
| Aha. Why do you have to do this, exactly?

The Rainbow/Bitfrost security system for OLPC works by generating a new
UNIX uid for each application, and running each application under its own
uid. Thus, prior to running this application for the first time, I do not
know what the username will be. Since I'm trying to customize things
ahead of time, I need to do the customizations in a way that does not
depend on the unix uid. The only way I knew to do this is to fix the
Windows username ahead of time.

Also, the username _is_ the uid, a random number like "10015", which I was
hoping to keep out of the UI.

| Are you trying to
| set up a read-only profile?

Not exactly. I am trying to create a base profile, which will then be
copied and modified by the user.

| Have you tried copying settings
| into the user's normal profiles instead?

There is no pre-existing user profile. However, I could run
wineprefixcreate, and then modify the resulting profile. I do not know
how to do this, but perhaps by reading your scripts I can figure it out.

This method still leaves the user with a Windows login of "10015", but
that's better than having unreadable small fonts.

- --Ben

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/lM+UJT6e6HFtqQRAsPkAJ9CoeGjCt/eyKPI0Lk053KxZ+xS9ACdGqWl
a3ejrzwGgm4gDgaWNwS+CaQ=
=yiJp
-----END PGP SIGNATURE-----
Dan Kegel

Generating a properly configured Wine installation

Post by Dan Kegel »

On Thu, Apr 10, 2008 at 10:49 AM, Benjamin M. Schwartz
<[email protected]> wrote:
The Rainbow/Bitfrost security system for OLPC works by generating a new
UNIX uid for each application, and running each application under its own
uid.
Aha! I see, you're trying to subvert that feature of their security system.
that's better than having unreadable small fonts.
Please try editing wine.inf instead. That is where all the default
settings come from. I think this is the quickest and safest way
to fix the font size problem.
- Dan
Benjamin M. Schwartz

Generating a properly configured Wine installation

Post by Benjamin M. Schwartz »

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dan Kegel wrote:
| Please try editing wine.inf instead. That is where all the default
| settings come from. I think this is the quickest and safest way
| to fix the font size problem.

This worked. Thank you.

However, I would also like to set the Console font size. This font size
seems to be stored in user.reg. I tried replacing user.reg with a
modified one, but this somehow has no effect. I tried including the
relevant entries from user.reg in /usr/share/wine/wine.inf. This also had
no effect.

How can I increase the Console font size before first "boot"?

Also, the command I use is

wine explorer /desktop=default,1200x900 wineconsole cmd &

The first time this command is run, wineconsole runs as an X window, and
the explorer fake-desktop is not launched at all. If I simply exit
wineconsole and run the command again, it works as expected, with
wineconsole inside a desktop window. How can I make it launch inside an
explorer window on the first run?

- --Ben
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH/pVxUJT6e6HFtqQRAre3AJsGDMoIuFTXxTznSGh5BDYkfO6ZCwCfZoGm
Tk7Y2oFW3wdFE81EgmY/G40=
=Mrtf
-----END PGP SIGNATURE-----
Locked