Hi folks,
It seems that we are getting ever so closer to 0.9. Slow, but steady. Looking at the TODO, it looks like upgrading is one of the big showstoppers, in that it will affect (1) the end-user experience, and (2) how we deal with the configuration.
So this seems like a good time to start discussing this topic, as we need to eventually reach the elusive 0.9. This seems to be a difficult topic, so we need to approach the problem well prepared. That is, we need to first define (and agree) on what we need to solve here. So after a tumultuous discussion on IRC, I decided to get the ball rolling.
Intuitively, upgrading wine is simple to understand: once a new version is installed, we need to get users in a state where they can use it. While simple to state, this problem is complicated by the various corner cases that can appear in Real Life (TM): -- native vs. builtin DLLs handling -- multiple Wine installations on a box -- updating only some DLLs -- integrating into the Unix environment -- dealing with Windows software
We can also look at some important use-cases that we need to support, but before we do, the following must hold true in all cases: -- administrators should be able to install a new Wine on the system easily with "rpm -U" (or equivalent). -- the upgrade should not erase registry settings that are managed by the user
Let's look at the use-cases:
A. Global Install In this case, both Wine code, as well as applications are installed globally, for all users to access. This is the most Unix-like setup, but unfortunately the most difficult to support, due to the fact that Win32 apps simply expect a different environment. Since we can't control application's code, this setup may present some limitations, but it may be sufficient for sites that need a limited set of applications. For this to work, it is acceptable that we ship special scripts that know about the applications that are supported, so that they can work around inherent limitations in the applications themselves. Users should transparently be able to use the new version of wine, the next time they start wine.
B. Mixed Install Here, Wine code is installed globally, but applications are installed in the user's account. In a way is like (A) but with some additional applications installed directly into the user's account. Same requirements apply to this case as well.
C. Local Install Both Wine code, as well as applications are installed locally, into the user's account. The Wine code is still installed globally by the administrator (as in A & B), but it is copied locally before it's being used. An upgrade in this case may require an explicit action by the user, so the upgrade can happen at a controlled time, when the user desires it.
In all of the above, there is always state in the user directory. Thus, it is imperative that the upgrade process makes sure that after the upgrade, the user-private state is consistent with the new code base. Also, any solution must take into account that the registry must be created on the fly, as it is created when registering the DLLs.
Before we go any further, I'd like to ask everybody to contribute their thoughts/requirements/desires so that we get a conprehensive view of the problem we are trying to solve.
Thanks for reading this far!
On Tue, 29 Jun 2004 02:33:15 -0400, Dimitrie O. Paun wrote:
Intuitively, upgrading wine is simple to understand: once a new version is installed, we need to get users in a state where they can use it. While simple to state, this problem is complicated by the various corner cases that can appear in Real Life (TM): -- native vs. builtin DLLs handling -- multiple Wine installations on a box -- updating only some DLLs -- integrating into the Unix environment -- dealing with Windows software
Short of copying the entire codebase into the users account when they explicitly choose to upgrade (ew, no other program does this) I can't see a good way of upgrading Wine while it's running that's free of race conditions. For instance, you could be in the middle of upgrading when a program you're running starts a new process: the wineserver may be using a different protocol to what the DLLs expect.
I really don't think for now we should try and support upgrades while running. It should probably be up to the packages/install scripts to alert the user if they try that.
We can also look at some important use-cases that we need to support, but before we do, the following must hold true in all cases: -- administrators should be able to install a new Wine on the system easily with "rpm -U" (or equivalent).
This is a use case we should definitely support but perhaps only in a special configuration where wine is a script which checks for a new version and copies it across next time it's started, or something like that.
B. Mixed Install
This is almost certainly the most common amongst our userbase today.
Here, Wine code is installed globally, but applications are installed in the user's account. In a way is like (A) but with some additional applications installed directly into the user's account. Same requirements apply to this case as well.
C. Local Install Both Wine code, as well as applications are installed locally, into the user's account. The Wine code is still installed globally by the administrator (as in A & B), but it is copied locally before it's being used. An upgrade in this case may require an explicit action by the user, so the upgrade can happen at a controlled time, when the user desires it.
In all of the above, there is always state in the user directory. Thus, it is imperative that the upgrade process makes sure that after the upgrade, the user-private state is consistent with the new code base. Also, any solution must take into account that the registry must be created on the fly, as it is created when registering the DLLs.
One possible solution here is a new wineserver request that switches the registry files in use, so to update the registry in a way that doesn't disturb currently running programs you can connect to a new wineserver instance (separate socket), switch registry files to "system.reg.new" or whatever, run wine.inf and then have another request which does an atomic rename of the registry files over the new ones once merged. This means the old wineserver instance is still using the old registry file inodes, but next time the Wine session is started up it'll be using the new registry.
thanks -mike
On Tue, Jun 29, 2004 at 11:49:12AM +0100, Mike Hearn wrote:
Short of copying the entire codebase into the users account when they explicitly choose to upgrade (ew, no other program does this) I can't see
I agree, I personally hate this too, but Alexandre has a point in that this may be the most compatible setup, so at least in theory we should be able to support it just in case we need to employ it later. However, I'm fairly sure we don't need to actually get a working version for it at this time, we just need to make sure we could, if we wanted to, without replacing the entire upgrade mechanism.
a good way of upgrading Wine while it's running that's free of race conditions. For instance, you could be in the middle of upgrading when a program you're running starts a new process: the wineserver may be using a different protocol to what the DLLs expect.
I really don't think for now we should try and support upgrades while running. It should probably be up to the packages/install scripts to alert the user if they try that.
Agreed. I think the most important thing is for Wine to integrate nicely with the system where it's running, so that rpm -U / yum update works as expected. If we go overboard with these sort of things, we may screw up the OS integration (remember, rpm -U must be able to run unattended for example), and this is a greater evil. Also, we have to be careful to not be more catholics than the Pope: I really doubt that any significant number of apps out there support 100% upgradability when they are running. In other words, an app that has more than one config/data file, would need to do locking to make sure that the data set that's spread around the files is treated atomically during upgrade. I personally think we can live with the race when we read in the registry files, but if that causes problems, we can add some locking so that we can read them in atomically. Maybe Alexandre can comment on this, he seems to have thought of this scenario already.
We can also look at some important use-cases that we need to support, but before we do, the following must hold true in all cases: -- administrators should be able to install a new Wine on the system easily with "rpm -U" (or equivalent).
This is a use case we should definitely support but perhaps only in a special configuration where wine is a script which checks for a new version and copies it across next time it's started, or something like that.
That will not work, we install as root, we run it as a regular user. Really, I see no difference between this and option (B) from the upgrade mechanism point of view, I think the challange here is to simply get the apps to run in this environment. We may need scripts that create fake directories with a bunch of symlinks, etc. but this is another matter.
In all of the above, there is always state in the user directory. Thus, it is imperative that the upgrade process makes sure that after the upgrade, the user-private state is consistent with the new code base. Also, any solution must take into account that the registry must be created on the fly, as it is created when registering the DLLs.
One possible solution here is a new wineserver request that switches the registry files in use, so to update the registry in a way that doesn't disturb currently running programs you can connect to a new wineserver instance (separate socket), switch registry files to "system.reg.new" or whatever, run wine.inf and then have another request which does an atomic rename of the registry files over the new ones once merged. This means the old wineserver instance is still using the old registry file inodes, but next time the Wine session is started up it'll be using the new registry.
Right, I was thinking along the same lines, but I'm not sure we can work with the same wineserver. For one, we will have one wineserver instance per user, running as the user, whereas for global install we need one that runs as root. But we do need to create these files at runtime, so we may need a special operation mode to achive it.
Le mar 29/06/2004 à 09:29, Dimitrie O. Paun a écrit :
On Tue, Jun 29, 2004 at 11:49:12AM +0100, Mike Hearn wrote:
Short of copying the entire codebase into the users account when they explicitly choose to upgrade (ew, no other program does this) I can't see
I agree, I personally hate this too, but Alexandre has a point in that this may be the most compatible setup, so at least in theory we should be able to support it just in case we need to employ it later. However, I'm fairly sure we don't need to actually get a working version for it at this time, we just need to make sure we could, if we wanted to, without replacing the entire upgrade mechanism.
Point2Play (Transgaming's Cedega frontend) does manage multiple Cedega versions for the following reason: less risks of running into regressions (you can specify which version to use for each application).
a good way of upgrading Wine while it's running that's free of race conditions. For instance, you could be in the middle of upgrading when a program you're running starts a new process: the wineserver may be using a different protocol to what the DLLs expect.
I really don't think for now we should try and support upgrades while running. It should probably be up to the packages/install scripts to alert the user if they try that.
Agreed. I think the most important thing is for Wine to integrate nicely with the system where it's running, so that rpm -U / yum update works as expected. If we go overboard with these sort of things, we may screw up the OS integration (remember, rpm -U must be able to run unattended for example), and this is a greater evil. Also, we have to be careful to not be more catholics than the Pope: I really doubt that any significant number of apps out there support 100% upgradability when they are running.
Numerous server packages do a shutdown as a preinstall step and a start as a postinstall. It's quite ok for stateless programs, but could be a bit rude for Wine users. Still, it's possible to fail the upgrade (via rpm) if wine is detected as running at installation time. There's always the chance of a race between the time the detection is made and actual upgrade though.
Vincent