Showing posts with label WiX. Show all posts
Showing posts with label WiX. Show all posts

September 3, 2012

MSI Log File Analyzer - WiLogUtil.exe

WiLogUtl.exe is very handy to interpret the Windows Installer log files. It assists to analyze Windows Installer installation log file and suggests solutions to the errors found in those log files. Please note that this does not display or high-light non-critical errors.

All you need to do is Download Windows SDK and install  "Debugging Tools for Windows" feature under "Developer Tools".

Laucnh WiLogUtl.exe from "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin" and open any of you MSI*****.LOG file for analysis.

Here is a good article on different options to enable logging.

July 24, 2012

Planning for a New Installer? Be ready with these Parameters..

Installer is NOT a last minute Surprise!

When you start with an all new Product or creating an ancillary kit or application for the existing product line, we may have to create a new installer for the deployment. With the Agile Methodology for development, at the end of each iteration, the product should be in a shippable state. Hence designing and developing the installer in parallel along with the product development would help us not only to have the product ready in a shippable state at the end of the iteration but also helps the QA to verify quickly.
·         Application Name
·         Application Description
·         Application Version Number
·         Company Name
·         Support Information to be displayed in ARP Panel
     a.   Publisher Name, URL
     b.   Contact Name, URL
     c.   Support Phone Number
     d.   Read Me File, if any
     e.   Product Update URL
      f.   Comments, if any
·         License Agreement, if any
·         Hardware Requirements
·         Default Installation directory
·         Installation condition like
       a.    Supported Operating System
       b.    Supported Platform - 32-bit / 64-bit
       c.    Admin privilege required?
·         Add / Remove programs entry required?

·         Icon & Images
                    a.    Product specific icon for ARP entry and installer output file?
                    b.  Custom Images for Installer dialog and installer startup splash screen 

        c.   Billboard (images run in background during installation) required?
·         List the Pre-Requisite software checks  (example .Net Framework 4.0 etc.,)
·         Do you need to ship any Pre-Requisite software along with the installer? If yes, list them
·         Silent installation required?
·         Globalization / Localization support? If yes, list the supported languages
·         Shortcuts? If yes, provide the name and physical path (relative to the installation directory) for all the proposed shortcuts
·         Do you bundle any merge module?
·         Answer these questions for succeeding release of the product
a.    Detect previous version?
b.    Do we need to support co-existence with the previous versions of should we upgrade?
c.    Upgrade should me a Patch or Minor upgrade or Major Upgrade.
[Note: It’s a good practice to plan the release artifacts in advance.]
·         Feature Details
o   Feature List with name and description
o   Feature / Component / File association
o   Optional or Mandatory feature
·         UI sequence for installation
o   Custom dialog, if any for user input
·         Post installation configuration like..
o   Create a Service
o   Create a Website / Virtual directory / App Pool
o   Restart IIS
o   Update config files
o   Register a  DLL
o   Create a database / Run a query / attacha a database
·         UI sequence for maintenance mode (remove, repair or modify)
o   Custom dialog, if any for user input  - modify option
·         Pre or Post uninstallation configuration like..
o   Delete a Service
o   Delete Website / Virtual directory / App Pool
o   Restart IIS
o   Update config files
o   unregister the  DLL
o   Remove the database / detach a database

·         Mode of deployment
o   Large scale deployment through SMS or Active Directory or Citrix Server
o   Web Deployment
o   Click Once Deployment
o   Stand Alone Server / Client

With these inputs, Agile Team can define the scope of the installer and estimate all the associated tasks for Installer development as well as testing.

·         Reboot required at the end of installation / uninstallation       
·         Windows Logo Guide lines Validation for the installer - Mandatory / Optional?

July 11, 2012

Updating an xml file using VBScript Custom Action

  1. Create a VBScript Custom Action stored in Binary Table (MSI Type Number: 6)
  2. Here is the Sample xml file (say address.xml), which is considered for updating in the below VBScript CA
         <Address>
              <Name>Smitha</Name>
              <Address1>123B, 16th Cross</Address1>
              <City>Bangalore</City>
         </Address>
  3. Write the following code in the VBScript file
Function UpdateXMLFile
     On Error Resume Next               
         
    Set objDOM  = CreateObject("Microsoft.XMLDOM")
    Set objParentNode = CreateObject("Microsoft.XMLDOM")    
    if Err.Number = 0 then             
          
                       ' Declaration
                       
dim FileName
                       dim name
                   
   dim address1
                     
  dim city
   Set objNet = CreateObject("WScript.NetWork")                
   set objNet=nothing                
              
    name=Session.Property("NAME")    
    address1=Session.Property("ADDRESS1")
    city=Session.Property("CITY")
 
     'update address.xml file
      FileName= Session.Property("INSTALLDIR")+"\"+"address.xml" 
      objDOM.async = false  
      objDOM.load(FileName)                                                
     if (trim(name)<>"" and trim(address1)<>"" and trim(city)<>"") then
         ' update name
          strXPath = "
/Address/@Name"
          set objParentNode = objDOM.selectSingleNode(strXPath)
          objParentNode.text = name           
 
         ' update address1
          strXPath = "
