All about WINE (emulator)


I always thought that Wine (or WINE, WINE Is Not an Emulator) is good enough for me to play Windows games and running Windows applications without using the virtualisation such as VirtualBox. However, this is not completed.

Recently, due to a giveaway from CodeWeavers, I downloaded and tried the CrossOver. Then I found the comparison of Wine and CrossOver, CrossOver contains some proprietary components, which makes Windows applications run smoother than Wine. I tried, yes, there are some differences. But I am still using Wine because of my own favour.

WINEPREFIX (or bottle?)

When using Wine, we can always define different WINEPREFIX to install or run the applications separately. WINEPREFIX can be defined as the path of virtual Windows drive. We can create many virtual Windows drives with different WINEPREFIX. For example, I have two applications, namely A and B. Because Wine sometimes does not work perfectly with one setting for all the applications. Thus, I need to use different WINEPREFIX for application A, and another WINEPREFIX with different setting for application B. In CrossOver, the WINEPREFIX is called “bottle”, thus it make sense that we put different “wine” into different “bottles”.

Winetricks

To make some tricks or tweaks to our WINEPREFIX (or virtual Windows drive), winetricks is a powerful tool. We can use it to install all the fonts we need, make the changes in the registry, install some applications, install some Windows components such as DirectX, video codecs, etc. The downloaded installation files are cached in ~/.cache/winetricks, they can be re-used. This is normally what I did, using default WINEPREFIX which is ~/.wine, and installing all the important components using winetricks.

WineGame

However, this is not the whole story. Recently, because I installed Evernote, then I want to re-install, so I uninstalled it. However, when I tried to re-install, it failed. The solution from the internet suggested that to remove the WINEPREFIX, and create new one. Because most of my applications are installed in the same WINEPREFIX, removing it means that I need to re-install all the other applications. Hence, I tried WineGame, which was installed in my computer.

I know how to use command-line to run the WINEPREFIX. But using different WINEPREFIX, meaning that I need to run the application with command-line every time. Thus, I chose WineGame as it is described as the front-end for Wine. Meaning that, we can create the shortcut to run the applications without using command-line.

WineGame has some predefined settings for the games such as StarCraft, WarCraft, Civilization, etc. However, because I tried WineGame recently, I found that its package repository is dead. As a result, WineGame is good for nothing. Since I installed WineGame long time ago, that is why I obtained the packages information for me to run WineGame properly. Actually, we can create our package information manually, using some files such as “control”, “.name”, “.note”, etc.

If you don’t get it, nevermind, there is alternative solution for the front-end of Wine.

Q4Wine

Because WineGame doesn’t work well, and the project has no update since 2010, so, I assumed that the project is inactive. There is an alternative, called Q4Wine. Actually both Q4Wine and WineGame are using winetricks. As a result, the downloaded installation files can be re-used. Unlike WineGame, Q4Wine does not provide any package repository. However, it works super well for managing the WINEPREFIX.

Still, WineGame has a strength which Q4Wine does not have. WineGame allows the user to use different versions of Wine to run the applications. This is something very interesting. Besides the “bottle”, the “wine” is also different. Why? This is because, Wine is a very strange project. The newer version of Wine, might not work better than older version of Wine in some of the applications. For example, this game in the WineHQ AppDB. Read the test results, the rating changed from Gold to Garbage, finally to Bronze. So, this is the advantage of WineGame to let you install different versions of Wine. However, the project is inactive, thus you cannot get the later versions of Wine.

Nevermind, there is a better solution.

PlayOnLinux

Here it comes, PlayOnLinux. I installed it before, but I never use it. Because I didn’t know the reason for such project exists. Because I thought Wine is sufficient for everything. Even I want to manage my WINEPREFIX, I can use any front-end application.

PlayOnLinux offers more things. Not only front-end, but also allows you to download different versions of Wine. The different versions includes the patched version, such as vertex blending version. And if you have compiled your own version of Wine, you can justĀ  symbolic link or copy to ~/.PlayOnLinux/wine/linux-x86. PlayOnLinux allows to use your own custom Wine.

Though PlayOnLinux is wonderful, not all the versions of Wine are available, for example, I cannot get the Wine version 1.2 patched with vertex blending. As a result, I need to build the patched version by my own and put it into PlayOnLinux to use it.

PlayOnLinux has another different feature from Q4Wine or WineGame. The installation of the application done by PlayOnLinux will not create desktop entries into the X11 menu. This is because it disables the WINEDLLOVERRIDES. As a result, to run the applications, we must run from PlayOnLinux. But PlayOnLinux allows you to create shortcut to the desktop.

 

So, this is actually how Wine works. Choose your best bottle with your best wine to run your applications without flaw.

Advertisements

Knowledge Tree


This is an interesting thing. I love the tree so much. The Knowledge Tree here I mean is not referring to the Tree of Knowledge of Good and Bad.

Tree is a graph theory. The powerfulness of tree, is that almost any data structure can be represented into the tree. In order to store the data, we can use a single variable, for a single data. In order to store a list of data, we can use array and associative array (or hash, map, dictionary), list, vector, and others. Another powerful data structure which I like is the 2D array, especially used in matrix calculation. The 2D array represents the data in the table form. It is very useful in database. An image can also be treated as 2D array. Comparing the tree to the matrix, the tree is possible to represent the matrix (though it is not preferred).

Tree is mostly used in the programming, especially data representation such as JSON, XML, HTML, YAML, scene graph. Even the object (oriented) can be assumed as a tree, with the attributes and methods as the leaves, and the inheritance a parent-child relationship in the tree. Moreover, the programming languages can be parsed into parse tree and abstract syntax tree. The Python language is wonderful with the indentation syntax, which the indentation can be thought as the tree also.

In the decision support tools, the decision tree is used. In the pathfinding, such as depth first search, breath first search, A* search, these are also represented as graph and tree. In the file system, we have files and directories, these are also tree representation that is why the “/” is called the root directory. Furthermore, in the version control such as CVS, SVN, Git, Mercurial and else, they are also trees. That is why there are trunk and branches in the versioning system. In a document, we have heading 1, 2, 3, and so on with the body text. This makes our documents also a tree structure.

As a result, by combining these together, especially Python’s indentation syntax, I am creating my knowledge base using the tree forms. This is easy because creating something like concept map needs image editor software, it is time consuming. So, just using a plain text editor, with indentation, this helps me to manage my knowledge easier.

Example,

Text editor
    File
        quit, open, save
        buffers (open multiple files)
    Edit
        insert, delete, select (or highlight)
        cut, copy, paste (or yank)
        find, find next, find previous
        search and replace (with regular expression)
        undo, redo
    Others
        macro
        windows (split)
        mark
        folding
        syntax highlighting
        autoindent

The above is an example of my knowledge node, which is a text editor with the generic features. The next one is about the data types of database.

Database
    Null
    Numeric
        Integer
            bool
            int, tinyint, samllint, mediumint, bigint
            bit
        Real
            float
            double
    String
        Text
            datetime
                date
                time
                timestamp
            varchar, char
            enum, set
        Blob