A good dose of Wine: Running Notepad++ and many other Windows only applications on the Mac and linux

My brother, a recent Mac convert told me how much he missed the Notepad++ on the Mac. We looked it up in the Wine compatibility list and found that it is fairly simple and stable to run it under wine. So, for those who miss having Notepad++ (or any one of those windows only applications in the compatibility list) on a Mac, here is a step by step guide to getting it up and running on the Mac like a champ.

Let us have some Wine!

Wine is the magic potion that can help us run Notepad++ (and several other Windows programs) on the Mac. There are two ways to get Wine on the Mac. The easiest solution is to install Homebrew or any other package manager for Mac can has wine in their list. Alternatively, you can download wine from the official site.  If you are the adventurous type, you could even try compiling it yourself! Do note that Wine needs XQuatrz 2.7.7 or later, so if you are not using the package managers, please install the dependencies.

Note: While Wine can run a lot of apps without a full windows install, not all applications run well under Wine, so you may need to use other virtualization systems like VirtualBox, Parallels or VMWare and have a full blown installation of windows. For those play well with Wine, that is the way, the light and the legion!

Let us get started. I am using Homebrew here. Feel free to skip ahead if you already have wine installed otherwise. Let us get your favorite terminal app fired up and get started.

$brew update && brew doctor

$brew install wine

If you plan to use wine extensively, I would suggest installing  winetricks too.

Now, let us change the wine config to behave like Windows 10. This shouldn’t really matter for Notepad++. but just to stay with the latest form, let us update that.

$winecfg

winecfg.png

For the curious mind, there are a few other interesting bits you can gain from the config as well. Please check under Drives and Desktop Integration sections and customize to your heart’s content.

If you are new to wine, I would recommend reading up a bit. One thing to note is that wine creates a .wine directory under the users home folder and the drive_c directory under that acts as your C drive.

ls ~/.wine               

dosdevices  drive_c     system.reg  user.reg    userdef.reg

Install Notepad++

Now, let us download the latest Notepad++ installer from the official site.  Once we have downloaded the file, run the command on the terminal to install it. as of this time, 2.8.8 is the latest. If you found a newer version, just update the path to the right file you are trying to install it.

wine ~/Downloads/npp.7.8.2.Installer.exe

Follow along the installation and finish it. It should auto start Notepad++ at the end. Just to make sure that it is working.

$wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Notepad++/notepad++.exe

Once you confirm that it is working well and expected, pat yourself on the back. We have installed Notepad++ on the Mac!

The Cherry on top!

It isn’t very convenient to run the command every time on a terminal to get the app running, right? Luckily, there is an app for that!

Open AppleScript editor on your Mac. It can be found under the Utilities folder in your application menu. Once you have the editor up, copy paste the following script to the editor.

tell application "Terminal"

do script "/usr/local/bin/wine ~/.wine/drive_c/Program\\ Files\\ \\(x86\\)/Notepad++/notepad++.exe"

end tell

applescriptnpp.png

Save the file for future reference.

Now, let us make it to an app. AppleScript Editor allows us to export this as an app. exportapp.png

Name it appropriately so the you can find it easily. Save it directly to your application folder for easier access.

Have fun!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s