0

I want to make installer (pkg) for my certain application on Mac OS X. I know about pkgbuild and productbuild commands and it is not problem to write simple script to make pkg. The problem is that I want to collect some information about user behaviour, when user run installer. For example, I want to know how many times users start intaller. For that purpose I deside to use Google Analytics, That's why my question is how can I make requests through http to google service? Of course, I know about cURL, but I don't know is this tool default in Mac OS X. Minimal version for my application is Mac OS X 10.7 Lion.

Thanks for help!

Kirill Chernikov
  • 1,387
  • 8
  • 21

1 Answers1

0

Finally, I have made some things to solve my problem, but I have failed to get exactly what I want.

First off all, for send http requests to google service I used curl. On the official Apple site I not found information about is this tool default for Mac OS X, but many articals in Internet say that this tool is default for Mac OS X. My GET requests with curl look like:

curl --request GET 'https://ssl.google-analytics.com/collect?v=1&t=event&tid=UA-...&cid=...&ec=...&ea=MacInstalled'

Secondly, I used preinstall and postinstall scripts for pkgbuild to perform curl commands. Very useful links on this step was:

PackageMaker How-to

Making OS X Installer Packages like a Pro - Xcode Developer ID ready pkg

Thirdly, I made only two requests to google service: directly before installation process in preinstall script (MacBeginInstall) and directly after installation process in postinstall script (MacInstalled). The problem is that I want to make request to google service when installer start (when user see first step of installer - welcome screen). I didn't solve this problem. May be it is impossible with pkgbuild command.

This is my experience, maybe it will be useful for somebody :)

Community
  • 1
  • 1
Kirill Chernikov
  • 1,387
  • 8
  • 21