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.

Thursday, March 5, 2009

Book Review: C++ How To Program

This book titled C++ How To Program; authored by Deitel & Deitel, has been around for a long time. There have been many editions, but that really doesn't matter. All the editions are going to outline the core structure of the C++ language. If you are wanting to learn Object Oriented Programming (OOP), buy this book now. I bought the 5th edition over 2 years ago and I still refer to it when I need to refresh my memory on certain topics like object pointers.

Beyond the fact that you will be learning the semantics and syntax of the C++ programming language, Deitel & Deitel do a great job of detailing the core mechanics of OOP. No matter what Object Oriented language I am using, the fundamental knowledge of OOP I gained from reading this book will apply. The other thing I really like about the book are the tons of sample code. Usually, a CD is included with the sample code on it or at the very least a website address is mentioned where the sample code can be downloaded.

Sunday, March 1, 2009

My Languages of Choice

I don't know about you, but I approached the software industry in a very indirect and resistant way. Every since I received my first computer for my 13th birthday, I knew I was going to pursue a technology related career. I know, that is a very broad and ambiguous goal but it was what it was. Ironically, I had tried simple programming early on and didn't think it was for me. Instead, I decided to take the hardware/networking career path. I started reading every related book I could get my hands on. I quickly learned that having certain certifications would give me more legitimacy so I started taking the tests. I became A+ certified, Net+ certified, I became a Microsoft Certified Professional (MCP) and I think you get the picture. The more I learned, the more intrigued I became with what technology could do for me, my family, my future family and others around me to improve quality of life. It only took me a "few years" (I'm a little slow) in this part of the industry to realize that if I wanted to use electronic hardware to improve on inefficiencies I had recognized, I would need to learn how to program into it want I wanted it to do.

Ah yes, I finally got back around to the point of this post! What software language should I learn to use first? Again, I think I took the harder path in learning about the world of software programming, but that's just me. You have probably heard of BASIC; not Visual Basic, but plain ole DOS based BASIC. That was my first language. It's a great first step in learning the "BASIC" concepts of programming, but not at all very useful in actually doing anything. I moved on to it's big brother Visual Basic. I later tried Delphi, FORTRAN, Pascal and JAVA. At this point, I found JAVA to be my favorite language. I liked that it was compiled once and could run on any operating system and processor chip set. I thought I had found the holy grail of software languages, but as most of you have already discovered there are always trade offs in whatever language you choose to use. With JAVA, the major trade off at the time was it's sluggish runtime. You see, in order to run on any platform, it created a Virtual Java Machine between the operating system and the low level machine code. This takes up more resources and therefore would sometimes show up as delayed responses to user input. There are other pros and cons, but that was the main one.

Later on in my college career, I took classes on PHP, SQL and C#. Now considering the fact that somehow I had not learned more about the C and C++ languages up to this point unknowingly had left huge holes in my understanding of language concepts. If I could start over, I would have learned C++ first. Historically, many of the other languages I had learned first were derived from the C and C++ language. It has objects, classes, static data types, inheritance, polymorphism, functions, constructors, destructors, you name it it's in there! If you are starting down the software development path, I would highly recommend starting with the C/C++ language. It will help you learn more about Object Oriented Programming than any other language I can think of. I promise you if you do, other languages will be so much easier to learn. I hope someone out there finds this to be useful information. I know this would have been for me. Until next time, code like a wild west cowboy and try not to shot yourself in the foot.

Friday, February 27, 2009

Somewhere in Cyberspace

Hello everyone and welcome to what I hope will become a hub for software developers (and "technically involved users") to gain inspiration, share ideas and make that hard to understand concept easier to understand. I am a software developer by profession and admittedly, I like finding simplicity within complexity. I am more like that guy who down-plays the level of complexity involved rather than use a bunch of really long and technically intelligent words to explain what I've done. Sure, that would make what I do sound more impressive, but I'd rather know that what I am sharing is really understood.

I think you get the idea of where I'm going with this blog. I want to share ideas and learn too. I'll be sharing my options of technical books I read and new languages I'm using. One thing I know all you programmers out there have experienced is once you've learn a couple of languages, it's real easy to pick up on other languages. I don't exactly know how I want to arrange this blog yet, but I'm hoping it just transforms to what the reader is looking for. Wish me luck, and by all means, give me feedback!