Saturday, 2 February 2013

Mass converting InstallShield Binary project files to XML format

It's been so long and so far, it seems like my blog carries just a few IT professional entries (or another way to say, there is only one, LOL). There were many reasons, but the most important one was that I've never thought I'm able to write anything here that you cannot find  an answer somewhere else on the Internet. Google is a magic wand, with just couple of key words, it will lead you as far as you are willing to go. 

However, I'm thinking in a different way now. If my expertise isn't that special, I still should share some simple tips for beginners (like me), who are struggling to reveal an answer from hundreds of Google returns as I was. Also, if I'm lucky enough, I may receive some good feedback to improve my work. Again, Google will introduce my blog to strangers and some of those strangers may turn to be my great supporters. This entry thus will introduce a tiny piece of work on InstallShield project format conversion from binary to XML by commands (of course you can use the same routine to convert back from XML to binary).  

I've been back with InstallShield just for a month or so. Actually, I used to work with InstallShield v.6.0 years ago. At that time, the main purpose was not much than a self experiment. My old company used Visual Studio 2005 Setup, the installer project was pretty simple. Therefore, my experience on InstallShield can be considered as 0.000001 or thus. My great challenge with InstallShield this time is to manage the entire build environment (including manual and automatic setup) of a most complicated installer I've been dealing with. I don't know how good things are going, but I'm enjoying what I'm doing.

The current installer projects I'm handling are still using binary format, which is the most common one and also the default one created for new projects by InstallShield. Actually, binary format is good in some aspects such as speeding up opening and closing time on huge projects; or being compatible with Windows Installer. However, to a software manager or a development team (teamwork), binary format is a big NO. It's extremely hard (or impossible) to track and merge changes with a binary file. That's why binary file and source code control are not friends. And now you could guess, I need to do a research on pros and cons of XML project file format and convert all current projects to XML if possible. 

CONVERT is a big word in this context actually. If you open a project in InstallShield, it's extremely simple that you just need to go to project general information and switch file format from binary to XML, press Save and you've done with it. Just in my situation, that solution won't help. I have around 30 active project files. I cannot just open one by one, switch and commit to our source code control. Our regular upcoming release won't allow us to leave any undone work behind. I need to convert, build and find all drawbacks first. That means I also have to convert back and forth many many times during my experiment. A pop-quiz rises in mind, is it possible to mass convert all project files at once by command line?

Searching for every related topic on InstallShield forum as well as the help manual, the only useful piece of hint is found here. Actually, this piece of info is dug pretty deep though. 

As you can see, the answer is yes, it's possible and the answer is documented in one line, using ExportProject from Automation Interface.  As long as InstallShield supports a way, the rest is simple.

I share my VBScript here as a reference (password: whsh). Hope you don't mind my temporary work there. The code is for InstallShield 2012 Spring. However, I think you can find equivalent Automation objects for other InstallShield versions easily out there. From that piece of code, you may also know how to convert XML files back to binary format. If it's a case, explore ImportProject function :-o). Any question or feedback, feel free to drop me a comment below. Enjoy!

1 comment:

  1. Thanks for sharing an informative post! Here I knew how Binary project files to XML format. Waiting for next post.


Thanks for leaving your comments

Related Posts Plugin for WordPress, Blogger...