Individual Wineprefixes

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
c_andy_man
Level 2
Level 2
Posts: 16
Joined: Wed May 20, 2009 8:17 am

Individual Wineprefixes

Post by c_andy_man »

Hello,

I am looking for a way to create an individual wine rpm of the actual src.rpm. My goal is a new winepfrefix, that is created when a user is logging in, that contains additional win-programs. But I did not find the path in the wine...tar.gz file, where the wineprefix is located. can someone help me?
Is this even possible? Because that would be an easy way to supply a programm for all users individually.
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

A WINEPREFIX itself is a different '.wine' directory and you create a new prefix by setting the WINEPREFIX environment variable. E.g. WINEPREFIX=.wine-notepad wine notepad would create a new prefix /home/user/.wine-notepad for notepad.

It would also be possible to have multiple wine installations but for that you need to play with other environment variables like WINEDLLPATH, WINELOADER and WINESERVER next to things like PATH.
c_andy_man
Level 2
Level 2
Posts: 16
Joined: Wed May 20, 2009 8:17 am

Post by c_andy_man »

I know that wine creates a prefix for every user as son as he executes "wine bla.exe". That is $HOME/.wine. But right now i start this prefix with a wine executable, that is in an individual path and a wineprefix, that is in an individual path. That works quite okay. But as with a standard wineinstallation and wineprefix. where you can installe windows-software on Userbasis, i want wine to create a prefix, that has already software installed.
My actual workaround is that i take one wineprefix i created and overwrite the users wineprefix as soon as he executes a start-script. I think think this is not very elegant.
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Individual Wineprefixes

Post by austin987 »

On Tue, Jun 23, 2009 at 8:05 AM, c_andy_man<[email protected]> wrote:
I know that wine creates a prefix for every user as son as he executes "wine bla.exe". That is $HOME/.wine. But right now i start this prefix with a wine executable, that is in an individual path and a wineprefix, that is in an individual path. That works quite okay. But as with a standard wineinstallation and wineprefix. where you can installe windows-software on Userbasis, i want wine to create a prefix, that has already software installed.
My actual workaround is that i take one wineprefix i created and overwrite the users wineprefix as soon as he executes a start-script. I think think this is not very elegant.
You can use 'wineboot' to create a prefix without installing software.
The wineprefix changes relatively often, as new dlls are added.
However, with any non-ancient wine version, the prefix is
automatically updated if run by a new wine version, so that shouldn't
be too big of an issue.

--
-Austin
c_andy_man
Level 2
Level 2
Posts: 16
Joined: Wed May 20, 2009 8:17 am

Post by c_andy_man »

The problem is, that the wineprefix has to be a certain one with installed programs. When another user logs in, a new wineprefix /home/user/.wine is created. But this wineprefix is pristine, and does not contain the installed Windows programms.
That is why i tried the way of overwriting the users wineprefix with the individual wineprefix (That I store in /opt/samplewineprefix/)
James Huk

Individual Wineprefixes

Post by James Huk »

2009/6/24 c_andy_man <[email protected]>
The problem is, that the wineprefix has to be a certain one with installed
programs. When another user logs in, a new wineprefix /home/user/.wine is
created. But this wineprefix is pristine, and does not contain the installed
Windows programms.
That is why i tried the way of overwriting the users wineprefix with the
individual wineprefix (That I store in /opt/samplewineprefix/)





I think you should be able to write some sort of script that will check if
.wine prefix for current user exists, and if not it will simply overrite it
with your custom prefix stored somewhere... but how to write such script I
have no Iidea - hoefully someone with more scripting experiance can help
you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-us ... chment.htm>
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Individual Wineprefixes

Post by austin987 »

On Wed, Jun 24, 2009 at 6:06 AM, James Huk<[email protected]> wrote:
2009/6/24 c_andy_man <[email protected]>
The problem is, that the wineprefix has to be a certain one with installed
programs. When another user logs in, a new wineprefix /home/user/.wine is
created. But this wineprefix is pristine, and does not contain the installed
Windows programms.
That is why i tried the way of overwriting the users wineprefix with the
individual wineprefix (That I store in /opt/samplewineprefix/)




I think you should be able to write some sort of script that will check if
.wine prefix for current user exists, and if not it will simply overrite it
with your custom prefix stored somewhere... but how to write such script I
have no Iidea - hoefully someone with more scripting experiance can help
you.
Please avoid html messages on wine mailing lists, it's stripped out anyway.

A script like that would be really easy, something like
#!/bin/sh
if [ -d $HOME/.wine ]
then
echo ".wine already exists"
else
cp -r /opt/samplewineprefix/ $HOME/.wine
chown -R `whoami` $HOME/.wine
fi
exit 0

--
-Austin
Gert van den Berg

Individual Wineprefixes

Post by Gert van den Berg »

On Wed, Jun 24, 2009 at 17:01, Austin English wrote:
A script like that would be really easy, something like
#!/bin/sh
if [ -d $HOME/.wine ]
then
   echo ".wine already exists"
else
   cp -r /opt/samplewineprefix/ $HOME/.wine
   chown -R `whoami` $HOME/.wine
fi
exit 0
(I know it is only a sample that was not tested, but anyway...)

If the user do not own the files, the chown would fail. The copy
should set the ownership (because the user is probably unable to
create files owned by another user)

tar or cp --no-preserve=ownership might if the ownership information
do survive the copy....

if the chown does work `whoami` can be replaced with `id -un`:`id -gn`
to change the group as well.

Gert
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Individual Wineprefixes

Post by austin987 »

On Wed, Jun 24, 2009 at 1:10 PM, Gert van den Berg<[email protected]> wrote:
On Wed, Jun 24, 2009 at 17:01, Austin English wrote:
A script like that would be really easy, something like
#!/bin/sh
if [ -d $HOME/.wine ]
then
   echo ".wine already exists"
else
   cp -r /opt/samplewineprefix/ $HOME/.wine
   chown -R `whoami` $HOME/.wine
fi
exit 0
(I know it is only a sample that was not tested, but anyway...)

If the user do not own the files, the chown would fail. The copy
should set the ownership (because the user is probably unable to
create files owned by another user)

tar or cp --no-preserve=ownership might if the ownership information
do survive the copy....

if the chown does work `whoami` can be replaced with `id -un`:`id -gn`
to change the group as well.
To list as well:

Of course, good call.

--
-Austin
Locked