Tuesday, October 13, 2009

Join Me at The Bar

OK, so this is sideways to the topics I normally share but I thought hey; these are hard economic times! Every little bit counts and so I thought I would share it with you. Have you checked the hot new FREE online tool called "The Bar" yet? If you look closely, you'll see that you can get paid every time you click an Ad on the Internet! You'll also see you can get paid every time others click on Ads on the Internet! You can get all the details on the web site. There's no cost to you whatsoever! You even get all the tools for FREE and you can start making money today...right now! It's easy. Just register for The PowerBarClub, then watch the short Getting Started video and you can start generating cash today! You basically get paid to click on ads "The Bar" streams through a client-side service. I have tried it and there is nothing to it. It's just like clicking a Google ad, except you are requesting these ads through this client service. The video explains it better. It's so simple, anyone can do it. This is not a "Get Rich Quick" plan but rather something supplemental while you grow your other business ventures! It just doesn't get any easier than this. Meet you at The Bar! Go check it out right now.

Monday, September 21, 2009

Digitally signing an InstallShield Executable With An Automated Build Process

Those that are familiar with InstallShield knows about the option to digitally sign your executable, DLLs and other helper classes. You simply enter the paths to your .spc and .pvk certificates along with your password and the files are digitally signed ever time you build a release. You also have the option of using the newer .pfx certificate along with your password to do the same thing. Either way works just fine if you are manually building your installer. If you are trying to automate this process, you will run into trouble.

The sign process is one of the most hockey things InstallShield has slapped together. Have you ever noticed small dialog boxes that seem to flicker on the screen during the build of the release? That is the sign code in action. I'm pretty sure this process applies for several versions back, but the 2009 InstallShield Premier edition is where I discovered this blunder. What this is actually doing in the background is calling signcode.exe in the background and pasting your password into the dialog box that signcode prompts the user for. Obviously, when you are trying to automate the build process, no dialogs or UI of any kind can pop up or it will hang the program. That is what was happening to me.

There is a solution, sort of. In order to automate the build, you will have to pull the code signing out of InstallShield and do it yourself via command line. InstallShield uses SignCode.exe, but it also comes with SignTool.exe that will allow you to pass your password to it via command line. The one catch is that you must use a .pfx formatted certificate in order to use SignTool.exe. So, what I did was call ISCmdBld.exe to build my installer and right after that, I called SignTool.exe with the command line switches it would be looking for. The defination of switches available should be viewable if you place a /? after the call. The steps for automating the build process and calling SignTool.exe you will have to look up somewhere else. There are loads of data about how that works, but the one thing I never found spelled out anywhere is the fact that InstallShield simply is not capable of automating the digital signiture process inside of its build steps.

Thursday, September 17, 2009

Creating a Silent Installation with Acresso InstallShield

There are a few project types in which to develop your installations in. One common project type is the Windows Installer or MSI. However, the project type I am developing in is the InstallScript project type. In order for an InstallScript project to run silently, you must first create a response file. The file directs the setup through the answers that a user would normally have to answer. The response file is a text file except that it has the ".iss" file type normally named "Setup.iss". I'm not going to explain more about this response file process. That is well documented in other places and can be easily found on the internet. What I want to talk about is how the setup can be created as one executable with the Setup.iss wrapped into it.

Here is the trick that I couldn't even find in Acresso's knowledge base. To wrap the response file into the installation so it isn't a separate file that you have to lug around with the setup executable, put it in the Support directory. More specifically, place it in the "Disk 1" subdirectory under the Support section. Simple, but effective. It took me 2 days to discover how to do this.

The Woes of Developing With InstallShield

For a year now, I have been in charge of building the installation software for our applications. I use InstallShield to create the setup. The first thing I had to do was convert the project from InstallShield 6 to InstallShield Premier 2009. It wouldn't be so bad if there weren't so many gothcas about how things work.

