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?

Posted on 2007-08-08
Last Modified: 2013-11-29
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.  
Question by:greg_white
    LVL 31

    Expert Comment

    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


    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 . 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:


    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

    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.

    Author Comment

    Do you know if the AFFILIATE:0000000000 would remail the same inside the WISE setup packaged?  
    LVL 31

    Accepted Solution

    I suppose it depends on if the WISE package is compressed or not. I know some packages are just zip files, and inside is a file like myapp.ex_, which is uncompressed and unencrypted, the file is just renamed accordingly. Other packages use CAB files and then you'll have more difficulty getting at it.

    If it is just a regular zip file, there are some php functions that let you manipulate files in zip files.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    count7 challenge 12 52
    strCopies  challenge 17 60
    wordcount challenge 11 47
    drawing animated level bar based on numbers 3 43
    A short article about a problem I had getting the GPS LocationListener working.
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now