running Windows programs from the command line

Questions about Wine on Linux
Locked
Georg
Newbie
Newbie
Posts: 3
Joined: Sat Dec 24, 2016 4:28 am

running Windows programs from the command line

Post by Georg »

Good morning,


I'm trying to move from Windows 10 to Linux. One major problem is that I have a lot of self-written programs that need to make the migration with me as well. Unfortunately, these programs are written using Xbase++, and a Linux version of the compiler is not visible at the horizon, so I give Wine a try.

Before I explain my problem, I have to explain how I do program. As I started under DOS with Clipper, I haven't moved to a GUI-integrated environment. I still use the shell (cmd.exe) to execute my editor (MultiEdit 2008) and launch the make program (pbuild) that comes with Xbase++. Under normal circumstances, the directory that holds the source files (and the resulting executables) is my current directory. I type

Code: Select all

mew32 mysource.prg
and MultiEdit shows up, I edit the file, save, and run

Code: Select all

pbuild
When the compile/build is fine, I run the program (with or without the debugger).

The Wine User's Guide (https://wiki.winehq.org/Wine_User%27s_G ... mmand_line) assumes that one wants to run a game (or other program) from the directory where the program is installed - I just want to run an installed program from the directory where I work at the moment.

This gives me this result:

Code: Select all

georg@MintChip ~ $ wine Mew32.exe
wine: cannot find L"C:\\windows\\system32\\Mew32.exe"
The directory where MultiEdit resides is included in the PATH environment variable.

As a starter, I have created a shell script that launches MultiEdit, passing the file(s) to edit.

But I think there should be a better (easier) way to accomplish that?

Thank you in advance for your help.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: running Windows programs from the command line

Post by Bob Wya »

Hiya Georg,

You must alter the Windows (Wine) PATH registry/env variable - not the Unix env PATH!

Use the Wine Registry editor.

Code: Select all

wine regedit
Browse to:

Code: Select all

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment
Append your compiled application folder to the PATH (REG_EXPAND_SZ) registry value name.
These semi-colon seperated paths in this variable must all be Windows paths.

By default it will be something like:

Code: Select all

PATH=C:\windows\system32;C:\windows;C:\windows\system32\wbem
The Wine PATH will also include the Present Working Directory (PWD) Unix path - but not any other directories (e.g. like your self-built binaries directory). So just add additional executable directories to your Wine PATH variable - as required!

You can convert Unix paths to Windows paths (say if you're working outside your current Wineprefix):

Code: Select all

winepath -w <UNIX PATH>
Bob
Georg
Newbie
Newbie
Posts: 3
Joined: Sat Dec 24, 2016 4:28 am

Re: running Windows programs from the command line

Post by Georg »

Hello, Bob -


first of all, thank you for you fast reply (I'm not that fast, obviously).

Your hint was a real hit, it solved my problem.

At the moment it looks really good, I've still got a few tests to do, but I'm really willing to Linux along with Wine a try.


Georg
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: running Windows programs from the command line

Post by Bob Wya »

np Georg,

Just remember the glass is either half full or half empty... 8)

Bob
Locked