Link to home
Start Free TrialLog in
Avatar of greg_white
greg_white

asked on

How do I associate/pair an Affiliate ID with a vb6 program for 100 affiliates without having to compile their code in each copy of the application?

I have a vb6 application.  I package it with Wise Installer, v 8.0

I want to give the program to affiliates and let them give it away to their lists, and when someone on their list buys it, the affiliate gets credit for the sale.

Each affiliate will have signed up for their own affiliate ID.

I am trying to do this in a hands off fashion.  
Avatar of Frosty555
Frosty555
Flag of Canada image

I have a suggestion for you. It's a little cludgy but I think it's graceful in its own way too.

EXE files have a header with version, copyright and description information. You can see it if you right click->properties on an EXE file in explorer and look at the Version tab.

Similarely, you can set this information in VB in your project properties, in the "Make" tab.

In your visual basic project properties, under the Make tab, change the "Comments" section to be
    AFFILIATE:0000000000     <-- with ten zeros

Then you compile your EXE. In a Hex Editor at the bottom of the EXE file will be some unicode with that string. It'll look something like

   .A.F.F.I.L.I.A.T.E.:.0.0.0.0.0.0.0.0.0.0

Where the . is a null char (ascii 00).

So, here's what you do, now you put this EXE on your web server. Provide your affilliate with a link that says soemthing like "Download your branded copy of the software". When they click it, the it links to a PHP page that opens the EXE for binary editing, and seeks until it finds that ".A.F.F.I... etc." string. It replaces the .0.0.0.0.0.0 with whatever is their affilliate ID. Remember to keep the length the same! For example, if the user's affilliate ID is 1634, replace it with:

   .A.F.F.I.L.I.A.T.E.:.0.0.0.0.0.0.1.6.3.4

Then the php script echos out the new exe to the user. Essentially it is a PHP downloader script that alters the exe before sending it out.

So the affilliate gets an EXE file and if they look at the version info in explorer, they'll see that Affilliate string with their personal affilliate ID in it.

On the VB side, you can get at this string using
      App.Comments

So when your VB application is registered, and it talks to the server, just remember to parse the affilliate ID out of App.Comments and pass that along with it. Your server can then go ahead and give the affilliate credit for the sale.

This way you don't have to recompile the EXE for each specific affilliate, and the data isn't stored somewhere easily editable like the registry, or an INI file.

However, keep in mind that anyone CAN just open the EXE file in a hex editor and change it just like your PHP script did. I would suggest you could instead store an md5 hash of the affilliate ID in the string, instead of storing it raw, this would make it more difficult for someone to edit it and mark it with different affilliate ID.
Avatar of greg_white
greg_white

ASKER

Do you know if the AFFILIATE:0000000000 would remail the same inside the WISE setup packaged?  
ASKER CERTIFIED SOLUTION
Avatar of Frosty555
Frosty555
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial