InstallShield Tips and Techniques

June 26, 2007

Dress up the dialogs with customized bitmaps

Filed under: Dialogs — shieldmaster @ 12:05 am

I absolute detest the generic bitmaps that InstallShield provides with the dialog screens.  For a market leading product – why are the bitmaps so kindergarden looking? 

There are two distinct types of bitmaps used with the product line:  the dialog bitmap and the banner bitmap.  The dialog bitmap is used on the “exterior” dialogs, typically the Welcome and Summary – but is also found on the Maintenance dialog screen.  Here is a sample image:

exterior_bitmap_orig.jpg

 There is another bitmap used as the banner on all of the interior screens, here is a sample image:

 interior_bitmap_orig.jpg

There is a lengthly document that has been posted on the InstallShield Tips and Tricks webpage

http://www.installshield.com/news/newsletter/details.asp?source=isd 

Here is the specific link to the article: 

http://www.installshield.com/news/newsletter/0301-articles/DialogBitmaps.asp

Unfortunately it is very confusing to read, so I will attempt to boil the process down to the essentials.

How to change all Exterior Bitmaps

Navigate to the Direct Editor and look at the contents of the binary table – here is a sample:

directeditor_binary.jpg

Look for any entry that has “ISDialogBitmap.ibd”  – which is the bitmap used in the InstallShield exterior dialogs (they use the legacy extension “.IBD” instead of “.BMP”.  If you replace the path entry with a path to your customized bitmaps they will appear in all of the exterior bitmaps.

How to change all Interior Bitmaps

Look for any entry that has “ISDialogBanner.ibd”  – which is the bitmap used in the InstallShield interior dialogs (they use the legacy extension “.IBD” instead of “.BMP”.  If you replace the path entry with a path to your customized bitmaps they will appear in all of the interior bitmaps.

Bitmaps specifics

I recommend that you take a copy of the “ISDialogBitmap.ibd” and “ISDialogBanner.ibd” bitmaps (rename them to .BMP) and have the Graphics group get the specifics on the attributes.  Note that on the bitmap for the exterior dialogs, the image can only be on the left side of the bitmap.  Everything in white will be transparent in the dialog and all of your text will be superimposed.

Here is the location for these default bitmaps on a InstallShield v11.0 project:

C:\Program Files\InstallShield 11\Redist\Language Independent\OS Independent

Customized Bitmap Storage

If you read my post on “Path Variables and Project Organization” then you realize the best approach would be to store the bitmaps in a location that any InstallShield project can access.

I typically create a storage location and place all components used accross multiple InstallShield projects.  Here is a sample structure of reference files stored along side the InstallShield projects. 

ref_directory.jpg

I can store the customized bitmaps in this location:

C:\Project Source\Reference Files\Bitmaps\Dialog Bitmaps

 If I use the technique discussed about Path Variables, then I would add a new Path Variable to the project “PATH_TO_DIALOG_BITMAPS” and create a path reference such as:

<ISProjectFolder>..\..\..\..\Reference Files\Bitmaps\Dialog Bitmaps

Then within the Direct Editor, I would simply alter the source path to reflect this:

 directeditor_binary2.jpg

Imported Dialogs

Doesn’t seem to be on topic, but guess what happens if you export one of your dialogs that has a customized bitmap?  Turns out when you import the dialog into another InstallShield project, you will see a strange file “InteriorBin1″ littered somewhere in your project structure.  This is the way InstallShield attempts to handle the customized interior bitmap.  Don’t believe me – just take the file and add the .BMP extension and open it with Paint.  If you want to get rid of it, simply go back into the Direct Editor and alter the path reference for this to be your customized interior banner bitmap and rebuild.

Hope this helps!

Charles

June 21, 2007

Path Variables and Project Organization

Filed under: Reference Materials — shieldmaster @ 9:23 pm

Did you ever open a project and find that various components (binary files, .RUL, etc. ) were missing? 

Typically you will discover that the last person who maintained the InstallShield project did not take care of organizing the project carefully – letting components be littered accross the network. 

For example, here is a image of a complex project with files being pulled from who knows where…

pathvariables_1.jpg

With files being pulled from such a myriad of locations, it is bound to lose some over time. 

 Solution – Organize and use Path Variables correctly.  Let’s first discuss how best to organize your project files. 

 Project Files Organization

 Look at how I organize a typical project

projectdirectory_1.jpg

Under the Project directory will be the InstallShield .ISM project, with all supporting files found within the store directory. 

If you have full control of the source staging, then stash it under the Source directory.  Typically the source will be staged in a specific directory after a build process.   Ensure all components are placed within the Source Management repository for ensuring the ability to rebuild the project for future upgrades.

But what happens if the next person places the project structure on a different drive? Or a different directory structure?  If you utilize Path Variables correctly, then you can shift the project around and never encounter a problem when you go to rebuild the project.

Path Variables 

When you look in the InstallShield project at the Path Variables panel, notice that you have a constant reference point.  That is where the project .ISM resides – which is referenced by the Path Variable <ISProjectFolder>.  No matter where the project structure is placed (on a network or buried in sub-directories), if you set your Path variables up to have a reference to the ISProjectFolder then any file can be found.

The easiest method to determine this is to count the directory up from the project .ISM file.  For example, for the bitmaps used as replacements for the basic interior/exterior dialogs, they exist in the sub-directory “..\TestProject\packages\store\Bitmaps_Icons\Dialog Bitmaps”.  To reference them I will need to go up one directory from the .ISM, and then drive down into the “store” sub-directory until we get to the dialogs.   Bottom line, the path reference would be:

<ISProjectFolder>..\store\Bitmaps_Icons\Dialog Bitmaps

Now look how the other path variables can be resolved to reference everything else in the projct structure:

pathvariables_2.jpg

Well, I hope this helps you to organize your project files so that when you get to pass on a project for maintenance, the next guy can find everything – right where you left it.

Charles
InstallShield Tips and Techniques
InstallShield Consulting
InstallShield Tips and Techniques
InstallShield Consulting

June 18, 2007

Top 10 Issues in InstallShield that will bite you!

Filed under: Reference Materials — shieldmaster @ 9:17 pm
  1. Never use Dynamic File linking.  Never, NEVER!  Causes severe problems when attempting Upgrades/Patches.  More posts have been written on how to work around issues caused by this. 
  2. When creating Custom Actions, always name it unique (i.e, ISI_StopServices, ISI_ModifyRegistry) – this will assist you in quickly determining if the C.A. was successful within the MSI logging.  
  3. When referring to the same file numerous times (for example a specific version of a Release Notes) try to make a string value and reference the string value (@Release_Notes).  This will prevent having to locate each and every occurrence when the name changes.
  4. Caution when using SQL within project – default will attempt to uninstall scripts at application removal, which will destroy customer data.  Always leave database data populated – let the DBA handle deletion. 
  5. Issues with XML within project working – most Developers cannot get it working correctly – check the message boards.  If you use XML query to grab values during a AppSearch, expect excessive time delay. 
  6. Have staging for binaries separate from the compile output directories to ensure only specific items are handled within project.  This will ensure that when a build process fails, the last good compile is not incorrectly incorporated into the InstallShield CAB files.
  7. COM Extraction
    1. Concept works most of the time – but must guard against developer hard include of ATL code, and situations which end up having the developer workstation machineIDs incorporated into web server configs.
    2. Never run COM Extract at build time – extract and verify and freeze.  Granted, this runs the risk of developers adding functionality without notifying IS Developer who will need to extract COM again. But when they do this, you may encounter possibly new Microsoft Redistributables need to be included as well. 
    3. Personnally I recommend never do COM extraction.  Use scripting instead to register/unregister all files for ease in specifying sequence.  Yes, you could use properties to select registration – but then need to use DirectEdit on the ISSelfReg table to specify sequence – which applies to both install and uninstall.  Think of long term maintenance aspects – Keep It Simple, Simpleton! NT Services
    1. Again the issues with COM Extract has caused me serious problems with hard includes of ATL code
    2. I cannot easily specify which other Services to stop/start in specific order when I have more than one service – consequently I use scripting to Stop/Start the services when required
    3. I use scripting to create the services and then unregister the service on uninstall.  
  8. Windows Installer “Repair” capability has issues.  Although typically the restoration of a DLL/Executable has been flawless (when used with Static File Linking), the Repair process also will drive in the InstallShield project registry.  In my situation, the registry template carried in the IS Project will have properties (Version, INSTALLDIR, [PropertyValue]) that are reflected within the project registry – I also take customer input from the dialogs and translate that into fields to update the registry after it has been applied to the workstation.  Since the “Repair” process does not present dialogs – so it doesn’t resolve the property values – the resulting registry is essentially corrupt because of missing values.  To resolve, I have created Custom Actions that run before a “Repair” to archive the registry to a file, and another Custom Action that runs after the “Repair” to delete the registry and restore from the archived file. 
  9. InstallShield version 12 has been radically restructured and you may encounter serious issues within your project’s scripts when you upgrade. For example there are the issues that I have encountered:
    1. Global variables will no longer pass information to scripts – but no message is given, either during compile or execution – just blank values received.
    2. Within the “Execution Sequence”, the ability to extract values from predefined directories (INSTALLDIR, SETUPEXEDIR, PROGRAMFILES) will no longer work.  Again, no message is given, either during compile or execution – just blank values received. 
    3. Within the “Execution Sequence”, the ability to extract values from MSI Properties that were defined during the “UI Sequence” will no longer work. Again, no message is given, either during compile or execution – just blank values received. 
    4. Conceptually, the use of the MSI Property “CustomActionData” is allowed – but severe gyrations required to pass multi-value string into the MSI Property during the “UI Sequence” for retrieval during the “Execution Sequence”.  I ended up writing all of the values needed in the “Execution Sequence” to a registry while they are accessible during the “UI Sequence”.  Then during the “Execution Sequence” when I need a value (i.e,., INSTALLDIR), I extract the values from the registry. 

InstallShield Tips and Techniques
InstallShield Consulting
InstallShield Tips and Techniques
InstallShield Consulting

June 16, 2007

Tools and Utilities

Filed under: Reference Materials — shieldmaster @ 9:30 am

A word about tools/utilities that I use to do my job. 

To do the job of building installations, you must be meticulous about testing – almost fanatical!  One of the requirements of testing installations is a set of tools & utilities that you are comfortable and can depend on to analyze and give you dependable results. 

But a bigger issue is that we are human and once we get comfortable with a set of tools, we tend to ignore newer, more robust tools that become available.  Force yourself to learn a new tool.  Given that, I am going to embrace a new tool – at the bottom of the list is a replacement for wordpad that I am going to download and try.  See – I am trying to grow too!

Last comment.  Most are not freeware – they are build by professionals who expect a small monetary contribution/fee.  When you appreciate the time savings, please take the time to pay for a license.  It is only fair.

 VMware

Vendor:  VMware, Inc.

www.vmware.com

Use:  Virtual Machine concept.  Started using in 2003 and found it invaluable in install testing.  Have created multiple Operating Systems and snapshots with each Service pack install – so testing of Win2000 with no SP and Win2000 with SP1 installed can be done quickly and effectively.      

Many Server OS will have Databases installed for customer testing (Oracle and SQLServer).  After testing, can quickly restore OS image to be back to pristine state prior to install testing.

At the time, the only comparable solution was Symantec Ghost – which is a great solution, but required a separate machine to be available.  When I started I had a dedicated testing machine and used Ghost – but finally was swayed by the ease of VMware.

  Beyond Compare 

Vendor:  Scooter Software

www.scootersoftware.com

Use:  Excellent tool that allows me to compare both single files and entire directories to look for differences after installs.  Great for upgrade testing.  Superior than others in that it will allow simple right click to select a directory to compare against another. 

 PFE: 

            Freeware & no longer supported

            http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/

Use:  Started using this file editor because of the ability to execute dos commands and get output into the editor.  Now very comfortable and hesitate to change to better ones.  (hmm…)

 SR

            Search and Replace

Funduc Software, Inc.

www.funduc.com

Use:  Excellent for search for strings in multiple .RUL files.  Has a replace function which works quite well when evaluating/altering resource files across the entire project.  Also has a batch command interface for running scripts.

 FileGrab

            Ziff-Davis Publishing

            Freeware

Use:  Once Windows File Explore allowed you to search for various files within a sub-directory, I use this tool to highlight the selected files and copy the file names into a panel – which I then can copy into a editor for creating batch files. 

For example, I can create a Batch file for registering all of the dlls within an application for testing.  I start by doing a search of the directory using *.dll with the Windows File Explorer, highlight all of the files and drag into FileGrab.  Then copy the file path & names into a .BAT file and place “regsvr32.exe ” in front of each line. 

 Microsoft Virtual PC

Microsoft Product

Workstation version 2007 is now free!

Use:  trying to take over the market share from VMware in the Virtualization market.  Good product, I hesitate to give up VMware because of the ability it has to create a snapshot and return to that state. 

http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx

           

Dependency Walker           

http://support.microsoft.com/kb/256872

Use:  Microsoft tool that I use to debug issues with DLLs not registering – when there are missing dependencies.

 MSI Zap

Microsoft Windows Installer Cleanup Utility

http://support.microsoft.com/kb/290301

Use:  Microsoft tool that will safely eliminate all traces of a MSI registered application from the registry.  Useful when all else fails during a unsuccessful removal/uninstall.

 

Monitoring tools (RegMon, FileMon, DiskMon)

Original utilities were created by Mark Russinovich, and recently acquired by Microsoft and will be upgraded to new versions “Process Monitor”. 

http://www.microsoft.com/technet/sysinternals/utilities/regmon.mspx

Use:  when you are tracking down issues with an install that is hitting the registry but somehow is being denied access, these tools can display realtime information on the keys that are being accessed – and which programs are doing it.

Invaluable during repackaging efforts that requires a bit of investigative tracking.

           

 XMLStarlet 

Open Source XML editor that has a valuable command line execution. 

http://xmlstar.sourceforge.net/

Use:  can use in Custom Actions to obtain data from XML documents and update them in a batch method.  No issue distributing with your installation. 
Documentation on how to use it for complex tasks is not truly covered in the doc – information is available only thru the expertise of the users in various forums.

 TextPad 

Robust Wordpad replacement – kind of like wordpad on “steroids”.

http://www.textpad.com/products/textpad/features.html

InstallShield Tips and Techniques
InstallShield Consulting
InstallShield Tips and Techniques
InstallShield Consulting

June 15, 2007

InstallShield Reference Books

Filed under: Reference Materials — shieldmaster @ 3:15 am

isbook.jpg

 I get quite a few requests for some good reference books that will help to understand InstallShield.  As it turns out, most are written by InstallShield employee’s – go figure.

 Here is my list of beneficial reference books that I frequently pick up and review:

Practical Windows Installer Solutions

Author: Bob Baker – 2004.

Most recent book on the subject, again written by Bob Baker – at Technical Trainer at InstallShield Corp, and the prolific author of at least three InstallShield reference books.  Focus is on truly practical solutions to application packaging; the section on understanding Patches and Updates is worth the price.

http://www.amazon.com/Practical-Installer-Solutions-InstallShield-Applications/dp/0971570833/ref=sr_1_11/105-2782788-1155664?ie=UTF8&s=books&qid=1181875516&sr=8-11

The Official InstallShield for Windows Installer Developer’s Guide 

Author: Bob Baker  – 2001

Bob Baker is the author – this book is somewhat dated because it used the ISWI tool – when it was still in competion with IS’s version 6, it does have a good bit of instruction on how to create Dialogs using the internal C++ dialog layout editor.  It discusses thoroughly the concept that I fully embrace – using Basic MSI with InstallScript Custom Actions to extend its functionality.

http://www.amazon.com/Official-InstallShield-Windows-Installer-Developers/dp/0764547232/ref=pd_sim_b_2/105-2782788-1155664?ie=UTF8&qid=1181876931&sr=8-4 

BulletProof Installs

Author: Leslie E. Easter – 1998

Written when IS 5.0 was in production – quite aged and showing its age.   The first book that I know of that approached the authoring of install setups as a method to achieve a solid install of a product.   One of the strongest presentations of the intricacies of the InstallScript language that you can find.

http://www.amazon.com/Bulletproof-Installs-Developers-Install-Programs/dp/0137980914/ref=pd_bbs_4/105-2782788-1155664?ie=UTF8&s=books&qid=1181876931&sr=8-4 

Getting Started with InstallShield Developer and Windows Installer Setups

Author: Bob Baker – 2002

This book uses IS Developer 7.x as the model – which allows you to continue to be comfortable all thru version 12.0.  Granted there are subtle changes and new additions (XML Editing,  SQL Scripts, etc), but by far most of the panels and dialogs look quite similar.  A testament to the graceful aging of the IS Product line.

http://www.amazon.com/Getting-Started-InstallShield-Developer-Installer/dp/0971570809/ref=pd_bbs_sr_3/105-2782788-1155664?ie=UTF8&s=books&qid=1181877155&sr=8-3 

Administrator’s Introduction to Application Repackaging and Software Development using Windows Installer 

Authors:  Bob Baker and Robert Dickau  – 2002 (Robert Dickau is a frequent contributor in the InstallShield forums.)  

Although this is THE book for Repackaging applications (taking legacy app and using the AdminStudio product to create a MSI for distribution) it goes i-ndepth into Tranforms and handling locked-down environments.  

http://www.macrovision.com/services/education/publications/repackaging/index.shtml 

Mastering Windows XP Registry

Author: Peter Hipson  – 2002

This book provides an in-depth reference to various HKLM registry keys that I can use to determine NT Service status, how to plug information into the “RUNONCE” registry key, etc.

http://www.amazon.com/Mastering-Windows-Registry-Peter-Hipson/dp/0782129870/ref=sr_1_5/105-2782788-1155664?ie=UTF8&s=books&qid=1181877227&sr=1-5 

 

June 14, 2007

Just starting…

Filed under: Uncategorized — shieldmaster @ 4:24 pm

My friend Milind Sathe impressed me recently with his Blog site (http://milindsathe.wordpress.com) – and he encouraged me to start off with my own.  So here goes!

My goal is to put out tips and techniques for working with InstallShield – the authoring engine that I have used for years to develop installation setups.  Hopefully those people who have need a just a little help will find this site beneficial.

Mike and I work closely together, so this will be a collaborative effort.  Hopefully the learning process will be relatively painfree…

CharlesDynamic Duo

Blog at WordPress.com.