Wine came to mind and now I can't get it out; after some thinking a few things make sense:
- each game can have its own wineprefix in unionfs
- wineprefixes should be winearch 32 to a) save disk space and b) prevent problems with multilib
- the wineprefix is created at runtime via the launcher script simply by calling the game; it will be created if it doesn't exist
However, there are a few issues that I'm having. First is how do we get the game data from /opt/gog and into unionfs? For DOSBox and AGS we create unionfs and cd into it before running the game. For Wine we're talking about installing a wineprefix and then running the game. Windows applications aren't sensitive to the directory they're being run in so we can't run it the same way as DOSBox and AGS.
Secondly, and more troubling are registry entries. Here actual effort may be involved on the part of the package creator. Registry entries that are created at install time can't be extracted with innoextract (unless this feature can be added) as they are usually hardcoded into the inno source. gogwrap regkeys are created here every time and some games require gogwrap arguments to work at all, so this poses a problem for those games. Secondly, some games will create their own regkeys at install time.
A way to workaround this would be to install each GOG in a live Windows environment, or Wine at a push, and export the regkeys and import them via the launcher script. Each wineprefix has its own registry and we should be able to check for keys before performing the import operation (although this may require a cat | grep on the flatfile).
Regkeys which are created at runtime by the game should be no issue.
Another possible, if somewhat crazy solution might be to, instead of extracting game data in build(), actually call wine and install the game to a wineprefix in $pkgdir/opt/gog/GAME/base. This would give us an entire wineprefix in /opt/gog which we then unionfs to ~/.gog. If GOGs have a -silent flag then we're in the money.
It would look something like:
cd $srcdir
if [ ! -f setup_${_gogname}.exe ]; then
error "You must have setup_${_gogname}.exe present in the source dir: $PWD"
error "Download the game from your GOG shelf and try again. Stopping."
return 1
else
WINEARCH=win32 WINEPREFIX=$pkgdir/opt/gog/${_gogname}/base
wine setup_${_gogname}.exe
fi
We would then unionfs the whole base folder, granting a user-specific wineprefix with the game already installed. The registry is contained within as a flat file as is the entire Windows structure.
Some drawbacks to this:
- this makes the script interactive, breaking packaging standards
- the first 'user account' in the wineprefix will be in the name of whoever runs
makepkg, although this isn't much of an issue
- disk space could be an issue
- there are some issues with the GOG installer in Wine, namely the window list button being unusable so if the user loses focus of the installer, they must alt-tab
It might be crazy enough to work, or it might just be plain crazy. I'll play around with it in the morning when I'm not so tired.
Wine came to mind and now I can't get it out; after some thinking a few things make sense:
However, there are a few issues that I'm having. First is how do we get the game data from
/opt/gogand into unionfs? For DOSBox and AGS we create unionfs and cd into it before running the game. For Wine we're talking about installing a wineprefix and then running the game. Windows applications aren't sensitive to the directory they're being run in so we can't run it the same way as DOSBox and AGS.Secondly, and more troubling are registry entries. Here actual effort may be involved on the part of the package creator. Registry entries that are created at install time can't be extracted with innoextract (unless this feature can be added) as they are usually hardcoded into the inno source. gogwrap regkeys are created here every time and some games require gogwrap arguments to work at all, so this poses a problem for those games. Secondly, some games will create their own regkeys at install time.
A way to workaround this would be to install each GOG in a live Windows environment, or Wine at a push, and export the regkeys and import them via the launcher script. Each wineprefix has its own registry and we should be able to check for keys before performing the import operation (although this may require a cat | grep on the flatfile).
Regkeys which are created at runtime by the game should be no issue.
Another possible, if somewhat crazy solution might be to, instead of extracting game data in build(), actually call wine and install the game to a wineprefix in
$pkgdir/opt/gog/GAME/base. This would give us an entire wineprefix in/opt/gogwhich we then unionfs to ~/.gog. If GOGs have a -silent flag then we're in the money.It would look something like:
We would then unionfs the whole
basefolder, granting a user-specific wineprefix with the game already installed. The registry is contained within as a flat file as is the entire Windows structure.Some drawbacks to this:
makepkg, although this isn't much of an issueIt might be crazy enough to work, or it might just be plain crazy. I'll play around with it in the morning when I'm not so tired.