Mac OS X Best Practices: Installers

by Jon 6/8/2008 8:37:00 PM

One of the things I really like about Mac OS X versus what I've seen in Windows et al is the way third party software gets installed. I've always heard people whine and complain about how applications for Windows should never use the Registry, should never touch the system directories, etc. In my mind, I saw such software practices as a necessary evil, and things are far worse in the Linux world, where the directories and file paths are far less predictable. I had thought these complaints were coming from Linux folks, but apparently not, they're coming mostly from Mac folks, I bet, because the Mac world has proven this stuff out.

Most apps are installed by copying the application directly into the Applications folder. The End.

Well, not quite, but that's pretty much it as far as the user is concerned. From the developer's / distributor's perspective, there are a few things to note.

  1. An application may appear as an individual file that has lots of resources embedded in it (I was a big tinkerer of ResEdit back in the day), but this is a facade in the OS X world. Applications are actually directories with a .app extension, and Finder (the Windows Explorer equivalent) treats these directories like files when browsing them, in that the folder has the application's icon, and double-clicking the icon opens the appropriately mapped executable file inside. (This behavior and other metadata is maintained with a file inside that has a .plist file extension. It's kind of like an app.config file in the Visual Studio .NET world, but it's not the same format at all.) "Power users" (or any user who's Mac savvy, or newbies like me who have experienced friends to show them this stuff) can access the contents of the folder by right-clicking (or Control + Left-clicking) the icon and choosing "Show Package Contents".
    I'm not sure yet what all goes on in here but I wouldn't be surprised if global application settings (like Windows' .ini files) can be modified here. Meanwhile, user preferences are managed in the user's home directory.
  2. Somewhat similar (IMO) to the custom folder display features in Windows' Active Desktop--which in Windows is partially incomplete on the directory/file shell level, was deprecated, and is rarely used because it was too powerful and too prone to abuse and malicious hacks, or maybe just too easy to be confusing and inconsistent in deployments--the Finder allows directories to be customized in layout and style so that when you open a CD-ROM (or disc image) and view its contents, it might appear elegantly like a running program that displays instructions on how to install (drag and drop to Applications), but really it's just a Finder view of the directory contents, with a custom background image and custom positioning of folders and files.
  3. Whereas Windows users must download Spyware-ridden Daemon Tools (even recommended by Microsoft) to mount .iso's to a drive letter, Mac OS X allows you to mount disc images (.dmg's) by double-clicking them. There is no drive letter, they just show up on the desktop and open automatically in the Finder (no annoying "what do you want to do with this?" dialogue, either).
  4. There is usually an alias to the /Applications directory right in the disk image's root folder, so basically when the customized layout displays text that says "drag and drop this icon to the Application folder", it is actually the distributed application's icon on the left, the Applications' folder alias on the right, and big, bold right arrow in the middle. (We all know what arrows mean, it's like a universal language.)
  5. Sometimes when an application gets dragged and dropped into the Applications directory, a quick script might execute. (Or, this is what a friend has told me, I'm still discovering all this.) I imagine that this allows for the initial creation of application environment settings. I'm not sure what the security or runtime constraints are on this, though. And I think--but am not certain--that this would be done in either AppleScript or Javascript.
  6. Sometimes an application needs to be installed, as in, integrated into the system. Services and developer tools are very frequently in this boat; application frameworks belong in several different directories, for example. For these situations, OS X uses a "package" or .pkg file, which is very similar to a Windows .msi file. Opening a .pkg file works much the same way as opening an .msi file, except a) I don't think it auto-detects prior installations and offers to uninstall or repair (??), and b) most of the .pkg installers that give installation path options seem to only offer hard drive selection, not folder selection. This kind of dumbs things down a bit but might be for the greater good of average users.

Here's an important documentation page I just stumbled across, and the motivation for posting this blog entry:

http://developer.apple.com/tools/installerpolicy.html

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Software Development | Mac OS X

How My Microsoft Loyalty Is Degrading

by Jon 6/7/2008 9:59:00 AM

I've sat in this seat and often pronounced my discontent with Microsoft or a Microsoft technology, while still proclaiming myself to be a Microsoft enthusiast. Co-workers have often called me a Microsoft or Windows bigot. People would even give me written job recommedations pronouncing me as "one who particularly knows and understands Microsoft technologies".

But lately over the last year or two I've been suffering from malcontent, and I've lost that Microsoft spirit. I'm trying to figure out why. What went wrong? What happened?

