Article

Imagen de raghuveer_talekar
article
Reads:

%count lecturas

Score:
0
0
 
Comments:

0

How to Create a Windows Debug VC++ Runtime Package with Silent Install Support

Author Info

22 April 2009 - 5:07pm
Submitted by: raghuveer_talekar

(View Disclaimer)

This article provides complete, in-depth technical information on creating VC++ Debug Runtime Libraries and Silent install support for the package using a Setup and Deployment Project. This article also gives you a tip on how to check whether this package is already installed using its unique id.

Products: Novell Products (eDirectory, IDM etc) and Third Party application which needs vc++ runtime dependency for debug libraries.

While testing a Windows debug version application in your environment you need to have the vc++ runtime debug libraries installed. It's a known fact as many of the forums, documents say why it is required. Why not the release version? For the release version of the application, you need to have the vc++ runtime release libraries. But release versions of the libraries don’t work with the debug version of the application as there are dependency and name mismatch. Microsoft provides release versions of these libraries so that you can use those while testing and deploying the products, but debug versions are not available. The biggest challenge for anyone who is writing an installer for the debug application for testing purposes is to have these libraries installed in silent way. We will be focusing on this part, as the first part, i.e creating debug libraries is pretty easy.

First Part: Create Debug VC++ Runtime Libraries using Setup and Deployment Project of VS2005.

Microsoft MSDN already contains documentation to create this. Please refer to the link below for more details on this.

How to: Deploy a Setup and Deployment Project:
http://msdn.microsoft.com/en-us/library/ms235317.aspx

There are a few changes that we need to make to add customized silent install support…..so I will list the steps required to achieve this.

Second Part: Silent install support for Microsoft VC++ Debug Runtime Libraries.

  1. Open Microsoft VS2005 IDE
  2. File -> New -> Project
  3. New Project Windows Appears
    1. Under project type list select “other project types -> setup and deployment”
    2. On the right hand side of the window select “Setup Project”
    3. Enter some name for the project and click “Ok”
  4. Follow the 1-5 step specified in the below link
    http://msdn.microsoft.com/en-us/library/ms235317.aspx
  5. Now you need to add certain properties to this Setup and Deployment project so that you can trigger silent install on it with unique id for checking whether this package is already installed or not.
    • You need to modify any custom screens so that your debug runtime libraries look similar to release version provided by Microsoft. Click on the project name -> Right Click -> View ->

      Here we you will see following options:

      File System Editor
      Registry Editor
      File Types Editor
      User Interface Editor
      Custom Actions Editor
      Launch Conditions Editor

      Now we are interested in the User Interface Editor. Select that option and remove all the individual interface from the right hand side window. You can select most of the interface nodes and press delete. By doing this we can get rid of the user interface screen that appears, as we are just interested in a silent way of installation.

      Now click on the project name. In the property view, change version number, product name and mainly note the product code value (ex: {0CB09B03-E13D-4434-A107-38DF5375C9D3} ), which is required for detecting the previous install of the same package. Change other properties if required.

    • Now build the project. You should get two files... setup.exe and yourproject.msi. We are interested in yourproject.msi only.

Third Part: How to check previous installation of above created debug setup binary

What we have from the previous step is ProductCode and .MSI file.

You need to use the MsiQueryProductState(ProductCode) function to check whether it is already installed or not. If the return value from the above call is == INSTALLSTATE_DEFAULT then the package(.MSI) is already installed, otherwise you can install it using the step below.

Fourth Part: How to carry out Silent install for the above created debug setup binary

Execute the following command to carry out silent install.

msiexec /i your_project.msi /qb! ARPNOREPAIR=0

your_project.msi => This is the package that you created in step 2-3.

/qb! => b! says do not display the cancel button on the install window. Similar options are available, you can use msiexec /? to get all the options.

ARPNOREPAIR=0 => Repair will be disabled for this package.

That all....

If anyone needs more help on this, you can drop me an email @ traghuveer@novell.com or raghuveer.talekar@gmail.com. I would be glad to answer your queries.


Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

© 2013 Novell