For those of you that may not know what InstallShield is, it is basically the software behind making it simple to load software onto a computer. For example, if you wanted to load Microsoft Word to your computer, you would put the disc in and run the wizard-like setup process to install it. That wizard-like setup process is what InstallShield allows you to develop. I just wish some things where better documented and sometimes worked a little differently.

I've had to learn some tricks and unknown facts through lots of trial and error, so I'd like to share some of those tricks that have worked for me. There are several, so I'll break them up into other posts.

Sunday, May 3, 2009

The Core of AJAX: Part II

There are three (3) fundamental pieces to Ajax. The first piece is creating an object that most browsers can communicate with. Here is an example:

function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// If IE7, Mozilla, Safari, etc: Use native object
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
// ...otherwise, use the ActiveX control for IE5.x and IE6
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}

return xmlHttp;
}

This code uses deductive logic in implementing the correct object. If the object does not throw an error, then it is most likely suitable for the browser being used. Now that we have an object, we use it to update fields or images on a web page without having to refresh the entire page. To do this, requires the second piece which is a JavaScript function call something like this:

function updateCityState()
{
http = GetXmlHttpObject();
var zipValue = document.getElementById("zip").value;
var url = "City_State.php";
http.open("GET", url + escape(zipValue), true);
http.onreadystatechange = handleHttpResponse;
http.send();
}

You can tell by the previous function that it is used to populate the City and State fields by using the Zip Code the user typed into the Zip field. That is passed to a url that does the heavy lifting and returns the data it is looking for. In this case, that would be the city and state that matches the zip code passed. The third piece is the one that extracts the data and puts it where it is needed. It would look something like this:

function handleHttpResponse()
{
if (http.readyState == 4) {
results = http.responseText.split(',');
var city = results[0];
var state = results[1];
document.getElementById("city").value = city;
document.getElementById("state").value = state;
}
}

And that is Ajax in a nutshell. Of course, there are many more things that can be done in very creative ways, but underneath it all will be these three (3) basic pieces.

Thursday, April 9, 2009

My Frequency of Articles are Lacking

It doesn't seem like it has been 3 weeks since my last post, but it is! Projects at work have consumed my time and have been bleeding over into my personal time. I know ... excuses don't write articles. I think I'm going to need a schedule for my blog posts. From this point forward, I will do my best to write about something at least once a week.

Here are some things to look forward too. I'm going to write part II of AJAX and there might be a part III. I'll talk about the core of AJAX in part II and hopefully some good tips and tricks in part III if warranted. Also, I've been using InstallScript quite a bit lately and I just might rant about that later as well. Until then, TTFN (Taa Taa For Now).

Monday, March 16, 2009

Ajax Part I: It's not just your Momma's kitchen soap.

If there is any such thing as glamorous or popular software; Asynchronous JavaScript and XML (AJAX) would fall into that category. So let us break this down a bit. While the term AJAX was made popular in 2005, Asynchronous calls to HTML pages were first introduced in the mid-90s when Java revealed Java Applets. Contrary to the acronym's meaning, JavaScript and XML are not really required to utilize this technology.

OK, back to the mid-90s. True, it was possible to do background calls that only updated small parts of a single HTML page, but there was no standard. It wasn't until April of 2006 that a standard was recommended by the World Wide Web Consortium (W3C). What does this mean? Well, there was a recommendation. Most will probably follow the W3C recommendation, but there will always be a few who would like to do something a little different. So, for the most part, Ajax can be implemented and recognized by most of the today's popular browsers without dealing with too many exceptions to the rule.

So if there is now a basic standard, what's the deal with not necessarily having to use JavaScript or XML. As it turns out other scripting languages like VBScript and Enterprise Generation Language (EGL) can be used instead. And in the case of the XML, some use JavaScript Object Notation (JSON), preformated HTML or just plain text. I guess AVAJ, AVAT, AEAP, or AEAJ just didn't sound as sexy as AJAX. So what have we learned here today. Hmmm, sexy sells software.