Leaving Mac and Developing Windows Software

develop Windows software






TOKYO (MacHouse) – Switching to a different software development environment isn’t easy for sure. Although Apple, Inc. has postponed enacting its Desktop Policing Act, Mac users and software developers will soon be forced to make an important decision – Stay with Mac OS or move to a different operating system. Personally, after exclusively using Mac OS and buying Apple computers for more than 20 years, I’ve finally had enough. Nonetheless, staying with Mac OS might not be such a bad idea except that you have to request Apple’s permission when you deploy a resource (If you unpack a zip archive that you’ve downloaded, for example, you will be prompted for confirmation.). When you use sandboxed applications, you will also require Apple’s permission to access files that you want to open and to save. Sandboxed applications including TextEdit and Preview can delay your desktop performance. If you have doubts, simply type up some text on a TextEdit document and press Command + S and see how long it will take TextEdit to open up the save dialog window. If you have never seen TextEdit hung up, you must be a very lucky guy.

If you are developing Mac software products, you may wonder how difficult it would be to switch to a different operating environment? Speaking of Windows OS, it’s not. In the meantime, Microsoft has acknowledged that their app store is on its way. And it probably won’t be available till next spring. So you still have some time to think about making an important decision. Windows app store can be your gold mine. Anyway, let’s see what it’s like developing Windows applications after spending years with Mac OS.  

Costs

Microsoft has an IDE application called Visual Studio. Just as its operating system, Visual Studio is available in different flavors. Express is free. This version supports one language, which is Visual Basic. If you are planning on developing Windows applications in a different language like C#, C++, you must choose a commercial version. The Professional version isn’t free and has some limitations though it’s not even cheap. I think it costs several hundred dollars, at least. Another version is Ultimate, which costs more than 10K. Yes, that price tag is a shocker. So you may want to use a tryout version of Professional or Ultimate and manipulate the system clock to continue to use it if necessary.

Visual Studio Express will probably suit your immediate needs if you want to start out with Visual Basic. But be careful. When you install Express, you may not be able to install an upgraded version like Professional and Ultimate. You could, but Express will stay even after you uninstall it. So you will probably be able to develop only Visual Basic applications even after installing Professional or Ultimate. That being said, you may be forced to reinstall OS when upgrading from Express.

Note that you do not necessarily have to buy a new Windows machine. Visual Studio, whether you use Express or Ultimate, is light-weighted. You can actually run Visual Studio smoothly in a virtual OS environment. I have never used Parallels. So I cannot say for sure Parallels will let you run Visual Studio. You will have no problem running Visual Studio and developing Windows applications with VMware Fusion 3 or 4. However, you should definitely test your software products with a real PC. In fact, I have bought a PC notebook. Of course, you can run Windows with Boot Camp to test your applications.





develop Windows software
Screenshot 1
  develop Windows software
Screenshot 2






Windows icon

Windows icons must have a size of 256 x 256 pixels. You should certainly design icons at 512 x 512 just as you do with Mac applications. As you know, the icon format must be ICO. If you have Adobe Photoshop, you can use a free plug-in from Telegraphics. (See Screenshot 1.) All you have to do is open a 256 x 256 PNG image and choose Save with Photoshop. Then select ICO as an export format. (See Screenshot 2.) It is important to remember that you should not choose the Vista-compatible format for Windows 7. (See Screenshot 3.)





develop Windows software
Screenshot 3
 






Using resources

When you develop an application, you may end up using resources (images, audio clips…) You must first import these resource files to Visual Studio. To do so, open up My Project. Then select Resources. (See Screenshot 4.) Then click on Add Resources at the top to import existing files. Furthermore, in order to point to a specific resource, use My.Resources (a namespace). For example, if the file name of the resource is diceroll1.wav, then you can point it to this resource like My.Resources.diceroll1 or equivalent. (See Screenshot 5.)





develop Windows software
Screenshot 4
  develop Windows software
Screenshot 5






Publishing an application

It’s probably not difficult to figure out how to publish an application with Visual Studio. Well, it’s just the matter of choosing Publish (application name) under Build, right? If you do, you will find your application in bin > Release. (See Screenshot 6.) Unfortunately, Windows OS doesn’t have a simple concept of packaging files into one stand-alone application just as you see in Mac OS. You could actually zip this entire Release folder into one to distribute your software product. However, such a manner doesn’t look very professional. In fact, Visual Studio lets you create an installer.





develop Windows software
Screenshot 6
  develop Windows software
Screenshot 7






In order to create a software installer, first, choose Add under File and then select New Project. (See Screenshot 7.) Explore Installed Templates to the left and click on Setup and Deployment and then Visual Studio Installer. (See Screenshot 8.) Finally, select Setup Project and click on the OK button at the bottom. Well, the road is long. So good luck…





develop Windows software
Screenshot 8
 






User settings

Many Mac applications let users customize settings. Commonly, the user setting window is accessible by choosing Preferences. Visual Studio actually has a feature called My.Settings. My.Settings allows the software developer to set up values, which will be stored in an XML file. All you have to do is enter a name and set a value under My Project‘s Settings. (See Screenshot 9.) However, advice is “Don’t use My.Settings to save user-defined settings.”





develop Windows software
Screenshot 9
  develop Windows software
Screenshot 10






What’s wrong with My.Settings? When you use My.Settings, Visual Studio will create a text file with an extension of settings. It’s a simple XML file. And your released application will take this very file with it. That is, your users will end up seeing the settings you have on your computer in testing the application.

Okay. So do what? First of all, remember that each Mac (Mac App Store) application has its own folder inside System? The path is Users / User /Library / Application folder / my application, where my application is the name of an application, right? Windows has its own way. Each Windows application is expected to have its own folder, if needed, at C / Users / User / AppData / Roaming / Company name / my application. Note that the AppData folder is invisible. So you have to reveal it with Control Panel (Appearance and Personalization > Folder Options) to actually see it. Anyway, you must design your application so that it will automatically create a file there when it launches itself or whenever it doesn’t find its settings file there. By using Environment.SpecialFolder, you can easily get a path to the Roaming folder for your application. If you want a path to your application, declare the names of your party and application as variables. Then you will get a path by writing the following.






Path.GetFullPath(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\" + CompanyFolder + "\" + AppFolder)






, where CompanyFolder and AppFolder are variables.

Lastly, how do you store user settings? XML is a good choice. Use XMLWriter to create a default settings file. (Screenshot 10.) And make it so that the application will load this file every time it starts up. How about using database like SQLite? SQLite is actually our favorite choice in storing large information for Mac applications. But using a database file locally is not that easy with Visual Studio. Using a database file to store information depends on whether or not you can reproduce that file on its own whenever necessary. So an XML file or even a text file should serve better.

Switching to a different development environment isn’t easy. Let me tell you that I know little about Windows software development. That’s true. But do you really want Apple to tell you to do this and that and hold your software software submission for 3, 4, 5 or even 6 months? In fact, we do have several software submissions that are hung for more than 6 months. If your sandboxed application can fail and then crash, you will be the one to blame, not Apple, for user’s perspective. It’s time to leave the police operating system.

This entry was posted in Apple & Mac, Windows. Bookmark the permalink.

Leave a Reply

Your email address will not be published.

Notify me of followup comments via e-mail. You can also subscribe without commenting.