1

I'm writing cross-platform scripts that are executing utilities and some of them are windows executables.

I would like to find a solution that would not require me to prepend the command line with wine when I run from OS X.

I know that on Windows it is possible to define executable files based on file extension but I would like to know if this is possible to do on OS X and how.

I am open to suggestions ;)

sorin
  • 29,875

4 Answers4

3

How about setting all .exe files to "open with" wine?

Harv
  • 6,520
  • I know how open works and I am ready to bet that this will not solve the problem of calling the exe from the shell, abd this was my intend. – sorin Apr 07 '11 at 06:59
  • 2
    Ok then. Set them to "open with" your own bash shell. Your own bash shell looks something like...

    #!/bin/bash

    path_to_wine=/some/path/here ./path_to_wine $1 exit 0

    Make sure to chmod +x your shell script.

    – Harv Apr 07 '11 at 07:54
  • Where 'your own bash shell' = 'your own bash script'. – Harv Apr 08 '11 at 03:03
0

Right-click (or Ctrl+click) on any .exe file and select Get Info from the menu (or just select the file and hit Cmd+I). Go the the Open With section in the info panel and choose Wine (depending on your setup, it may already be in the dropdown list, or you may have to select Other and find it yourself). Then click on Change All to set all .exe files to open with the same app.

0

I don't think there is any sort of setting you can change that'll solve this problem exactly. One thing you could try: on the Mac, rename the windows utility, and write a shell script (made executable with chmod +x) that runs that utility with wine.

spwert
  • 46
-2

have you tried "chown -x" on the files, that should set it to executable. Works with Ruby & Python scripts, should in theory work with exe.

baldy
  • 297
  • 2
    First of all, don't you mean chmod +x? And even with that, I don't think it'll work, since the shell/OS wouldn't know how to execute it. For the scripts, I believe they use the shebang of the file. – Loïc Wolff Apr 06 '11 at 11:26
  • Yes, I meant +, and not - – baldy Apr 08 '11 at 08:04
  • and it's not chown (changing the owner), it's chmod. – Loïc Wolff Apr 08 '11 at 08:23
  • Thanks for the wake-up call, I'm also fairly new to this, coming from a 18 year Windows background, trying to see the world beyond. – baldy Apr 08 '11 at 08:37