2

I'm trying to make a Win32 program work on Mac through WINE. This program used to call another Win32 program as an external process using CreateProcess() API. I now want it to call a UNIX shell script on Mac through WINE.

I succeeded in creating a process that runs a straightforward command: /usr/bin/touch /Users/username/Desktop/file

CreateProcess( NULL, const_cast<LPWSTR>( (LPCWSTR) _T("/usr/bin/touch /Users/username/Desktop/file")  ), NULL, NULL, FALSE, 
            NORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW, NULL, NULL, &si, &pi );

However, I tried to replace the command using /bin/sh /Users/username/Desktop/my.sh This time it failed.

At first I thought it was due to path issue, I thought WINE would use Windows path. So I tried to load ntdll.dll, then use the API wine_unix_to_nt_file_name() to convert the script path to a WINE-flavor Windows path. It still does not work (my.script just calls the the same touch command listed above).

I wonder if my goal was misguided. Is it possible to achieve what I wanted with WINE?

kakyo
  • 10,460
  • 14
  • 76
  • 140
  • 1
    Have you tried turning on [debugging output](http://www.winehq.org/docs/winedev-guide/dbg-control) for Wine to see if it tells you something usable? – user786653 Nov 07 '13 at 17:43

0 Answers0