[mojosetup] Upgrade problems with MojoSetup

Francois Gouget fgouget at codeweavers.com
Wed Dec 15 11:40:00 EST 2010

Le 12/12/2010 23:05, Ryan C. Gordon a écrit :
>> Is the standard solution to force an uninstall of the old version before
>> installing the new one? If so shouldn't MojoSetup complain before
>> overwriting the old manifest?
> It's not something we've hit before (all the MojoSetup installs I know
> of are either single shot, or use the .xml manifest with loki_update).

I believe we used loki_update in the early days of Loki. However, iirc, 
that requires having a 'first time' installer and an 'upgrade installer' 
which is a usability issue (people don't know which one to get) and 
twice the number of installers to test.

> I think what you're describing (realizing there's an earlier version,
> and uninstalling it before installing the new one) is feasible, and
> probably not that hard. I'll take a look at doing this soon.

The problem I see with doing a regular uninstall (which I picture as 
transparently invoking 'mojosetup --uninstall' early in the process) is 
that it means losing the 'rollback' capability. In fact it means never 
doing upgrades.

I have identified three issues that I believe need fixing for smooth 
  * Correctly remove directories on uninstall after an upgrade, which 
means not losing track of them in the manifest on upgrades.
  * Remove obsolete files on upgrade; that is files installed by the 
previous version which are not present in the new one.
  * Not ask for permission to overwrite files installed by the previous 
version: this requires the user to either answer hundreds of questions 
or give a blanket Yes/No, both of which defeat the purpose of this 
question. The only files we should ask about are those we (including our 
previous incarnations) did not create. This can essentially be worked 
around by setting 'allowoverwrite = true' in config.lua, though it again 
defeats the purpose of this part of the code.

All three issues come about because we don't read the old manifest on 
upgrades so we don't know what we did before. Then it's a small matter 
of tweaking the code to take into account the extra knowledge this gains 
us (that's the part I'm wrestling with now).

The attached file contains the code I'm using to read the old manifest. 
I couldn't get load_manifest() to do my bidding so I rolled my own in 
pure Lua. I like it because it should be robust in the face of broken 
manifest files. But maybe there's a downside to that approach.

François Gouget
fgouget at codeweavers.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: load_oldpackage.lua
Type: text/x-lua
Size: 804 bytes
Desc: not available
URL: <http://icculus.org/pipermail/mojosetup/attachments/20101215/47427da5/attachment.bin>

More information about the mojosetup mailing list