Modifying a Windows Installer to add a GUID

  c#, installation, laravel, php

Our service has a demo application written in C#. The demo application installer can be downloaded after filling out a form on our website which collects the user’s email, name, etc. This application is now modified to collect some generic user statistic information, which will be sent via REST to an API and then stored in a database.

The issue is, a unique GUID that represents the customer ID is generated by the website server (PHP, Laravel). I need a way in which I could pass on that GUID to the application when it is installed so that the application can then use this GUID in the REST messages it sends to the data collection API.

I have come up with some options:

  1. Passing the GUID as part of the installer filename: This would mean renaming the installer to be something like setup<GUID>.exe. Then parse and store this into a registry key. The problem here is that a simple rename of the file would break the feature.
  2. Reading the GUID from a cookie: The server could make a cookie containing this information and the application could read from that cookie. However, without knowing beforehand what browser, etc. the user uses, it could be difficult to read that cookie.
  3. Using IP: The server could map the IP address of the client with the ID, however, IP addresses aren’t the most reliable as identifiers.

Coming to the solution I feel could work the best:

  • Modifying the Setup: Before serving the file, could the server (PHP, Laravel) somehow modify the setup to add a text file or maybe modifying the setup metadata itself to contain this GUID string?

Thanks a lot!

Source: Ask PHP

LEAVE A COMMENT