wyrdoak wrote:Thanks allypink, I thought I was going to have to learn the Linux secret handshake before I found out what syntax to use for the "menu" command line for Wine programs. Works Like a charm.
True, it works like a charm... for some apps. The syntax provided by allypink has the great advantage of being simple and ready-to-use, but it lacks some flexibility and features that may be needed for some apps/wine setups.
The most basic syntax (as he provided) can be generalized as:
- Code: Select all
wine "/path/to/your/app.exe"
But... what is your app's executable file? And where is it? The above command requires you to browse through your windows tree, locate the installed directory, and find the right executable. Sometimes it is easy to find, sometimes it is not. What if your game has "loader.exe", "start.exe" and "game.exe" ? Which to choose? What if they need additional switches (arguments) to work? Is it "game /s /u" or "loader --start"? What about starting directory? Or compatibility settings?
That's why wine, by default, creates a command that points not to the executable itself, but to the
menu entry created by the very install of program, the
.lnk file. That is the correct way: let the application itself define which is the executable, the path, the parameters. In windows, you don't have to know which is the executable file of Word, or Internet Explorer. You use their generated menu entry. And that's what wine does. So the basic command is improved to:
- Code: Select all
wine start /Unix "/unix/path/to/app's/menuentry.lnk"
Where "
start" is a windows program, provided by wine, that can read a lnk file and launch it accordingly. The
/Unix parameter tells
start that the following will be a unix absolute path (/home/user/.wine/dosdevices/etc...), instead of a windows wine path (C:\Program Files\etc). And since start itself is located in System32 folder, wine's menu entry provides a full path to it, hence "C:\windows\system32\start.exe"
Although in 90% of cases the executable can be easily located, and can be launched without any additional parameters, wine chose a safer, fail-proof approach. (actually, it as no other choice:
you may know that Office 2007 install.exe ends up installing Word in C:\xxxxx\Office12\winword.exe and excel in excel.exe. But wine has no way to know that!)
Last but not least, even that "enhanced command" is not enough for all scenarios: that will run the specified executable in the
default wine prefix. A wine prefix can be thought of a "virtual machine". And wine allows you to have more than one prefix, each one being a completely independent, isolated environment. So you can tweak the settings for a given prefix (to make your app works better) without affecting apps installed in another, separate prefix. That's where the
env WINEPREFIX="/path/to/prefix" from the original command comes from, and "/home/user/.wine" is the default prefix location.
Which leads us to the final, flexible, powerful yet fail-proof general syntax of wine's default menu entry:
- Code: Select all
env WINEPREFIX="/path/to/prefix" [b]wine[/b] "C:\windows\path\to\start.exe" /Unix "/unix/path/to/menu/entry.lnk"
Looks like overkill when a simple 2 word "
wine notepad" will work, but once you understand why and its advantages, you'll stick with the default command, no matter how scary it may seem at first glance.