Windows Installer, Java Installer, Freeware Installer
Home|Contact|Site Map|TOC|Search
Download  Features   Java  Licensing  Purchase  Testimonials  Support  Forums

How do I collect installation data and send it to my web server?

Answer

Sometimes an installation package may need to collect installation data and send it to your web server.

You may need to collect, by means of Windows Installer properties, usage information statistics, hardware information, or user information such as:

  • User information - USERNAME, COMPANYNAME, LogonUser, UserLanguageID, etc.
  • Operating system - SystemLanguageID, Version9X, VersionNT, VersionNT64, ServicePackLevel, WindowsBuild, etc.
  • Hardware configuration - Intel, Intel64, AMD64, PhysicalMemory, VirtualMemory, ScreenX, ScreenY, ColorBits, etc.
  • Other custom collected information - any property value you set by a Windows Installer search, standard or custom actions.
What information to collect ?

You need to specify what information should be collected and sent to your web server. Install information can only be collected through Windows Installer properties (their values). You can specify what property values should be collected by enumerating their names in the Advanced Installer special property called: HttpPostCollectData, separated by ; .

For example, if you want to collect the user name, the company name, the user's email, and his language, you set the property HttpPostCollectData with the value: USERNAME;COMPANYNAME;USER_EMAIL;UserLanguageID. (Some built-in Windows Installer properties are automatically set by the package, other custom properties must be set by means of package UI or custom actions.)

Where to submit the collected information ?

You can specify the URL where the collected information should be submitted in the Windows Installer property: HttpPostUrl. For instance, set the HttpPostUrl property with the value: http://www.example.com/myapp/collectdata.php. Your web server must host a web application capable of processing and storing the received information. You can use the Apache/PHP/MySQL suite, or IIS/ASP.NET/MS-SQL suite, or any other web technology convenient to you.

How the collected information is sent ?

The web transfer protocol is HTTP/1.1 or HTTPS (depending on the URL you specify). The submit request method is POST. The HTTP headers specify the following "Content-Type":

Content-Type: application/x-www-form-urlencoded; charset=utf-8

Advanced Installer will send every property you specify in HttpPostCollectData as a POST variable, with its value set according to the installation state.

In the above example, the following POST variables will be set:

  • USERNAME = User Name
  • COMPANYNAME = User's Company
  • USER_EMAIL = email@domain.com
  • UserLanguageID = 1033 (English US)
Web Server Response

The HTTP server request response, if any, can be accessed through the Advanced Installer; property: HttpPostServerResponse. You can use the value of this property to organize the logic of your installation package.

TipDuring a HTTP POST request a "Please wait..." message box will be spawned in the installation package. You can suppress the spawned message box by setting the HttpPostSuppressSpawnMsgBox property to 1 .

How to use

In your Advanced Installer project

Custom actions Go to the Custom Actions page and add the predefined UI Custom Action "Send install information to your web server".

Dialog editorGo to the Dialog Editor page.

New dialogCreate a new dialog in order to collect the information you want.

Collect Dialog

Go to Events Editor tab (Dialog Editor view) and add the following published events on the [ Next ] button:

Add two SetProperty events for the "HttpPostUrl" and "HttpPostCollectData" properties.

  • Name: [HttpPostUrl]
  • Argument: http://www.example.com/myapp/collect_db.php
  • Condition: 1
  • Name: [HttpPostCollectData]
  • Argument: USERNAME;COMPANYNAME;USER_EMAIL;UserLanguageID
  • Condition: 1

Add a DoAction event which will execute the HTTP POST operation.

  • Name: DoAction
  • Argument: SendCollectedData (the custom action name you created earlier)
  • Condition: IAgree = "Yes" (set this property if the installing user agrees with your Privacy Policy)

Control Events

In your web server application

Your web application should be able to handle retrieving POST variables send by the installer package. In this case, the following variables will be POSTed: USERNAME, COMPANYNAME, USER_EMAIL, UserLanguageID. You can choose to use the collected information as you need, as long as you disclose to your client what data you collect and for what purpose.

NoteYou can download an example which uses a PHP script over a MySQL database, or uses a server install/registration log file.

Privacy Policy

WarningIf you use this functionality you should disclose the information to be collected to the user and ask for his permission before sending any information to the web server. We strongly recommend that you display Privacy Policy document detailing what information you collect and how you intend to use it.

Privacy Policy | Windows Installer | Search Engine Ranking | Link Analyzer