Geeks With Blogs
Adventures of a Setup Developer my musings about setups and other things in my life

This, I guess, is my first InstallShield specific post. MSI is good in a lot of things but not when dealing with more than one package in a single transaction. MSI engine is designed to be run as a single instance and cannot be used effectively to install more than one package. Nested installations are possible but often lead to undesired consequences. Having a setup chainer is good but it involves writing code and handling reboots. So, for all who are using InstallShield DevStudio and up can benefit by using the InstallScript project as their setup launcher and monitor. We can effectively "script" a launcher application and have complete control over the installation process using the available libraries.

Why InstallScript....? I would not usually recommend InstallScript for any of the custom actions in the project, as the MSI-Scripting bridge is a little weak and has certain limitations. However, InstallScript libraries would cut down most of the code that you would have to write with a brand new C++ application. Also the scripting engine supports the silent mode. So you do not have to code separately for that either. But on the flip side, you would have an overhead of 1 Meg for the InstallScript engine. But this is okay considering the fresh set of bugs that you would introduce with the first version of the launcher application. For those not concerned about silent mode, you can check out the free open source setup launcher (dotNetInstaller).

The trick here is to use the InstallScript's program....endprogram syntax instead of the event based model. This makes sure that you do not register the application and does not call unknown events in between. Good old block scripting. <smile/> This also means that you need to take care of exceptions. If you are a setup developer from the good old InstallShield Professional 5.x days, you would immediately be at home with this kind of approach. So a simple script to just display a message box would be as below.

#include "ifx.h" //The standard header
//Our program block starts here
program
 MessageBox("Hello World!",INFORMATION);
endprogram

InstallScript engine just executes the statments present between the program and endprogram statements. As you can see, this approach gives you the flexibility of a complete scripting language with libraries custom made for creating installations. InstallScript projects are known for their flexibility but miss on the other aspects of MSI such as Elevated Privileges, Install on Demand, Source Resiliency and Self-healing.

Posted on Monday, December 13, 2004 5:16 PM Setup | Back to top


Comments on this post: Using an InstallScript application as the setup launcher

# re: Using an InstallScript application as the setup launcher
Requesting Gravatar...
In the past I have done some really cool but unorthdox stuff in IShield Pro projects.. things that didn't actually install anything. But I think for this example you should look at the new "setup prerequisites" capabilities of IShield. setup.exe is replaced with setuprereq.exe and it has the ability to process .PRQ files ( XML documents ) that give it very good install chaining abilities. This solves the various problems of the execute sequence having a mutex. ( Child intalls, merge modules instead of prereq redist installs ).
Left by Christopher Painter on Jan 04, 2005 9:32 AM

# re: Using an InstallScript application as the setup launcher
Requesting Gravatar...

For a major flashback to 1997......

We were using IShield Pro 5.0 and InstallFromTheWeb 2.0. We needed a web page that the user could go to download the client application. They also wanted the ability to point the client to a new server without reinstalling. So I made a special IShield project that had some dialogs asking for hostname, it would then resolve the IP Address of the hostname using winsock calls and do an HTTP get looking for the contents of a special URL. Then it would display the server information in a dialog for confirmation. Once complete it would reconfigure the client settings and exit. We called it the ServerConnector and it was basically an ActiveX/Java wrapper app that ran using InstallScript. There were no setup types, components or filegroups.
Left by Christopher Painter on Jan 04, 2005 9:36 AM

# re: Using an InstallScript application as the setup launcher
Requesting Gravatar...
I am aware of the Setup Prerequisites feature included with InstallShield X. But pushing for a new software upgrade costing a whole lot of $$$s every six months means going through a loooot of red tape even for a wealthy software house. I totally agree that InstallShield produces very good quality software but it changes too often. I am also excited about the XML changes view in InstallShield 10.5. I haven't personally evaluated it and hope to do so in the near future. MS should really think of adding XML change tables in addition to its INI file chages table. :-)
Left by Vagmi Mudumbai on Jan 04, 2005 9:41 AM

# re: Using an InstallScript application as the setup launcher
Requesting Gravatar...
Well I'm not exactly pleased with InstallShields product release and support cycle ( Release? Sure, point releases every six months, pay up! ) ( Support?!?! HAHAHA buy the new version )

I admire some people enthusiasm over WiX, but I'm not prepared to go that route with the amount of work that comes my way on a daily basis. I just tell my director of technology that yes InstallShield is expensive, but so is my labor rate! So here is where you buy the yearly maintenance contract from InstallShield.

Left by Christopher Painter on Jan 04, 2005 10:23 AM

# re: Using an InstallScript application as the setup launcher
Requesting Gravatar...
Trust me Chris, the support guys have their hands tied down lest they have to face liability for the solutions they provide. I was with support earlier. Even if the support engineer knows that the open-source, free dotNetInstaller (www.devage.com) does the same work as the InstallShield Prerequisites launcher, he cannot offer it as an option to InstallShield Developer and DevStudio users.
Left by Vagmi Mudumbai on Jan 04, 2005 11:20 AM

# re: Using an InstallScript application as the setup launcher
Requesting Gravatar...
I agree that setup.exe/setuppreq.exe isn't rocket science. I may start using the dotNetInstaller yet.
Left by Christopher Painter on Jan 07, 2005 7:20 AM

# re: Using an InstallScript application as the setup launcher
Requesting Gravatar...
How Are You
Left by asad on Mar 19, 2006 5:55 PM

# re: Using an InstallScript application as the setup launcher
Requesting Gravatar...
FYI InstallShield 12 Beta 1 has just been released. They have done a complete rewrite of the ISScript runtime. IDriver.exe, DCOM, ROT is completly gone. Your RUL file now gets compiled to a Type 1 CA with entry points for each of your exported functions. You can easily export the DLL from the binary table and import it into a new MSI, add the CA and Sequence records and done.
Left by Christopher Painter on Mar 29, 2006 3:32 AM

# re: Using an InstallScript application as the setup launcher
Requesting Gravatar...
I agree that setup.exe/setuppreq.exe isn't rocket science. I may start using the dotNetInstaller yet.
Left by sanjit on Jun 14, 2006 2:32 PM

Your comment:
 (will show your gravatar)


Copyright © Vagmi Mudumbai | Powered by: GeeksWithBlogs.net