Online Serial Key Validation with InstallAware, the Updates Part

A question we get a lot here is how exactly our update mechanism works. It’s actually very straightforward. You define your existing software update packages inside our IDE, which saves that information inside an updates.ini file. You then upload both the update installers (patches, single exe’s, whatever you like) and the updates.ini file, overwriting the old INI if any, and you are good to go! The next time a scheduled update check runs, your users will be automatically notified by the InstallAware Web Update Client that new updates are available for download. But what if you want to check for updates each time that your application is launched, and automatically install them if any are available?

As I am fond of saying, InstallAware is extremely flexible. There’s a very simple way to do this. To get started, open the updates script at the MSIcode tab – this is found under the “Include Scripts” heading of the Project Manager which is normally docked to the left of the IDE in the MSIcode tab.

and then

The updates script creates shortcuts for the InstallAware Web Update Client wrapper. If you look at lines 24 and 26 of the standard update script, you’ll see that these shortcuts point to the $UNINSTALLLINK$ pre-defined MSIcode variable. This pre-defined variable points to your setup.exe file as cached on the target system, which acts both as your setup driver, and also the web update client.

Now, in your main setup, instead of creating a shortcut for your application’s EXE file (ex: C:\Program Files\My Software\My Application.exe), create a shortcut for $UNINSTALLLINK$ instead (type this inside the Shortcut to File field), and specify the “/update” command line parameter for the shortcut, which will start setup.exe in web update client mode (instead of the regular maintenance/uninstallation mode).

Also, remember to change the shortcut icon to your application’s icon, so your users won’t be confused with a setup icon in their Start Menu.

Now, every time a user clicks your application’s shortcut in the Start Menu, the web update client will launch, and check for updates! But of course, we still need to fix the web update client so it’ll know to launch the main application after checking for updates. Otherwise, users have no way of running the application, since the Start Menu shortcut doesn’t even point to your application anymore.

This is easy too. Again, on the MSIcode tab, navigate to the updates script.

Search for the “Terminate Installation” command throughout the updates script. I recommend typing Ctrl+F and searching for “Terminate“, and then repeating the search by typing F3. That way you won’t miss anything.

Before each “Terminate Installation” command, insert a “Run Program As” command with the target being your main application file (such as “$TARGETDIR$\my application.exe”), and also setting the working directory to “$TARGETDIR$“.

Copy-paste this command before each “Terminate Installation” command inside the updates script. With this simple trick, your application will launch any time the web update client exits – be it upon user abort, failure, or successful update installation. You’re fully covered since you addressed each script termination point.

What if you want to check if this end-user has not paid her subscription fees and thus updates are not to be made available for her? It’s easy. Set up a web page and call it like I described on my previous post using Download File and Parse String – to find out if your user is eligible for updates. I do this by passing her serial number as a parameter to my custom check_updates.aspx page on the server, and then I read back the response. If the response is “1” the end-user can update but if the response is “0“, the end-user is denied access to the update. When the response is “0” you can place another “Run Program As” and “Terminate Install” command pair, in order to make your program run directly without checking for updates. You should place all of these MSIcode commands at the very top of the updates script, before any actual web update client code runs.

Coming up next: It’s about time to look at some .php and .aspx code, and also MySQL and MS SQL database scripts, for the server back end! Don’t miss it! 🙂

Panagiotis Kefalidis
Software Design Team Lead
InstallAware Software Corporation

5 Replies to “Online Serial Key Validation with InstallAware, the Updates Part”

  1. Cheers a lot for discussing this specific with all people today you undoubtedly understand what you’re really communicating roughly! Bookmarked.. language tutor Make sure you furthermore consult with my website Implies). We are going to have a very url deal deal involving united states

  2. I am only writing to let you be aware of what a brilliant discovery my princess enjoyed going through your site. She came to understand a good number of things, which include how it is like to have a marvelous helping mood to have the mediocre ones without difficulty master some tortuous subject matter. You truly surpassed readers’ desires. Many thanks for giving such warm and helpful, dependable, educational and as well as cool tips about that topic to Julie.

  3. I not to mention my friends came viewing the nice pointers from your web site then all of a sudden got a terrible suspicion I had not expressed respect to you for those strategies. My young boys ended up for this reason thrilled to learn them and now have absolutely been making the most of those things. Thank you for really being indeed thoughtful as well as for choosing varieties of tremendous things most people are really desirous to understand about. My very own honest regret for not saying thanks to you sooner.

  4. Really, most popular and established companies with online company website now turn to affiliate marketing programs. The reason is that it allows them to have their items sold to a large range of people, aside from those in their web website traffic.

Leave a Reply to Betbong365 Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.