Tuesday, January 24, 2006

Deploying VS.NET applications

This post aims at documenting my learnings during the deployment of a VB.NET application using the setup and deployment wizard in VS.NET (Version 2003).

To InstallShield or not is the question!

I had used InstallShield for deploying my VB 6.0 application

  • I had looked at the setup and deployment wizard of VB 6.0 and thought it sucked. I thought it was too primitive.
  • I had the .MSI file of the previous version and realized that some quick modifications to this MSI and I would have the installer for the new version.

Taking the path of minimum effort, I chose InstallShield at that time. ;)

So when faced with the task of deploying my VB.NET application, I was in a dilemma whether to use InstallShield or the setup and deployment of VS.NET. After playing around with VS.NET’s setup and deployment wizard and inputs from a colleague, I decided that VS.NET it was! InstallShield has a lot of advanced functionalities but VS.NET had everything I needed. Besides I remember reading somewhere that being 3rd party products InstallShield etc do not guarantee correct deployment.

ORCA

Orca is a database table editor for creating and editing Windows Installer packages and merge modules. Trying to understand each and every table of an installer in detail is like experiencing an information avalanche (for me) and so I restricted myself to studying this information as and when and as much needed. Having ORCA definitely helps.

Apparently some customizations for the installer can be done via ORCA alone. For ex. Asynchronous behavior between the installer and program launch after installation can be achieved by changing the Type entry for hex value row in the CustomAction table from 1554 to 1746. This does work, however what I would really like is that, the program should launch after I click the Close button on the installer i.e. the installer is DONE.

Remember that the changes you make via ORCA will be gone every time you build your Installer project. So don’t forget to redo the ORCA edits!

WISH

I keep tweaking my code and thus need to remove and add the EXE to the installer project every time I generate a new EXE. Bad thing w/ this is that I need to re-exclude some files in the dependencies list, re-create all the shortcuts that I have created (because they reference the old EXE), and re-assign all the icon files. What is worse is that the project compiles even if I miss out on one of these and I discover the problem in the form of a non-informative error code, when I run the install. :( How I wish there was an option where by one could just refresh the EXE! (Maybe there is and just that I haven’t discovered it yet)

WATCH OUT

  • Renaming a Custom Action = BAAD!
  • A “Just me” install will not uninstall an “Everyone” install.

STILL SEEKING SOLUTIONS

  1. Launching program after Installer has completed installation.
  2. Installing the .NET framework on the m/c during installation if it is not found.
  3. Having the “Would you like to launch program name..” dialog at the end of the installation as per the norm. The Install sequence has 3 phases Install, Progress and End. The wizard disallows any dialogs after the Finish dialog. So even if I place the dialog just before the Finish dialog, the custom action responsible for launching the program runs before this Finish dialog and hence does not work out as I would like it to. As of now, I have my custom dialog somewhere in the Install sequence after the Read Me dialog (very weird!).

TROUBLESHOOTING

When faced with an aborted install and a message box with a “not-so-helpful” error code, try running the installer w/ the log option. The log file will hopefully have the clue to all your miseries.

msiexec /I "installer.msi" /l*v "nameoflogfile"

Don’t fret if nothing works….because there is always GOOGLE and all the good people in the internet community who share and help! :)

useful links