How to detect the existence of a program, ie. Firefox on a Mac?

Discussion in 'Apple' started by justaguy, Dec 9, 2011.

  1. justaguy

    justaguy Guest

    Once again, I am not a Mac user.

    How to detect if a given Mac computer has Firefox installed already?
    Using shell scripting. And if it does not exist prompt a window with
    a msg: "Firefox is required. Please install it first", abort

    With Windows OS,
    the syntax would be
    -- for 32bit
    if exists "C:\Program Profiles\Mozilla Firefox" then goto nextRoutine
    -- for 64bit
    if exists "C:\Program Profiles(386x)\Mozilla Firefox" then goto

    Thanks in advance.
    justaguy, Dec 9, 2011
    1. Advertisements

  2. justaguy

    Gerry Guest

    As an only Macintosh user I would not use any program that told me what
    other application I needed to install. As I use Safari as my browser I
    don't want to be told to install some other browser.

    Gerry, Dec 9, 2011
    1. Advertisements

  3. justaguy

    Paul Sture Guest

    Sorry I can't answer that question, but I _can_ tell you that the above
    code would fail on all the Windows systems I have here.
    Paul Sture, Dec 9, 2011
  4. justaguy

    Guest Guest

    yet you are writing mac software?

    even if you could write mac software without a mac, how are you going
    to test it? are you just going to ship it and let the users come back
    to you with trashed systems, after you hack up their system files?
    why is firefox required? let the user pick whatever browser they want
    to use.
    that will break if the user renames or moves the app.

    Guest, Dec 9, 2011
  5. justaguy

    justaguy Guest

    remove "then"
    justaguy, Dec 9, 2011
  6. justaguy

    Jeff Gaines Guest

    And correct the directory names...
    Jeff Gaines, Dec 9, 2011
  7. justaguy

    Warren Oates Guest

    Okay, what kind of app are you creating that "requires" Firefox above
    any other browser?
    Warren Oates, Dec 9, 2011
  8. justaguy

    justaguy Guest

    It's not that one browser is superior to another, just that as a
    startup we Do Not Want to Complete on every front (can't afford
    that). Firefox is good enough...
    justaguy, Dec 9, 2011
  9. justaguy

    Warren Oates Guest

    Yah, but, c'mon -- I don't use Firefox, I use Chrome. I keep FF around,
    of course, with all the other browsers I might want to look at my HTML
    in. But not everyone has FF installed. If I got a message like that, I'd
    think, "Yeah, sure. This is the same crap those Winders Wankers have
    been shoving down our throats for years with that IE."

    I assume you mean "Compete"? Your Flash app should work with the plugin
    on _any_ browser (including the "built-in" one in Chrome).

    Of course, Facebook are being arseholes about old versions of Flash
    right now ...
    Warren Oates, Dec 9, 2011
  10. justaguy

    Paul Sture Guest

    Nope. You are testing for Firefox in the wrong location.

    I, as many others do, install non-MS software into an alternate directory
    on Windows.

    You should really look for the appropriate Windows system call to see if
    an app is already installed.
    Paul Sture, Dec 9, 2011
  11. justaguy

    justaguy Guest

    What do you mean?
    justaguy, Dec 9, 2011
  12. justaguy

    justaguy Guest

    What's fuc? ware you talking about? We're NOT talking about
    installing a Windows app here!
    justaguy, Dec 9, 2011
  13. justaguy

    Alan Baker Guest

    Here's a thought for you:

    Why don't you tear into a couple of actual install packages for the Mac
    and see how they do things?

    You can right-click on a Mac ".mpkg" and select "Show Package Contents",
    and then you can look at how things are done.

    And just FYI, your check for Windows doesn't actually check for the
    existence of Firefox the application: it only checks that a directory
    where the program SHOULD be located is there.
    Alan Baker, Dec 9, 2011
  14. justaguy

    Alan Baker Guest

    And just assume that the existence of the directory means that the
    program is still in there, too...

    Alan Baker, Dec 9, 2011
  15. justaguy

    justaguy Guest

    Why did you keep on forgetting the fact I mentioned again and again,
    I'm NOT a Mac user and don't have a Mac handy.
    Yes, I know but 99% of users don't have a /Mozilla Firefox empty
    directory there
    And if the project is related to highly scientific endeavor then what
    you are saying is 100% correct and must be done that way.
    justaguy, Dec 9, 2011
  16. justaguy

    justaguy Guest

    But again, you DID NOT answer the Very Question of the thread if you
    got an answer, what's the point?
    justaguy, Dec 9, 2011
  17. justaguy

    Alan Baker Guest

    I didn't forget it. I just don't care. I'm actually getting quite tired
    of seeing you get good advice only to ignore it.

    If you're developing Mac software, you need a Mac around.
    Alan Baker, Dec 9, 2011
  18. justaguy

    Alan Baker Guest

    Are you paying me? Because I was not put on this earth to answer the
    questions of someone who claims to be interested in developing for the

    ....unless it means that he has to actually has to get out there and
    learn something.
    Alan Baker, Dec 9, 2011
  19. justaguy

    Alan Baker Guest


    But if you want people here to believe that you're worth explaining how
    things should be done on the Mac... would be nice if they had a reason to believe you'll actually pay

    And demonstrating that you can't do it properly on your primary platform
    doesn't suggest that it would worth bothering to tell you how to do it
    properly on a Mac, does it?
    Alan Baker, Dec 9, 2011
  20. justaguy

    justaguy Guest

    "Apple's ancient FindFolder() API", that probably does not fit into
    the shell scripting that I was talking about, why propose something
    not helpful, instead of drop an answer if you got one?
    justaguy, Dec 9, 2011
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.