Maybe it was Microsoft's selection of Ray Ozzie as the new Chief Software Architect. Groove (which was Ozzie's legacy) was a curious beast, but surely not a multi-billion-dollar revenue product, at best it was a network-based software experiment. Groove's migration to Microsoft under the Office umbrella would have been a lot more exciting if only it was quickly adopted into the MSDN vision and immediately given expansive and rich MSDN treatment, which it was not. Instead, it was gradually rolled in, and legacy SDK support just sort of tagged along or else "fell off" in the transition. Groove was brought in as an afterthought, not as a premier new Microsoft offering. Groove could have become the new Outlook, a rich, do-it-all software platform that brought consolidation of the team workflows and data across teams and diperate working groups, but instead it became just a simple little "IM client on steroids and then some" and I quickly abandoned it as soon as I discovered that key features such as directory sharing weren't supported on 64-bit Windows. So to bring Ozzie in and have him sit in that chair, and then have that kind of treatment of Ozzie's own Groove--Groove being only an example but an important, symbolic one--really makes me think that Microsoft doesn't know what on earth it's doing!! Even I could have sat in that chair and had a better, broader sense of software operations and retainment of vision, not that I'm jealous or would have pursued that chair. The day I heard Ozzie was selected, I immediately moaned, "Oh no, Microsoft is stuck on the network / Internet bandwagon, and has forgotten their roots, the core software platforms business!!" The whole fuzzy mesh thing that Microsoft is about to push is a really obvious example of where Microsoft is going as a result of bringing in Ozzie, and I hardly find a network mesh compelling as a software platform when non-Microsoft alternatives can so easily and readily exist.

Maybe it's Microsoft's audacity to abandon their legacies in their toolsets, such as they have done with COM and with VB6. There still remains zero support for easily building COM objects using the Visual Studio toolsets, and I will continue to grumble about this until an alternative component technology is supported by Microsoft that is native to the metal (or until I manage to get comfortable with C/C++ linked libraries, which is a skill I still have to develop 100% during my spare time, which is a real drag when there is no accountability or team support). I'm still floored by how fast Microsoft abandoned DNA for .NET -- I can completely, 100% understand it, DNA reached its limits and needed a rewrite / rethink from the bottom up, but the swappage of strategies is still a precedent that leaves me with a bad taste in my mouth. I want my personal investments in software discovery to be worth something. I'm also discouraged--the literal sense of the word, I'm losing courage and confidence--by the drastic, even if necessary, evolutionary changes Microsoft keeps doing to its supported languages. C# 2 (with stuff like generics support) is nothing like C# 1, and C# 3 (with var and LINQ) is nothing like C# 2. Now C# 4 is being researched and developed, with new support for dynamic language interop (basically, weak typing), which is as exciting as LINQ was, but I have yet to adopt even LINQ, and getting LINQ support in CLR object graphs is a notorious nightmare, not that I would know but everyone who tries it is pronouncing it as horrible and massive. Come to think of it, it's Microsoft's interop strategy that has been very frustrating. COM is not Remoting, and Remoting is not WCF. WCF isn't even supported in Mono, and so for high performance, small overhead interprocess communications, what's the best strategy really? I could use WCF today but what if WCF is gone and forgotten in five years?

Maybe it's the fact that I don't have time to browse the blogs of Microsoft's developer staff. They have a lot of folks over there, and while it's pretty tempting to complain that Microsoft "codes silently in a box", the truth is that there are some pretty good blogs being published from Microsofties, such as "If broken it is, fix it you should", albeit half of which I don't even understand without staring at it for a very long time. Incidentally, ScottGu does a really good job of "summing up" all the goings on, so thumbs-up on that one.