/Address/@Address1"
          set objParentNode = objDOM.selectSingleNode(strXPath)
          objParentNode.text = address1           
 
        ' update name
         strXPath = "
/Address/@City"
         set objParentNode = objDOM.selectSingleNode(strXPath)
         objParentNode.text = city 
  
         objDOM.Save(FileName)
                     end if
                 end if
           end function ' End of UpdateXMLFile

  4.    Set the following properties for the Custom Action (RestartIIS)

  Script Function -> UpdateXMLFile
  Return Processing -> Synchronous (Check exit code)
  In-Script Execution -> Immediate Execution
  Install Exec Sequence -> After InstallFinalize
  Install Exec Condition -> &FeatureA=3 and Installed.
This condition means that FeatureA is selected for installation and the FeatureA is installed (Installed state will be true as the CA is scheduled to execute after InstallFinalize).       

  [Note: This code snippet is tested with InstallShield 2012 Basic MSI Project. Should be compatible with earlier versions of InstallShield as well.]

July 10, 2012

Restarting IIS in MSI using VBScript Custom Action

This article focus on writing a Simple VBScript Custom Action to Restart IIS.

1. Create a VBScript Custom Action (RestartIIS) Stored in Binary Table (MSI Type Number: 6)

2. Write the following code in the VBScript file
Function RestartIIS()
     Set wsShell = CreateObject("WScript.Shell")
     Set fso = CreateObject("Scripting.FileSystemObject")

     winPath = WsShell.ExpandEnvironmentStrings( "%windir%" )
     netPath = fso.BuildPath( winPath, "system32" )
     toolPath = fso.BuildPath( netPath, "iisreset.exe" )
     WsShell.Run toolPath, 0, true
     set fso=nothing
     set WsShell=nothing  
End Function
3. Set the following properties for the Custom Action (RestartIIS) 
    Script Function -> RestartIIS
    Return Processing -> Synchronous (Check exit code)
    In-Script Execution -> Immediate Execution
    Install Exec Sequence -> After InstallFinalize
    Install Exec Condition -> &FeatureA=3 and Installed
                                           This condition means that FeatureA is selected for installation and the FeatureA is installed (Installed state will be true as the CA is scheduled to execute after InstallFinalize).
[Note: This code snippet is tested with InstallShield 2012 Basic MSI Project. Should be compatible with earlier versions of InstallShield as well.]

June 28, 2012

Custom Action Types - Simplified

The following table categorizes the basic types of custom actions
Custom Action Types

May 25, 2010

Where is the ICON for Add/Remove shortcut is stored?

Most of the product owners prefers to use Custom / Product specific icons for Add / Remove Programs (ARP) entry instead of using the default InstallShield or Windows Installer icon. Though we have an option to specify the ARP icon while creating the installer, we always wonder where this icon is stored after installation. This article details about that.

Once the product is installed, the following registry key is created.
  • HKEY_CLASSES_ROOT\Installer\Products\0CBC24CEC944140453282975376B5482   
ProductIcon - C:\WINDOWS\Installer\{EC42CBC0-449C-4041-3582-925773B64528}\ARPPRODUCTICON.exe
  • The Custom ARP icon is stored in the form of ARPPRODUCTION.exe under C:\WINDOWS\Installer\<ProductGUID>. This is just a few kb file which has the Custom icon set for it. Please note that C:\WINDOWS\Installer is a hidden folder.
  • Now you will wonder where does the key - 0CBC24CEC944140453282975376B5482 comes from. Being the developer you can easily conclude that this code is neither a Product Code nor a Package Code nor an Upgrade Code. There is a small trick involved in forming this code from Product Code and here is the steps to arrive the same
    • Remove the curly braces and write the Product Code
      EC42CBC0-449C-4041-3582-925773B64528
    • Reverse each piece of the Product Code
      0CBC24CE-C944-1404-5328-2975376B5482
    • Remove the spaces and -'s between the above code and you will get
      0CBC24CEC944140453282975376B5482This is used under HKEY_CLASSES_ROOT\Installer\Products.

February 25, 2010

How to Register a .Net assembly into GAC using WiX?

Ealier we have seen some articles to register a .Net assembly into GAC using either gacutil.exe or RegAsm.exe. In this article we will see the code snippet to register the assembly into GAC using WiX.

<Directory Id="ProgramFilesFolder">
<Directory Id="ProductDirectory" Name="$(var.ProductName)">
      <Directory Id="GAC" Name="GAC">
          <Component Id="MyGACControl" Guid="55857611-A13E-51ED-897B-A78830F68ADC" DiskId="1">
                <!-- Registering assembly in GAC -->
               <File Id="F_MyGACControl" Name="MyGACCtrl.dll" LongName="MyGACControl.dll" Source="$(var.SrcPath)

               \MyGACControl.dll" KeyPath="yes" Assembly=".net"/>
           </Component>
      </Directory>
</Directory>
</Directory>

The highlighted text - Name="GAC" Assembly=".Net", in the above code drives the .Net assembly registration into GAC.


Read the following related articles:
  1. How to register a .Net assembly into GAC in a development environment?
  2. How to Register .Net assembly into GAC using InstallShield 2010?