Developing Windows code on Linux

Thoughts on using Linux as a development platform for code destined for Windows computers.

I do not write code for Windows often enough to justify the hassle and expense of buying a Windows box, or even a Windows license and running it as a virtual machine. Instead I use CrossOver in Linux as my initial development environment.

This of course by no means fully duplicates the Windows environment, but it does minimize the time I have to spend on a borrowed or rented Windows box. It also has the advantage of letting me use the superior shell and development tools available on Linux. Naturally there are all kinds of limitations and gotchas to this approach, but here’s what I’ve learned about doing things this way.

CROSSOVER-SPECIFIC ISSUES
The following examples are taken from my installation of CrossOver. There are different ways of installing CrossOver, however, so YMMV.

Assuming you use CrossOver for other things, start with a fresh bottle so that you aren’t running the risk of damaging an existing bottle. In the examples below, we will assume a bottle named “VistaDev”.

To get a Windows command line prompt, ~/cxoffice/bin/wine –bottle VistaDev –cx-app cmd.exe.

The graphical Windows file explorer is apparently not implemented even though explorer.exe exists, so expect commands involving it to silently fail.

Robocopy is not included in CrossOver. Presumably it would work if copied from a Windows computer (Vista or later) to ~/.cxoffice/VistaDev/drive_c/windows/system32. TODO: Confirm this.

GENERAL ISSUES
Newlines are handled differently in Linux and Windows; I handle this problem with dos2unix and Bluefish.

TODO: Document a way to manipulate Windows file attributes. Possibilities include:

  • Install mtools in Linux and read man mattrib. Apparently it presumes you are manipulating files on a floppy. In my superficial reading of man attrib I have not yet figured out how to manipulate files on a USB stick.
  • Use Crossover’s attrib.exe.
Advertisements

About Warren Post

So far: Customer support guy, jungle guide, IT consultant, beach bum, entrepreneur, teacher, diplomat, over-enthusiastic cyclist. Tomorrow: who knows?
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

One Response to Developing Windows code on Linux

  1. IDAnthony says:

    cool

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s