I think a lot of my abandonment of loyalty to Microsoft has to do with the sincerity of my open complaint about Internet Explorer, how it is the most visible and therefore most important development platform coming from Redmond but so behind-the-times and non-innovative versus the hard work that the Webkit and Mozilla teams are putting their blood, sweat, and tears over, that things like this [http://digg.com/tech_news/Time_breakdown_of_modern_web_design_PICTURE] get posted on my wall at the office, cheerily.

Perhaps it's the over-extended yet limited branding Microsoft did with Vista, making things like this [http://reviews.cnet.com/8301-13549_7-9947498-30.html] actually make me nearly shed a tear or two over what Windows branding has become. That Windows Energy background look looks neat, but it's also very forthright and "timestamped", kind of like how disco in the 70's and synth-pop in the 80's were "timestamped", they sounded neat in their day but quickly became difficult to listen to. That's what happens with too strong of an artistic statement. Incidentally, Apple's Aqua interface is also "timestamped", but at least it's not defaulting with a strong artistic statement plastered all over the entire screen. I like the Vista taskbar, but what's up with the strict black, why can't that or other visual aspects be tweaked? At least it's mostly-neutral (who wants a bright blue or yellow taskbar?), but it's still just a bit imposing IMO.

I'll bet it has to do with the horrifying use of a virtualized Program Files directory in Windows Server 2008 where the practice was unannounced. This is the sort of practice that makes it VERY difficult to trust Microsoft Windows going forward at all. If Windows is going to put things in places that are different from where I as a user told them to be placed, then we have a behavioral disconnect--software should exist to serve me and do as I command, not to protect me from myself while deceiving me.

At the end of it all, I think my degrading sense of loyalty could just be the simple fact that I really am trying to spread out and discover and appreciate what the other players are doing. I mentioned before that Mac OS X is still the ultimate, uber OS, but now that I have it, I confess, I had no idea. Steve Jobs is brilliant, and it's also profound how much of OS X is open source, basically all of the UNIXy bits, which says a lot about OSS. Mind you, parts of the Mac I genuinely do not like and have never liked, such as the single menubar, which violates very key and important rules for UI design. I also generally find it difficult to manage multiple applications running at once, for which I much prefer the Windows taskbar over the Dock if only because it's more predictable, and although it violates UI principles I prefer Alt+Tab for all windows rather than Command+Tab just for applications because every window is its own "workflow" regardless of who owns it. But, among other things, building on PostScript for rendering, for example, was a fantastic idea; on the other hand, Microsoft's ClearType would have been difficult to achieve if Windows used PostScript for rendering. Anyway, meanwhile, learning and exposing myself to UNIX/Linux based software is good for me as a growing software developer, and impossible to cleanly discover in Windows-land without using virtual machines.

In other words, the only way one can spread out and discover the non-Microsoft ways of doing things, and appreciate the process of doing so, is to stop swearing by the Microsoft way to begin with, and approach the whole thing with an open mind. In the end, the Microsoft way may still prove to be the best, but elimination of bias (on both sides) is an ideal goal to be achieved before pursuing long-term personal growth in software.

Currently rated 3.9 by 10 people

  • Currently 3.9/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

General Technology | Operating Systems | Software Development | Microsoft Windows | Mac OS X

New York Times proves out Silverlight integration in a native Mac application

by Jon 5/24/2008 12:46:00 PM

New York Times has migrated their popular WPF-based New York Times Reader to the Mac, using Silverlight and native Cocoa windowing and application logic, and using the Safari / WebKit API as a Silverlight wrapper. (Darn it, I knew it was both doable and legal!)

http://firstlook.nytimes.com/?p=49 

It doesn't have the text flow feature that WPF was so fantastically good at, but being as text flow is rumored as "coming soon", either for NY Times' reader or for Silverlight, I'm pretty excited about the future of that. 

I blogged about the feasability of this (native, non-web cross-platform apps with Silverlight rendering) just days ago, motivating myself to outright buy a Mac since I didn't see anyone bothering to try. Now that someone has not only tried but succeeded and released a significant product based on it, I feel a little mixed -- part bummed that I didn't get to post first-discoveries, but part excited that Silverlight has potential for an Adobe AIR-like wrapper, both technically and legally.

The NY Times Reader for Mac sure isn't running on WPF, though, and it shows. The user experience is clunky and the lack of text flow is painful (try resizing the window or scaling the text). The whole thing is nothing like the WPF version, except only for the initial screenshot appearance (without interacting) and, perhaps, the actual content.

kick it on DotNetKicks.com

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , ,

Microsoft Windows | Web Development | Mac OS X | WPF

"Things OS X" link

by Jon 5/20/2008 11:49:00 AM

A friend gave me this link for great introductory reference to Mac OS X. This for my reference:

http://www.magicpubs.com/mac/macosx.html  

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Mac OS X

My First Mac-Ported C# App

by Jon 5/17/2008 3:10:00 PM

Here's a screenie of my little GDI+ (System.Drawing) based game engine ported to the Mac using MonoDevelop. The sandbox "game" instance is just some bouncing balls that collide against the walls, the rectangular blocks, and each other, with fairly realistic physics, emitting dual-light draw drop-shadows, etc. In Windows, DirectSound is also used to create stereo "bump" sound effects that make the bumping balls feel a little more realistic.

Wow, this only took about ten minutes, from "I wonder if .." to "wow, look at that, it's working!" My steps:

  • Add my home Subversion server as a SCM repostitory in MonoDevelop
  • Check out my game engine (called "Level1Engine") to ~/Documents/dev/Level1Engine
  • Watch MonoDevelop puke on the absolute UNC path of one of the project references
    • Manually add the missing .csproj file to the solution
      • MonoDevelop exits unexpectedly
    • Reopen MonoDevelop, reopen solution
    • Create a new project with the same name/directory as the broken project
    • Remove the generated sample .cs file
    • Add the existing .cs files to the project, in-place
  • Comment out the DirectSound references from the game engine class library. (Sadly, that means there's no sound yet.)
  • Let 'er rip

Overall, this blog post took me about twice as long as porting my app!

The result is not flawless, though. Rendering performance is about 1/3 what it is in GDI+ (in Windows), and apparently the 2D matrix transformations (which I had to touch for the drop shadows) are a little buggy in Mono because that text on the top left, which is rendered with System.Drawing, jiggles around erratically by about two pixels.  

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Pet Projects | Software Development | Mac OS X

Mac OS X 10.5 (Leopard) + VMWare Fusion + Mono = Bliss

by Jon 5/17/2008 8:13:00 AM

I have been using my new Mac Mini for less than 24 hours and it already looks like this:

In the screenshot I have VMWare Fusion with Unity enabled so that I have the Windows Vista Start menu (I can toggle off the Start menu's visibility from VMWare itself) and Internet Explorer 7. (I also have Visual Studio 2008 installed in that virtual machine). Next to Internet Explorer on the left is Finder which is showing a bunch of the apps I have installed, including most of the stuff at http://www.opensourcemac.org/. On the right I have MonoDevelop where I can write C# or VB.NET applications for the Mac, for Linux, or for Windows. And of course, down below I have the Dock popped up because that's where my arrow actually is.

I also, obviously, have an Ubuntu VM I can fire up any time I want if I want to test something in Linux. 

Mac OS X 10.5 (Leopard) comes with native X11, not out of the box but with the installer CD, and it's the first OS X build to do so (previous versions used or required XFree86).

This point in time is a particularly intriguing milestone date for the alignment of the moons and stars for blissful cross-platform development using the Mac as a central hub of all things wonderful:

 

  • X11 on Mac OS X 10.5
  • MonoDevelop 1.0 is generally gold (released, it's very nice)
  • System.Windows.Forms in Mono is API-complete
  • VMWare Fusion's Unity feature delivers jaw-dropping, seamless windowing integration between Windows XP / Vista and Mac OS X. And to make things even more wonderful, VMWare Fusion 2, which comes with experimental DirectX 9 support, will be a free upgrade.
  • For game developers, the Unity game engine is a really nice cross-platform game engine and development toolset. I have a couple buddies I'll be joining up with to help them make cross-platform games, something I always wanted to do. This as opposed to XNA, which doesn't seem to know entirely what it's doing and comes with a community framework that's chock full of vaporware. (But then, I still greatly admire XNA and hope to tackle XNA projects soon.)
  • The hackable iPhone (which I also got this week, hacked, and SSH'd into with rediculous ease), which when supplemented with the BSD core, is an amazing piece of geek gadgetry that can enable anyone to write mobile applications using open-source tools (I'd like to see Mono running on it). The amount of quality software written for the hacked iPhone is staggering, about as impressive as the amount of open source software written for the Mac itself. Judging by the quantity of cool installable software, I had no idea how commonplace hacked iPhones were.
  • Meanwhile, for legit game development, the Unity 3D game engine now supports the iPhone and iPod Touch (so that's where XNA got the Zune support idea!) and the iPhone SDK is no longer just a bunch of CSS hacks for Safari but actually binary compile tools.

 


 

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Jon Davis Jon Davis (aka "stimpy77") is a software and web developer by day and a software and web enthusiast (geek) by night. He was recently a senior web engineer for the enthusiast division of a major magazine publishing company for nearly two years. He has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps. Lately, Jon's professional focus has been on C#, ASP.NET, Windows services, WCF, custom Javascript libraries, and implementations of Lucene.net and telligent's Community Server for multiple web sites.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

E-mail me Send mail

Calendar

<<  August 2008  >>
MoTuWeThFrSaSu
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

View posts in large calendar

Pages

    Recent comments

    Authors

    Tags

    Blogroll

    Download OPML file OPML

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign in