Skip to content

Instantly share code, notes, and snippets.

@jiaaro
Created September 22, 2020 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiaaro/02c7cdacf3cb6fd6648464491d6c5964 to your computer and use it in GitHub Desktop.
Save jiaaro/02c7cdacf3cb6fd6648464491d6c5964 to your computer and use it in GitHub Desktop.

How to use:

  1. (On a mac) Launch "Script Editor"
  2. Change the language to javascript if needed
  3. Paste the code from wine-launcher.jxa
  4. Save with the file format "Application", and uncheck "Show startup screen" and "Stay open after run handler" (I recommend putting it in your user/Applications directory)
  5. Make sure wine is installed, you can use homebrew
  6. Right click an ".exe" file, choose "Get Info", and then change the "Open with" application to your Wine app that you just made. To make it work for all .exe files, click "Change All…" afterward.

Now you can double click any exe and it'll launch in wine :)

let app = Application.currentApplication()
app.includeStandardAdditions = true
function run(argv) {
app.displayAlert("Please launch this with a .exe file")
}
function openDocuments(droppedItems) {
for (var item of droppedItems) {
app.doShellScript('/usr/local/bin/wine64 ' + item)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment