Developing Windows applications on Linux?

20,770

Solution 1

Check Qt too. It's a very rich cross-platform framework.

As for installers I'd highly recommend WiX.

For testing it will be much better to use some kind of virtualization like Sun Microsystems's VirtualBox. I believe you could use a trial version of Windows or Windows 7 RC, which is free to use until March 2010.

Solution 2

First of all, yes it is good idea. I have several projects that I maintain their Windows version in this way.

In any case, I suggest you test the final product on Windows machine. If you have a license for Windows OS, you may use virtualization to do final tests.

I suggest to use Autotools that has very good cross compilation support and works "natively" with a cross compiler.

Under Debian for example running

./configure --host=i586-mingw32msvc

This would create the correct cross compilation makefile as if this was Unix project.

In any case, I would recommend to develop a cross platform version and time-to-time test native Windows version with Wine/Windows by cross compiling them.

Solution 3

    • InstallJammer allows you to create installers for *nix and Windows. I am not sure if it allows cross creation of installers (i.e. creating Windows installers from *nix). A commercial option with demo available to try is the Bitrock InstallBuilder.
    • Maybe... If you have a Windows license, Dav's suggestion would be better.
    • If it helps you work better/more efficiently & effectively, sure.

Keep us posted on how you get on - this is interesting.

Solution 4

You imply that the applications are for Windows only and not cross-platform, in which case I think the answer to 3. - This is really not a good idea - trumps the rest.

The reason being you are going to have to extensively test the application under Windows anyway, either directly or in a virtual instance. That being so you're better to develop under the target OS because you're more likely to produce a better application - both from catching the bugs earlier and more thoroughly and ensuring your application 'works' for your users. I certainly wouldn't trust just Wine.

I'm not a big fan of cross-platform widgets. Like Java applications you generally end up with something that doesn't quite look right, and like the uncanny gap that can be enough to make your application smell bad to a large section of your users. Even at the slightly more abstract level, each OS's applications have a slightly different feel as to how they work and you'll most likely end up with a Windows application that feels like a, say, KDE one, which will again put your users off.

So yes, certainly possible to do this, but probably not the optimal approach from point of view of the quality of the end product. To do so will give yourself something of a handicap with what you produce and I'd say that's likely to offset the convenience to you of using a Linux platform. Actually I'd be surprised if you manage even that because I'd bet you'll spend more time messing around with the widgets trying to fine-tune them so they work right under real Windows than you'll gain from using an unfamiliar Windows toolset.

Solution 5

You will need an MSDN licence anyway to get access to all the multitude of versions of Windows you'll want to test on.

You'll want to install the test OSs on VMs. This could be on your Linux desktop, but a dedicated box might be better.

I don't know how many versions of Windows you plan on supporting, but you should definitely test on all of them. Wine is not Windows, nor is Windows XP the same as Windows Vista, Windows 7, etc. There are also a lot of different distributions and languages of Windows, some of which you should undoubtedly test on.

By all means, develop on Linux. By all means, use cross-platform widgets (yes, these are good). But you'll still need your MSDN licence so you can install test OSes.

Share:
20,770
EricF
Author by

EricF

Programming in C++, python and Rust. My computers run Gentoo and are always messed up in some way. I love playing with robots, but they don't like playing with me.

Updated on September 07, 2020

Comments

  • EricF
    EricF over 3 years

    My primary OS is Linux, but now I'm forced to write some C++ applications for Windows. I was thinking about developing on the Linux box with cross platform libraries like WxWidgets (and some care about other platform dependencies) and then cross compiling the result to mingw target.

    So the tools I'm thinking of using are

    • g++ for compilation and cross-compilation.
    • CMake
    • WxWidgets
    • ??? for making windows installer packages
    • wine for testing of the windows version

    And my questions:

    1. What are some free (or even better open source) installers for Windows that I might use to create the final package? It would help if the package could be prepared from Linux.

    2. Will Wine be enough to test the cross compiled version (after all the logic is tested in the Linux version)?

    3. Is this a good idea? :-)

  • Henning
    Henning over 14 years
    I really find NSIS to be a bad thing. After working or better trying to work with NSIS a couple of days, I feel pain everywhere... It doesn't report errors(nothing like writing a log of everything including errors and commands that did not succeed), variable assignments and usage seems unclear to me. No real fun.
  • Nathan Osman
    Nathan Osman over 14 years
    I use Inno Setup and it is truly the best.
  • sjsam
    sjsam almost 9 years
    Is it a disadvantage that we won't be able to use profilers? And more over if I understand correctly the optimization procedures vary considerably from one OS to other. How could I tackle this? Or is it better to get something working and bother about optimization at the final testing in Windows, as you have mentioned.